Hi Simon

On Thu, Jan 17, 2013 at 8:47 PM, Simon Que <[email protected]> wrote:
> This variable is initialized conditionally, based on whether a wiimote
> call succeeds.  However, the logic is not obvious to the compiler so it
> throws a warning.  Eliminate the warning by initializing "size" to 0.

Hm, I think it says:

  54         ret = wiimote_cmd_wait(wdata);
  55         if (!ret)
  56                 size = wdata->state.cmd_read_size;

...not touching "size" or "ret" inbetween...

  64         if (ret)
  65                 return ret;

...using "size" below...

Weird that gcc cannot figure that out that there is no path to line 66
where "size" is uninitialized. Anyway, I am fine with this fix. We
test for "size == 0" anyway.

Signed-off-by: David Herrmann <[email protected]>

Next time please copy the gcc-warning message verbatim into the
commit-message so we can more easily reproduce this and see which line
is affected.

Thanks for the patch
David
--
To unsubscribe from this list: send the line "unsubscribe linux-input" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to