All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sakari Ailus <sakari.ailus@iki.fi>
To: linux-media@vger.kernel.org
Cc: linux-leds@vger.kernel.org, j.anaszewski@samsung.com,
	cooloney@gmail.com, g.liakhovetski@gmx.de,
	s.nawrocki@samsung.com, laurent.pinchart@ideasonboard.com,
	mchehab@osg.samsung.com
Subject: [PATCH 2/5] v4l: flash: Make v4l2_flash_init() and v4l2_flash_release() functions always
Date: Wed, 20 May 2015 02:04:02 +0300	[thread overview]
Message-ID: <1432076645-4799-3-git-send-email-sakari.ailus@iki.fi> (raw)
In-Reply-To: <1432076645-4799-1-git-send-email-sakari.ailus@iki.fi>

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.ailus@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

  parent reply	other threads:[~2015-05-19 23:04 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-05-19 23:04 [PATCH 0/5] V4L2 flash API wrapper improvements Sakari Ailus
2015-05-19 23:04 ` [PATCH 1/5] v4l: async: Add a pointer to of_node to struct v4l2_subdev, match it Sakari Ailus
2015-05-20 14:20   ` Jacek Anaszewski
2015-05-23 18:47   ` Laurent Pinchart
2015-05-31 21:54     ` Sakari Ailus
2015-05-31 22:24     ` [PATCH v1.1 " Sakari Ailus
2015-06-02  2:47       ` Laurent Pinchart
2015-06-09  8:05         ` Sakari Ailus
2015-06-10 21:27         ` [PATCH v1.2 " Sakari Ailus
2015-06-11 19:18           ` [PATCH v1.3 " Sakari Ailus
2015-06-11 19:27             ` Laurent Pinchart
2015-06-12  6:41               ` Sakari Ailus
2015-06-15 18:34                 ` Bryan Wu
2015-05-19 23:04 ` Sakari Ailus [this message]
2015-05-23 18:40   ` [PATCH 2/5] v4l: flash: Make v4l2_flash_init() and v4l2_flash_release() functions always Laurent Pinchart
2015-05-19 23:04 ` [PATCH 3/5] v4l: flash: Pass struct device and device_node to v4l2_flash_init() Sakari Ailus
2015-05-19 23:04 ` [PATCH 4/5] leds: aat1290: Pass dev and dev->of_node " Sakari Ailus
2015-05-20  9:47   ` Jacek Anaszewski
2015-05-20 10:19     ` Sakari Ailus
2015-05-20 10:37     ` Jacek Anaszewski
2015-05-20 12:27       ` Sakari Ailus
2015-05-20 13:47         ` Jacek Anaszewski
2015-05-20 14:31           ` Sakari Ailus
2015-05-21  8:54             ` Jacek Anaszewski
2015-05-21 10:06               ` Sakari Ailus
2015-05-21 12:13                 ` Jacek Anaszewski
2015-05-21 13:14                   ` Sakari Ailus
2015-05-19 23:04 ` [PATCH 5/5] leds: max77693: " Sakari Ailus

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=1432076645-4799-3-git-send-email-sakari.ailus@iki.fi \
    --to=sakari.ailus@iki.fi \
    --cc=cooloney@gmail.com \
    --cc=g.liakhovetski@gmx.de \
    --cc=j.anaszewski@samsung.com \
    --cc=laurent.pinchart@ideasonboard.com \
    --cc=linux-leds@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    --cc=mchehab@osg.samsung.com \
    --cc=s.nawrocki@samsung.com \
    /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.