Message ID | e0e455ac3f40b3dd0344127bbb8773cea579620e.1499425271.git.joabreu@synopsys.com (mailing list archive) |
---|---|
State | Superseded, archived |
Delegated to: | Hans Verkuil |
Headers |
Received: from mail.tu-berlin.de ([130.149.7.33]) by www.linuxtv.org with esmtp (Exim 4.84_2) (envelope-from <linux-media-owner@vger.kernel.org>) id 1dTR8c-0001WY-Gk; Fri, 07 Jul 2017 11:09:30 +0000 X-tubIT-Incoming-IP: 209.132.180.67 Received: from vger.kernel.org ([209.132.180.67]) by mail.tu-berlin.de (exim-4.89/mailfrontend-6) with esmtp id 1dTR8a-0002Ch-5W; Fri, 07 Jul 2017 13:09:30 +0200 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752582AbdGGLI7 (ORCPT <rfc822;mkrufky@linuxtv.org> + 1 other); Fri, 7 Jul 2017 07:08:59 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.47.9]:52531 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752566AbdGGLI5 (ORCPT <rfc822; linux-media@vger.kernel.org>); Fri, 7 Jul 2017 07:08:57 -0400 Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by smtprelay.synopsys.com (Postfix) with ESMTP id 3326824E0E74; Fri, 7 Jul 2017 04:08:42 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 1BE8FB05; Fri, 7 Jul 2017 04:08:42 -0700 (PDT) Received: from joabreu-VirtualBox.internal.synopsys.com (joabreu-e7440.internal.synopsys.com [10.107.19.95]) by mailhost.synopsys.com (Postfix) with ESMTP id AE927AD8; Fri, 7 Jul 2017 04:08:40 -0700 (PDT) From: Jose Abreu <Jose.Abreu@synopsys.com> To: linux-media@vger.kernel.org, linux-kernel@vger.kernel.org Cc: Jose Abreu <Jose.Abreu@synopsys.com>, Carlos Palminha <CARLOS.PALMINHA@synopsys.com>, Hans Verkuil <hans.verkuil@cisco.com> Subject: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration Date: Fri, 7 Jul 2017 12:08:05 +0100 Message-Id: <e0e455ac3f40b3dd0344127bbb8773cea579620e.1499425271.git.joabreu@synopsys.com> X-Mailer: git-send-email 1.9.1 In-Reply-To: <cover.1499425271.git.joabreu@synopsys.com> References: <cover.1499425271.git.joabreu@synopsys.com> In-Reply-To: <cover.1499425271.git.joabreu@synopsys.com> References: <cover.1499425271.git.joabreu@synopsys.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: <linux-media.vger.kernel.org> X-Mailing-List: linux-media@vger.kernel.org X-PMX-Version: 6.0.0.2142326, Antispam-Engine: 2.7.2.2107409, Antispam-Data: 2017.7.7.110016 X-PMX-Spam: Gauge=IIIIIIII, Probability=8%, Report=' MULTIPLE_RCPTS 0.1, HTML_00_01 0.05, HTML_00_10 0.05, BODYTEXTP_SIZE_3000_LESS 0, BODY_SIZE_1000_1099 0, BODY_SIZE_2000_LESS 0, BODY_SIZE_5000_LESS 0, BODY_SIZE_7000_LESS 0, CT_TEXT_PLAIN_UTF8_CAPS 0, IN_REP_TO 0, LEGITIMATE_SIGNS 0, MSG_THREAD 0, MULTIPLE_REAL_RCPTS 0, NO_URI_HTTPS 0, REFERENCES 0, __ANY_URI 0, __CC_NAME 0, __CC_NAME_DIFF_FROM_ACC 0, __CC_REAL_NAMES 0, __CT 0, __CTE 0, __CT_TEXT_PLAIN 0, __FROM_DOMAIN_IN_ANY_CC2 0, __FROM_DOMAIN_IN_RCPT 0, __HAS_CC_HDR 0, __HAS_FROM 0, __HAS_LIST_ID 0, __HAS_MSGID 0, __HAS_X_MAILER 0, __HAS_X_MAILING_LIST 0, __IN_REP_TO 0, __MIME_TEXT_ONLY 0, __MIME_TEXT_P 0, __MIME_TEXT_P1 0, __MIME_VERSION 0, __MULTIPLE_RCPTS_CC_X2 0, __NO_HTML_TAG_RAW 0, __REFERENCES 0, __SANE_MSGID 0, __TO_MALFORMED_2 0, __TO_NO_NAME 0, __URI_NO_WWW 0, __URI_NS ' |
Commit Message
Jose Abreu
July 7, 2017, 11:08 a.m. UTC
When CONFIC_CEC_NOTIFIER is not set and we only include cec-notifier.h
we can get build warnings like these ones:
"warning: ‘struct cec_notifier’ declared inside parameter list will
not be visible outside of this definition or declaration"
Prevent these warnings by using forward declaration of notifier
structure.
Signed-off-by: Jose Abreu <joabreu@synopsys.com>
Cc: Carlos Palminha <palminha@synopsys.com>
Cc: Hans Verkuil <hans.verkuil@cisco.com>
---
include/media/cec-notifier.h | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
Comments
On 07/07/17 13:08, Jose Abreu wrote: > When CONFIC_CEC_NOTIFIER is not set and we only include cec-notifier.h > we can get build warnings like these ones: > > "warning: ‘struct cec_notifier’ declared inside parameter list will > not be visible outside of this definition or declaration" > > Prevent these warnings by using forward declaration of notifier > structure. > > Signed-off-by: Jose Abreu <joabreu@synopsys.com> > Cc: Carlos Palminha <palminha@synopsys.com> > Cc: Hans Verkuil <hans.verkuil@cisco.com> > --- > include/media/cec-notifier.h | 6 +++--- > 1 file changed, 3 insertions(+), 3 deletions(-) > > diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h > index 298f996..84f9376 100644 > --- a/include/media/cec-notifier.h > +++ b/include/media/cec-notifier.h > @@ -21,14 +21,14 @@ > #ifndef LINUX_CEC_NOTIFIER_H > #define LINUX_CEC_NOTIFIER_H > > -#include <linux/types.h> > -#include <media/cec.h> > - > struct device; > struct edid; > struct cec_adapter; > struct cec_notifier; > > +#include <linux/types.h> > +#include <media/cec.h> > + > #if IS_REACHABLE(CONFIG_CEC_CORE) && IS_ENABLED(CONFIG_CEC_NOTIFIER) > > /** > Isn't it enough to add a forward declaration of cec_notifier in the previous patch? E.g.: +#ifndef CONFIG_CEC_NOTIFIER +struct cec_notifier; +static inline void cec_register_cec_notifier(struct cec_adapter *adap, + struct cec_notifier *notifier) +{ +} +#endif Then this header doesn't need to change. Regards, Hans
Hi Hans, On 07-07-2017 12:16, Hans Verkuil wrote: > On 07/07/17 13:08, Jose Abreu wrote: >> When CONFIC_CEC_NOTIFIER is not set and we only include cec-notifier.h >> we can get build warnings like these ones: >> >> "warning: ‘struct cec_notifier’ declared inside parameter list will >> not be visible outside of this definition or declaration" >> >> Prevent these warnings by using forward declaration of notifier >> structure. >> >> Signed-off-by: Jose Abreu <joabreu@synopsys.com> >> Cc: Carlos Palminha <palminha@synopsys.com> >> Cc: Hans Verkuil <hans.verkuil@cisco.com> >> --- >> include/media/cec-notifier.h | 6 +++--- >> 1 file changed, 3 insertions(+), 3 deletions(-) >> >> diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h >> index 298f996..84f9376 100644 >> --- a/include/media/cec-notifier.h >> +++ b/include/media/cec-notifier.h >> @@ -21,14 +21,14 @@ >> #ifndef LINUX_CEC_NOTIFIER_H >> #define LINUX_CEC_NOTIFIER_H >> >> -#include <linux/types.h> >> -#include <media/cec.h> >> - >> struct device; >> struct edid; >> struct cec_adapter; >> struct cec_notifier; >> >> +#include <linux/types.h> >> +#include <media/cec.h> >> + >> #if IS_REACHABLE(CONFIG_CEC_CORE) && IS_ENABLED(CONFIG_CEC_NOTIFIER) >> >> /** >> > Isn't it enough to add a forward declaration of cec_notifier in the previous > patch? E.g.: > > +#ifndef CONFIG_CEC_NOTIFIER > +struct cec_notifier; > +static inline void cec_register_cec_notifier(struct cec_adapter *adap, > + struct cec_notifier *notifier) > +{ > +} > +#endif > > Then this header doesn't need to change. Yeah, it should also work :) I will add to the previous patch and drop this one then. Best regards, Jose Miguel Abreu > > Regards, > > Hans
diff --git a/include/media/cec-notifier.h b/include/media/cec-notifier.h index 298f996..84f9376 100644 --- a/include/media/cec-notifier.h +++ b/include/media/cec-notifier.h @@ -21,14 +21,14 @@ #ifndef LINUX_CEC_NOTIFIER_H #define LINUX_CEC_NOTIFIER_H -#include <linux/types.h> -#include <media/cec.h> - struct device; struct edid; struct cec_adapter; struct cec_notifier; +#include <linux/types.h> +#include <media/cec.h> + #if IS_REACHABLE(CONFIG_CEC_CORE) && IS_ENABLED(CONFIG_CEC_NOTIFIER) /**