From patchwork Tue May 19 23:04:02 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sakari Ailus X-Patchwork-Id: 6440951 Return-Path: X-Original-To: patchwork-linux-media@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C901C9F318 for ; Tue, 19 May 2015 23:05:41 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 02A5F203E5 for ; Tue, 19 May 2015 23:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 0E50A203DC for ; Tue, 19 May 2015 23:05:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752305AbbESXFh (ORCPT ); Tue, 19 May 2015 19:05:37 -0400 Received: from nblzone-211-213.nblnetworks.fi ([83.145.211.213]:56194 "EHLO hillosipuli.retiisi.org.uk" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752311AbbESXFb (ORCPT ); Tue, 19 May 2015 19:05:31 -0400 Received: from lanttu.localdomain (lanttu-e.localdomain [192.168.1.64]) by hillosipuli.retiisi.org.uk (Postfix) with ESMTP id CBBFE60097; Wed, 20 May 2015 02:05:24 +0300 (EEST) From: Sakari Ailus 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 Message-Id: <1432076645-4799-3-git-send-email-sakari.ailus@iki.fi> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1432076645-4799-1-git-send-email-sakari.ailus@iki.fi> References: <1432076645-4799-1-git-send-email-sakari.ailus@iki.fi> Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Laurent Pinchart --- 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 */