Thread (4 messages) flat view 4 messages, 3 authors, 2007-08-31

Re: [PATCH] input: Silence 'unused variable' warning in iforce joystick driver

From: "Dmitry Torokhov" <dmitry.torokhov@gmail.com>
Date: 2007-08-31 15:26:53
Also in: lkml

Hi Jesper,

On 8/30/07, Jesper Juhl [off-list ref] wrote:
On 31/08/2007, Satyam Sharma [off-list ref] wrote:
...
quoted
Hmm, would this not still give a warning when JOYSTICK_IFORCE_USB=y?
Arrgh, I messed that one up real good...  Thank you for your keen eye Satyam :-)

quoted
[ I didn't know mixing code and declarations (not at top of statement
  block) was accepted style in the kernel ... ]
It's not the common case, but this is certainly not the only place in the kernel where we do it.

quoted
IMHO either you should at least wrap that case inside a {} of its
own (so that the int status; is at top of a statement block), or else,
Yeah, I should...
quoted
preferably, just add "__maybe_unused" to the first declaration that you
removed just now.
Here's an updated patch that actually works as intended.
I had a similar patch from Andrew Morton in my queue and it just got
merged. There should be no warning anymore.

-- 
Dmitry
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help