Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1683126 > unrolled thread
| Started by | Jose Abreu <Jose.Abreu@synopsys.com> |
|---|---|
| First post | 2017-07-07 13:10 +0200 |
| Last post | 2017-07-07 13:30 +0200 |
| Articles | 3 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
[PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration Jose Abreu <Jose.Abreu@synopsys.com> - 2017-07-07 13:10 +0200
Re: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration Hans Verkuil <hansverk@cisco.com> - 2017-07-07 13:20 +0200
Re: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration Jose Abreu <Jose.Abreu@synopsys.com> - 2017-07-07 13:30 +0200
| From | Jose Abreu <Jose.Abreu@synopsys.com> |
|---|---|
| Date | 2017-07-07 13:10 +0200 |
| Subject | [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration |
| Message-ID | <u0zj4-3e7-15@gated-at.bofh.it> |
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) /** -- 1.9.1
[toc] | [next] | [standalone]
| From | Hans Verkuil <hansverk@cisco.com> |
|---|---|
| Date | 2017-07-07 13:20 +0200 |
| Subject | Re: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration |
| Message-ID | <u0zsK-3i4-19@gated-at.bofh.it> |
| In reply to | #1683126 |
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
[toc] | [prev] | [next] | [standalone]
| From | Jose Abreu <Jose.Abreu@synopsys.com> |
|---|---|
| Date | 2017-07-07 13:30 +0200 |
| Subject | Re: [PATCH v7 2/6] [media] cec-notifier.h: Prevent build warnings using forward declaration |
| Message-ID | <u0zCp-3lO-5@gated-at.bofh.it> |
| In reply to | #1683137 |
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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web