diff mbox series

ASoC: sof: include types.h at header.h

Message ID 87a7a24l7r.wl-kuninori.morimoto.gx@renesas.com (mailing list archive)
State Accepted
Commit 03048217624a9472c1c7a205c8ea9bf8d4026e59
Headers show
Series ASoC: sof: include types.h at header.h | expand

Commit Message

Kuninori Morimoto Oct. 15, 2019, 5:44 a.m. UTC
Content-Transfer-Encoding: 8bit

Without <types.h> we will get these error

linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
...
linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;

Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
---
 include/sound/sof/header.h | 1 +
 1 file changed, 1 insertion(+)

Comments

Daniel Baluta Oct. 15, 2019, 6:49 a.m. UTC | #1
Hello Morimoto-san,

On Tue, Oct 15, 2019 at 8:45 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
> Content-Transfer-Encoding: 8bit
>
> Without <types.h> we will get these error
>
> linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> ...
> linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
>

I think your patch is OK, but you should update the commit message because
Stephen Rothwell already fixed dai-imx.h compilation error  in linux-next.

> Signed-off-by: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
> ---
>  include/sound/sof/header.h | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
> index 10f00c0..332143f 100644
> --- a/include/sound/sof/header.h
> +++ b/include/sound/sof/header.h
> @@ -9,6 +9,7 @@
>  #ifndef __INCLUDE_SOUND_SOF_HEADER_H__
>  #define __INCLUDE_SOUND_SOF_HEADER_H__
>
> +#include <linux/types.h>
>  #include <uapi/sound/sof/abi.h>
>
>  /** \addtogroup sof_uapi uAPI
> --
> 2.7.4
>
> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
Kuninori Morimoto Oct. 15, 2019, 6:57 a.m. UTC | #2
Hi Daniel

> > Content-Transfer-Encoding: 8bit
> >
> > Without <types.h> we will get these error
> >
> > linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> > linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> > linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> > ...
> > linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> > linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> > linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
> >
> 
> I think your patch is OK, but you should update the commit message because
> Stephen Rothwell already fixed dai-imx.h compilation error  in linux-next.

I see. Thanks

But hmm... I couldn't find it at linux-next/master today...
Not yet merged ?

Thank you for your help !!
Best regards
---
Kuninori Morimoto
Daniel Baluta Oct. 15, 2019, 7:07 a.m. UTC | #3
On Tue, Oct 15, 2019 at 9:57 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Daniel
>
> > > Content-Transfer-Encoding: 8bit
> > >
> > > Without <types.h> we will get these error
> > >
> > > linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> > > linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> > > linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> > > ...
> > > linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> > > linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> > > linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
> > >
> >
> > I think your patch is OK, but you should update the commit message because
> > Stephen Rothwell already fixed dai-imx.h compilation error  in linux-next.
>
> I see. Thanks
>
> But hmm... I couldn't find it at linux-next/master today...
> Not yet merged ?

Yes, this is strange. I've sent an email to Stephen and
also added you to Cc.

But, your patch is still valid because Stephen used +#include <linux/types.h>
in dai-imx.h and you are now fixing the generic situation by including it in
header.h.

Lets see if Stephen can clarify the situation. Perhaps we can drop his patch
and only have yours.
Pierre-Louis Bossart Oct. 15, 2019, 1:27 p.m. UTC | #4
On 10/15/19 2:07 AM, Daniel Baluta wrote:
> On Tue, Oct 15, 2019 at 9:57 AM Kuninori Morimoto
> <kuninori.morimoto.gx@renesas.com> wrote:
>>
>>
>> Hi Daniel
>>
>>>> Content-Transfer-Encoding: 8bit
>>>>
>>>> Without <types.h> we will get these error
>>>>
>>>> linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
>>>> linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
>>>> linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
>>>> ...
>>>> linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
>>>> linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
>>>> linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
>>>>
>>>
>>> I think your patch is OK, but you should update the commit message because
>>> Stephen Rothwell already fixed dai-imx.h compilation error  in linux-next.
>>
>> I see. Thanks
>>
>> But hmm... I couldn't find it at linux-next/master today...
>> Not yet merged ?
> 
> Yes, this is strange. I've sent an email to Stephen and
> also added you to Cc.
> 
> But, your patch is still valid because Stephen used +#include <linux/types.h>
> in dai-imx.h and you are now fixing the generic situation by including it in
> header.h.
> 
> Lets see if Stephen can clarify the situation. Perhaps we can drop his patch
> and only have yours.

this is a file shared with the firmware, we shouldn't have to add linux 
specific stuff in there.

Also I don't know how you get those errors, we've been using this file 
for some time, can you clarify how this error happens?

Thanks.

> _______________________________________________
> Alsa-devel mailing list
> Alsa-devel@alsa-project.org
> https://mailman.alsa-project.org/mailman/listinfo/alsa-devel
>
Kuninori Morimoto Oct. 16, 2019, 12:28 a.m. UTC | #5
Hi Pierre-Louis

> >>>> Without <types.h> we will get these error
> >>>> 
> >>>> linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> >>>> linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> >>>> linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> >>>> ...
> >>>> linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> >>>> linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> >>>> linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
(snip)
> this is a file shared with the firmware, we shouldn't have to add
> linux specific stuff in there.
> 
> Also I don't know how you get those errors, we've been using this file
> for some time, can you clarify how this error happens?

I had got this error by using "make allyesconfig" and compile for x86.

Thank you for your help !!
Best regards
---
Kuninori Morimoto
Daniel Baluta Oct. 16, 2019, 11:02 a.m. UTC | #6
On Wed, Oct 16, 2019 at 3:28 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Pierre-Louis
>
> > >>>> Without <types.h> we will get these error
> > >>>>
> > >>>> linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> > >>>> linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> > >>>> linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> > >>>> ...
> > >>>> linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> > >>>> linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> > >>>> linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
> (snip)
> > this is a file shared with the firmware, we shouldn't have to add
> > linux specific stuff in there.
> >
> > Also I don't know how you get those errors, we've been using this file
> > for some time, can you clarify how this error happens?
>
> I had got this error by using "make allyesconfig" and compile for x86.
>
> Thank you for your help !!
> Best regards
> ---
> Kuninori Morimoto
Daniel Baluta Oct. 16, 2019, 11:11 a.m. UTC | #7
On Wed, Oct 16, 2019 at 3:28 AM Kuninori Morimoto
<kuninori.morimoto.gx@renesas.com> wrote:
>
>
> Hi Pierre-Louis
>
> > >>>> Without <types.h> we will get these error
> > >>>>
> > >>>> linux/include/sound/sof/header.h:125:2: error: unknown type name ‘uint32_t’uint32_t size;
> > >>>> linux/include/sound/sof/header.h:136:2: error: unknown type name ‘uint32_t’uint32_t size;
> > >>>> linux/include/sound/sof/header.h:137:2: error: unknown type name ‘uint32_t’uint32_t cmd;
> > >>>> ...
> > >>>> linux/include/sound/sof/dai-imx.h:18:2: error: unknown type name ‘uint16_t’uint16_t reserved1;
> > >>>> linux/include/sound/sof/dai-imx.h:30:2: error: unknown type name ‘uint16_t’uint16_t tdm_slot_width;
> > >>>> linux/include/sound/sof/dai-imx.h:31:2: error: unknown type name ‘uint16_t’uint16_t reserved2;
> (snip)
> > this is a file shared with the firmware, we shouldn't have to add
> > linux specific stuff in there.
> >
> > Also I don't know how you get those errors, we've been using this file
> > for some time, can you clarify how this error happens?
>
> I had got this error by using "make allyesconfig" and compile for x86.

Sorry, I've earlier sent an empty message.

Ok, then IStephen's patch fixes the issue and we should not touch
include/sound/sof/header.h

That means Mark needs to drop Morimoto-san's patch.
Mark Brown Oct. 16, 2019, 11:21 a.m. UTC | #8
On Wed, Oct 16, 2019 at 02:11:57PM +0300, Daniel Baluta wrote:

> That means Mark needs to drop Morimoto-san's patch.

Please send a patch reverting it if you think that's the best option.
Daniel Baluta Oct. 16, 2019, 12:02 p.m. UTC | #9
On Wed, Oct 16, 2019 at 2:21 PM Mark Brown <broonie@kernel.org> wrote:
>
> On Wed, Oct 16, 2019 at 02:11:57PM +0300, Daniel Baluta wrote:
>
> > That means Mark needs to drop Morimoto-san's patch.
>
> Please send a patch reverting it if you think that's the best option.

On a second thought header.h from FW side includes <stdint.h> so I
think it is fair that header.h from Linux kernel
to include <types.h>

Another remark I have is that usually kernel headers should include
their <uapi> counterparts, but in header.h
doesn't happen. I wonder why.

In my opinion the best solution would be this:

diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
index 10f00c08dbb7..a0d6b5896467 100644
--- a/include/sound/sof/header.h
+++ b/include/sound/sof/header.h
@@ -9,6 +9,7 @@
 #ifndef __INCLUDE_SOUND_SOF_HEADER_H__
 #define __INCLUDE_SOUND_SOF_HEADER_H__

+#include <uapi/sound/sof/header.h>
 #include <uapi/sound/sof/abi.h>

 /** \addtogroup sof_uapi uAPI

I need Pierre to have a look.
diff mbox series

Patch

diff --git a/include/sound/sof/header.h b/include/sound/sof/header.h
index 10f00c0..332143f 100644
--- a/include/sound/sof/header.h
+++ b/include/sound/sof/header.h
@@ -9,6 +9,7 @@ 
 #ifndef __INCLUDE_SOUND_SOF_HEADER_H__
 #define __INCLUDE_SOUND_SOF_HEADER_H__
 
+#include <linux/types.h>
 #include <uapi/sound/sof/abi.h>
 
 /** \addtogroup sof_uapi uAPI