Skip to contentSkip to conversation

sparse: leds-h1940.c: make non-exported symbols static

PATCH Applied Ben Dooks 2 participants 2 messages Jun 7, 2008 – Jun 9, 2008 1 message not in the archive LED

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

Ben Dooks

author
#1 lore raw

PATCH 4/5 sparse: leds-h1940.c: make non-exported symbols static

We do not need to export any of the routines inside drivers/leds/leds-h1940.c, so make them all static to quieten the sparse output for this driver.

Fixes the following sparse errors:
drivers/leds/leds-h1940.c:26:6: warning: symbol 'h1940_greenled_set' was not declared. Should it be static? drivers/leds/leds-h1940.c:55:6: warning: symbol 'h1940_redled_set' was not declared. Should it be static? drivers/leds/leds-h1940.c:85:6: warning: symbol 'h1940_blueled_set' was not declared. Should it be static?

CC Richard Purdie <[email protected]>
CC Linux Kernel <[email protected]>
CC Arnaud Patard <[email protected]>
drivers/leds/leds-h1940.c +6 -3
Index: linux-2.6.26-rc5/drivers/leds/leds-h1940.c
===================================================================
@@ -23,7 +23,8 @@
 /*
  * Green led.
  */
-void h1940_greenled_set(struct led_classdev *led_dev, enum led_brightness value)
+static void h1940_greenled_set(struct led_classdev *led_dev,
+			       enum led_brightness value)
 {
 	switch (value) {
 	case LED_HALF:
@@ -52,7 +53,8 @@ static struct led_classdev h1940_greenle
 /*
  * Red led.
  */
-void h1940_redled_set(struct led_classdev *led_dev, enum led_brightness value)
+static void h1940_redled_set(struct led_classdev *led_dev,
+			     enum led_brightness value)
 {
 	switch (value) {
 	case LED_HALF:
@@ -82,7 +84,8 @@ static struct led_classdev h1940_redled 
  * Blue led.
  * (it can only be blue flashing led)
  */
-void h1940_blueled_set(struct led_classdev *led_dev, enum led_brightness value)
+static void h1940_blueled_set(struct led_classdev *led_dev,
+			      enum led_brightness value)
 {
 	if (value) {
 		/* flashing Blue */
Signature · 3 lines
Ben ([email protected], http://www.fluff.org/)

  'a smiley only costs 4 bytes'
#2 lore raw
Quoted 10 lines · Ben Dooks

plain text document attachment (sparse-fix-h1940-leds.patch) We do not need to export any of the routines inside drivers/leds/leds-h1940.c, so make them all static to quieten the sparse output for this driver.

Fixes the following sparse errors:
drivers/leds/leds-h1940.c:26:6: warning: symbol 'h1940_greenled_set' was not declared. Should it be static? drivers/leds/leds-h1940.c:55:6: warning: symbol 'h1940_redled_set' was not declared. Should it be static? drivers/leds/leds-h1940.c:85:6: warning: symbol 'h1940_blueled_set' was not declared. Should it be static?

Quoted 4 lines
CC Richard Purdie <[email protected]>
CC Linux Kernel <[email protected]>
CC Arnaud Patard <[email protected]>

Queued in the LEDs tree, thanks.

Richard