Re: [PATCH 2/5] v4l: flash: Make v4l2_flash_init() and v4l2_flash_release() functions always

2015-05-23 Thread Laurent Pinchart
Hi Sakari,

Thank you for the patch.

On Wednesday 20 May 2015 02:04:02 Sakari Ailus wrote:
 If CONFIG_V4L2_FLASH_LED_CLASS wasn't defined, v4l2_flash_init() and
 v4l2_flash_release() were empty macros. This will lead to compiler warnings
 in form of unused variables if the variables are not used for other
 purposes.
 
 Instead, implement v4l2_flash_init() and v4l2_flash_release() as static
 inline functions.
 
 Signed-off-by: Sakari Ailus sakari.ai...@iki.fi

Acked-by: Laurent Pinchart laurent.pinch...@ideasonboard.com

 ---
  include/media/v4l2-flash.h |   12 ++--
  1 file changed, 10 insertions(+), 2 deletions(-)
 
 diff --git a/include/media/v4l2-flash.h b/include/media/v4l2-flash.h
 index 945fa08..67a2cbf 100644
 --- a/include/media/v4l2-flash.h
 +++ b/include/media/v4l2-flash.h
 @@ -138,8 +138,16 @@ struct v4l2_flash *v4l2_flash_init(struct
 led_classdev_flash *fled_cdev, void v4l2_flash_release(struct v4l2_flash
 *v4l2_flash);
 
  #else
 -#define v4l2_flash_init(fled_cdev, ops, config) (NULL)
 -#define v4l2_flash_release(v4l2_flash)
 +static inline struct v4l2_flash *v4l2_flash_init(
 + struct led_classdev_flash *fled_cdev, const struct v4l2_flash_ops *ops,
 + struct v4l2_flash_config *config)
 +{
 + return NULL;
 +}
 +
 +static inline void v4l2_flash_release(struct v4l2_flash *v4l2_flash)
 +{
 +}
  #endif /* CONFIG_V4L2_FLASH_LED_CLASS */
 
  #endif /* _V4L2_FLASH_H */

-- 
Regards,

Laurent Pinchart

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 2/5] v4l: flash: Make v4l2_flash_init() and v4l2_flash_release() functions always

2015-05-19 Thread Sakari Ailus
If CONFIG_V4L2_FLASH_LED_CLASS wasn't defined, v4l2_flash_init() and
v4l2_flash_release() were empty macros. This will lead to compiler warnings
in form of unused variables if the variables are not used for other
purposes.

Instead, implement v4l2_flash_init() and v4l2_flash_release() as static
inline functions.

Signed-off-by: Sakari Ailus sakari.ai...@iki.fi
---
 include/media/v4l2-flash.h |   12 ++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/include/media/v4l2-flash.h b/include/media/v4l2-flash.h
index 945fa08..67a2cbf 100644
--- a/include/media/v4l2-flash.h
+++ b/include/media/v4l2-flash.h
@@ -138,8 +138,16 @@ struct v4l2_flash *v4l2_flash_init(struct 
led_classdev_flash *fled_cdev,
 void v4l2_flash_release(struct v4l2_flash *v4l2_flash);
 
 #else
-#define v4l2_flash_init(fled_cdev, ops, config) (NULL)
-#define v4l2_flash_release(v4l2_flash)
+static inline struct v4l2_flash *v4l2_flash_init(
+   struct led_classdev_flash *fled_cdev, const struct v4l2_flash_ops *ops,
+   struct v4l2_flash_config *config)
+{
+   return NULL;
+}
+
+static inline void v4l2_flash_release(struct v4l2_flash *v4l2_flash)
+{
+}
 #endif /* CONFIG_V4L2_FLASH_LED_CLASS */
 
 #endif /* _V4L2_FLASH_H */
-- 
1.7.10.4

--
To unsubscribe from this list: send the line unsubscribe linux-media in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html