<div dir="ltr">Hi Heiko,<br><div class="gmail_extra"><br><div class="gmail_quote">On Sun, Apr 19, 2015 at 12:30 AM, Heiko Stübner <span dir="ltr"><<a href="mailto:heiko@sntech.de" target="_blank">heiko@sntech.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">platform_get_irq() can return negative error values and we already test for<br>
these. Therefore the variable holding this value should be signed to not<br>
loose error values.<br>
<br>
Reported-by: David Binderman <<a href="mailto:dcb314@hotmail.com">dcb314@hotmail.com</a>><br>
Signed-off-by: Heiko Stuebner <<a href="mailto:heiko@sntech.de">heiko@sntech.de</a>><br>
---<br>
drivers/gpu/drm/rockchip/rockchip_drm_vop.c | 2 +-<br>
1 file changed, 1 insertion(+), 1 deletion(-)<br>
<br>
diff --git a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c<br>
index ccb0ce0..bde1c1e 100644<br>
--- a/drivers/gpu/drm/rockchip/rockchip_drm_vop.c<br>
+++ b/drivers/gpu/drm/rockchip/rockchip_drm_vop.c<br>
@@ -104,7 +104,7 @@ struct vop {<br>
/* lock vop irq reg */<br>
spinlock_t irq_lock;<br>
<br>
- unsigned int irq;<br>
+ int irq;<br></blockquote><div><br></div><div>Hmm. Both enable_irq() and disable_irq(), etc) want irq as an unsigned int.</div><div>The thing we want here is to detect a negative return value from platform_get_irq().</div><div>So, I'd slightly prefer changing to vop_bind() to something like this:</div><div><br></div><div> int irq;</div><div>...</div><div> irq = platform_get_irq()</div><div> If (irq < 0)</div><div> return irq;</div><div> vop->irq = (unsigned int)irq;</div><div><br></div><div><br></div><div>-Dan</div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<br>
/* vop AHP clk */<br>
struct clk *hclk;<br>
<span class=""><font color="#888888">--<br>
2.1.4<br>
<br>
<br>
</font></span></blockquote></div><br></div></div>