All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hans Verkuil <hansverk@cisco.com>
To: Jose Abreu <Jose.Abreu@synopsys.com>,
	linux-media@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Carlos Palminha <CARLOS.PALMINHA@synopsys.com>,
	Hans Verkuil <hans.verkuil@cisco.com>
Subject: Re: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration
Date: Fri, 7 Jul 2017 13:16:46 +0200	[thread overview]
Message-ID: <4e42b0be-fdef-b4d6-be92-ccce71dda49d@cisco.com> (raw)
In-Reply-To: <e0e455ac3f40b3dd0344127bbb8773cea579620e.1499425271.git.joabreu@synopsys.com>

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

  reply	other threads:[~2017-07-07 11:16 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-07-07 11:08 [PATCH v7 0/6] Synopsys Designware HDMI Video Capture Controller + PHY Jose Abreu
2017-07-07 11:08 ` [PATCH v7 1/6] [media] cec.h: Add stub function for cec_register_cec_notifier() Jose Abreu
2017-07-07 11:08 ` [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration Jose Abreu
2017-07-07 11:16   ` Hans Verkuil [this message]
2017-07-07 11:25     ` Jose Abreu
2017-07-07 11:08 ` [PATCH v7 3/6] dt-bindings: media: Document Synopsys Designware HDMI RX Jose Abreu
2017-07-07 11:08   ` Jose Abreu
2017-07-07 11:08 ` [PATCH v7 4/6] MAINTAINERS: Add entry for Synopsys Designware HDMI drivers Jose Abreu
2017-07-07 11:08 ` [PATCH v7 5/6] [media] platform: Add Synopsys Designware HDMI RX PHY e405 Driver Jose Abreu
2017-07-07 11:08 ` [PATCH v7 6/6] [media] platform: Add Synopsys Designware HDMI RX Controller Driver Jose Abreu

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=4e42b0be-fdef-b4d6-be92-ccce71dda49d@cisco.com \
    --to=hansverk@cisco.com \
    --cc=CARLOS.PALMINHA@synopsys.com \
    --cc=Jose.Abreu@synopsys.com \
    --cc=hans.verkuil@cisco.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-media@vger.kernel.org \
    /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.