public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH -mmotm] xpad: fix build error and warnings
       [not found] <200903060051.n260p4gp022115@imap1.linux-foundation.org>
@ 2009-03-06  2:57 ` Randy Dunlap
  2009-03-07  3:49   ` Mike Murphy
  0 siblings, 1 reply; 2+ messages in thread
From: Randy Dunlap @ 2009-03-06  2:57 UTC (permalink / raw)
  To: linux-kernel; +Cc: Andrew Morton, Mike Murphy, Dmitry Torokhov

From: Randy Dunlap <randy.dunlap@oracle.com>

Add a dummy xpad_send_led_command() for the case of
CONFIG_JOYSTICK_XPAD_LEDS=n.  Fixes this build error:

ERROR: "xpad_send_led_command" [drivers/input/joystick/xpad.ko] undefined!

Remove 2 duplicate function prototypes in xpad.h.

Fix these xpad.h warnings:
drivers/input/joystick/xpad.h:231: warning: 'enum led_brightness' declared inside parameter list
drivers/input/joystick/xpad.h:231: warning: its scope is only this definition or declaration, which is probably not what you want
drivers/input/joystick/xpad.h:231: warning: 'struct led_classdev' declared inside parameter list
drivers/input/joystick/xpad.h:231: warning: 'xpad_led_set' declared 'static' but never defined

Signed-off-by: Randy Dunlap <randy.dunlap@oracle.com>
cc: Mike Murphy <mamurph@cs.clemson.edu>
cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
---
 drivers/input/joystick/xpad.c |    3 ++-
 drivers/input/joystick/xpad.h |    4 ++--
 2 files changed, 4 insertions(+), 3 deletions(-)

--- mmotm-2009-0305-1632.orig/drivers/input/joystick/xpad.h
+++ mmotm-2009-0305-1632/drivers/input/joystick/xpad.h
@@ -224,13 +224,13 @@ static void xpad_irq_in(struct urb *urb)
 static void xpad_irq_out(struct urb *urb);
 static int xpad_init_output(struct usb_interface *intf, struct usb_xpad *xpad);
 static void xpad_stop_output(struct usb_xpad *xpad);
-static void xpad_stop_output(struct usb_xpad *xpad);
 static int xpad_play_effect(struct input_dev *dev, void *data,
 			    struct ff_effect *effect);
 static int xpad_init_ff(struct usb_xpad *xpad);
-static void xpad_send_led_command(struct usb_xpad *xpad, int command);
+#ifdef CONFIG_JOYSTICK_XPAD_LEDS
 static void xpad_led_set(struct led_classdev *led_cdev,
 	enum led_brightness value);
+#endif
 static int xpad_led_probe(struct usb_xpad *xpad);
 static void xpad_led_disconnect(struct usb_xpad *xpad);
 static int xpad_open(struct input_dev *dev);
--- mmotm-2009-0305-1632.orig/drivers/input/joystick/xpad.c
+++ mmotm-2009-0305-1632/drivers/input/joystick/xpad.c
@@ -1076,9 +1076,10 @@ static void xpad_led_disconnect(struct u
 	}
 }
 #else
-/* dummies for xpad_probe and xpad_disconnect */
+/* dummies for xpad_probe, xpad_disconnect, & xpad_send_led_command */
 static int xpad_led_probe(struct usb_xpad *xpad) { return 0; }
 static void xpad_led_disconnect(struct usb_xpad *xpad) { }
+static void xpad_send_led_command(struct usb_xpad *xpad, int command) { }
 #endif
 
 /* end LED section */


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH -mmotm] xpad: fix build error and warnings
  2009-03-06  2:57 ` [PATCH -mmotm] xpad: fix build error and warnings Randy Dunlap
@ 2009-03-07  3:49   ` Mike Murphy
  0 siblings, 0 replies; 2+ messages in thread
From: Mike Murphy @ 2009-03-07  3:49 UTC (permalink / raw)
  To: Randy Dunlap; +Cc: linux-kernel, Andrew Morton, Dmitry Torokhov

On Thu, Mar 5, 2009 at 9:57 PM, Randy Dunlap <randy.dunlap@oracle.com> wrote:
> From: Randy Dunlap <randy.dunlap@oracle.com>
>
> Add a dummy xpad_send_led_command() for the case of
> CONFIG_JOYSTICK_XPAD_LEDS=n.  Fixes this build error:
>
> ERROR: "xpad_send_led_command" [drivers/input/joystick/xpad.ko] undefined!
>
> Remove 2 duplicate function prototypes in xpad.h.
>
> Fix these xpad.h warnings:
> drivers/input/joystick/xpad.h:231: warning: 'enum led_brightness' declared inside parameter list
> drivers/input/joystick/xpad.h:231: warning: its scope is only this definition or declaration, which is probably not what you want
> drivers/input/joystick/xpad.h:231: warning: 'struct led_classdev' declared inside parameter list
> drivers/input/joystick/xpad.h:231: warning: 'xpad_led_set' declared 'static' but never defined
>
...

Thanks Randy. I found the prototype for xpad_deinit_output to be
missing and will have a patch shortly. I will also be updating the
out-of-tree distribution of this driver version to match the current
-mm tree version:

http://cirg.cs.clemson.edu/~mamurph/pub/xpad/

Mike
-- 
Mike Murphy
Ph.D. Candidate and NSF Graduate Research Fellow
Clemson University School of Computing
120 McAdams Hall
Clemson, SC 29634-0974 USA
Tel: +1 864.656.2838   Fax: +1 864.656.0145
http://cirg.cs.clemson.edu/~mamurph

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-03-07  3:49 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
     [not found] <200903060051.n260p4gp022115@imap1.linux-foundation.org>
2009-03-06  2:57 ` [PATCH -mmotm] xpad: fix build error and warnings Randy Dunlap
2009-03-07  3:49   ` Mike Murphy

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox