Skip to contentSkip to conversation

gma500: define do_gma_backlight_set only when used

PATCH In review Vincent Stehlé 3 participants 3 messages Sep 26, 2013 – Sep 27, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 gma500: define do_gma_backlight_set only when used

Make sure static function do_gma_backlight_set() is only defined when CONFIG_BACKLIGHT_CLASS_DEVICE is defined, as it is never called otherwise.

This fixes the following warning:

drivers/gpu/drm/gma500/backlight.c:29:13: warning: ‘do_gma_backlight_set’ defined but not used [-Wunused-function]

While at it, remove some end of line spaces.

---

Hi,

This can be seen with mainline or linux-next with e.g. allmodconfig on x86.

Best regards,

V.

 drivers/gpu/drm/gma500/backlight.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/gma500/backlight.c +5 -5
index 143eba3..399731e 100644
@@ -26,13 +26,13 @@
 #include "intel_bios.h"
 #include "power.h"
 
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
 static void do_gma_backlight_set(struct drm_device *dev)
 {
-#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
 	struct drm_psb_private *dev_priv = dev->dev_private;
 	backlight_update_status(dev_priv->backlight_device);
-#endif	
 }
+#endif
 
 void gma_backlight_enable(struct drm_device *dev)
 {
@@ -43,7 +43,7 @@ void gma_backlight_enable(struct drm_device *dev)
 		dev_priv->backlight_device->props.brightness = dev_priv->backlight_level;
 		do_gma_backlight_set(dev);
 	}
-#endif	
+#endif
 }
 
 void gma_backlight_disable(struct drm_device *dev)
@@ -55,7 +55,7 @@ void gma_backlight_disable(struct drm_device *dev)
 		dev_priv->backlight_device->props.brightness = 0;
 		do_gma_backlight_set(dev);
 	}
-#endif	
+#endif
 }
 
 void gma_backlight_set(struct drm_device *dev, int v)
@@ -67,7 +67,7 @@ void gma_backlight_set(struct drm_device *dev, int v)
 		dev_priv->backlight_device->props.brightness = v;
 		do_gma_backlight_set(dev);
 	}
-#endif	
+#endif
 }
 
 int gma_backlight_init(struct drm_device *dev)
Signature · 1 line
1.8.4.rc3
maintainer Acked-by on v1 1/1
#1 lore raw
Quoted 72 lines · Vincent Stehlé

Make sure static function do_gma_backlight_set() is only defined when CONFIG_BACKLIGHT_CLASS_DEVICE is defined, as it is never called otherwise.

This fixes the following warning:

drivers/gpu/drm/gma500/backlight.c:29:13: warning: ‘do_gma_backlight_set’ defined but not used [-Wunused-function]

While at it, remove some end of line spaces.

---

Hi,

This can be seen with mainline or linux-next with e.g. allmodconfig on x86.

Best regards,

V.

 drivers/gpu/drm/gma500/backlight.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)
drivers/gpu/drm/gma500/backlight.c +5 -6
index 143eba3..399731e 100644
@@ -26,13 +26,13 @@
 #include "intel_bios.h"
 #include "power.h"
 
+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
 static void do_gma_backlight_set(struct drm_device *dev)
 {
-#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE
        struct drm_psb_private *dev_priv = dev->dev_private;
        backlight_update_status(dev_priv->backlight_device);
-#endif
 }
+#endif
 
 void gma_backlight_enable(struct drm_device *dev)
 {
@@ -43,7 +43,7 @@ void gma_backlight_enable(struct drm_device *dev)
                dev_priv->backlight_device->props.brightness = dev_priv->backlight_level;
                do_gma_backlight_set(dev);
        }
-#endif
+#endif
 }
 
 void gma_backlight_disable(struct drm_device *dev)
@@ -55,7 +55,7 @@ void gma_backlight_disable(struct drm_device *dev)
                dev_priv->backlight_device->props.brightness = 0;
                do_gma_backlight_set(dev);
        }
-#endif
+#endif
 }
 
 void gma_backlight_set(struct drm_device *dev, int v)
@@ -67,7 +67,7 @@ void gma_backlight_set(struct drm_device *dev, int v)
                dev_priv->backlight_device->props.brightness = v;
                do_gma_backlight_set(dev);
        }
-#endif
+#endif
 }
 
 int gma_backlight_init(struct drm_device *dev)
--
Quoted 1 line

1.8.4.rc3

Thanks, looks good, I'll apply it to the gma500-fixes branch.

#2 lore raw
Quoted 1 line · Patrik Jakobsson
Quoted 1 line

+#ifdef CONFIG_BACKLIGHT_CLASS_DEVICE

Hi, while at it, you should probably let backlight be built as module:

#if IS_ENABLED(CONFIG_BACKLIGHT_CLASS_DEVICE)

Cheers,
Jani.

Signature · 1 line
Jani Nikula, Intel Open Source Technology Center