Page 1 of 1

Patch: Remove warning when USB_RESET_HOOK is not defined

Posted: Sun Aug 22, 2010 10:32 pm
by Vegar
When USB_RESET_HOOK is not defined, gcc warns about an unused parameter in usbHandleResetHook:
usbdrv/usbdrv.c: In function ‘usbHandleResetHook’:
usbdrv/usbdrv.c:550: warning: unused parameter ‘notResetState’


This prevents me from using -Werror in my makefile (-Werror makes gcc treat warnings as errors, which I find very convenient).

The following two patches add __attribute__((unused)) to the notResetState parameter when USB_RESET_HOOK is undefined. There are two patches because I couldn't decide which way looks cleanest (they both have the same result), but I'm leaning towards reset2.diff

http://vegar.beplacid.net/~vegar/files/reset.diff
http://vegar.beplacid.net/~vegar/files/reset2.diff

Apply with 'patch -p0 < reset.diff' in the directory that contains the usbdrv/ directory.

I'm posting it here because I'm not sure where patches should be posted, and perhaps others can use this too.