All of lore.kernel.org
 help / color / mirror / Atom feed
From: Randy Dunlap <randy.dunlap@oracle.com>
To: linux-kernel@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>,
	Mike Murphy <mamurph@cs.clemson.edu>,
	Dmitry Torokhov <dmitry.torokhov@gmail.com>
Subject: [PATCH -mmotm] xpad: fix build error and warnings
Date: Thu, 05 Mar 2009 18:57:42 -0800	[thread overview]
Message-ID: <49B09126.1040204@oracle.com> (raw)
In-Reply-To: <200903060051.n260p4gp022115@imap1.linux-foundation.org>

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 */


  reply	other threads:[~2009-03-06  2:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-06  0:33 mmotm 2009-03-05-16-32 uploaded akpm
2009-03-06  2:57 ` Randy Dunlap [this message]
2009-03-07  3:49   ` [PATCH -mmotm] xpad: fix build error and warnings Mike Murphy

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49B09126.1040204@oracle.com \
    --to=randy.dunlap@oracle.com \
    --cc=akpm@linux-foundation.org \
    --cc=dmitry.torokhov@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mamurph@cs.clemson.edu \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.