diff mbox

topology: Include <linux/types.h> in API header file

Message ID 1446821837.2776.27.camel@loki (mailing list archive)
State New, archived
Headers show

Commit Message

Liam Girdwood Nov. 6, 2015, 2:57 p.m. UTC
On Fri, 2015-11-06 at 15:40 +0100, Takashi Iwai wrote:
> On Fri, 06 Nov 2015 15:37:27 +0100,
> Liam Girdwood wrote:
> > 
> > 
> > >From 568f769269122e90fceee605a98a1a526db2b3d4 Mon Sep 17 00:00:00 2001
> > From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> > Date: Fri, 6 Nov 2015 14:30:36 +0000
> > Subject: [PATCH] topology: remove little endian type from userspace header.
> > 
> > Use a generic unsigned long long for formats instead of an ABI endian
> > specific __le64 type.
> 
> Or use uint64_t instead.  This is the standard definition of 64bit
> integer.  I thought we already include stdint.h somewhere, but you can
> included it there again to be sure, too.
> 

I didn't see stdint.h so used unsigned long long on the first patch. The
patch below fixes this though :-

From 52d3023e482ac856692bf27819d97d9a037a055b Mon Sep 17 00:00:00 2001
From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
Date: Fri, 6 Nov 2015 14:30:36 +0000
Subject: [PATCH] topology: remove little endian type from userspace header.

Use a generic uint64_t for formats instead of an ABI endian specific
__le64 type.

Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
---
 include/topology.h | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Subhransu S. Prusty Nov. 9, 2015, 2:04 p.m. UTC | #1
On Fri, Nov 06, 2015 at 02:57:17PM +0000, Liam Girdwood wrote:
> On Fri, 2015-11-06 at 15:40 +0100, Takashi Iwai wrote:
> > On Fri, 06 Nov 2015 15:37:27 +0100,
> > Liam Girdwood wrote:
> > > 
> > > 
> > > >From 568f769269122e90fceee605a98a1a526db2b3d4 Mon Sep 17 00:00:00 2001
> > > From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> > > Date: Fri, 6 Nov 2015 14:30:36 +0000
> > > Subject: [PATCH] topology: remove little endian type from userspace header.
> > > 
> > > Use a generic unsigned long long for formats instead of an ABI endian
> > > specific __le64 type.
> > 
> > Or use uint64_t instead.  This is the standard definition of 64bit
> > integer.  I thought we already include stdint.h somewhere, but you can
> > included it there again to be sure, too.
> > 
> 
> I didn't see stdint.h so used unsigned long long on the first patch. The
> patch below fixes this though :-
> 
> From 52d3023e482ac856692bf27819d97d9a037a055b Mon Sep 17 00:00:00 2001
> From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> Date: Fri, 6 Nov 2015 14:30:36 +0000
> Subject: [PATCH] topology: remove little endian type from userspace header.
> 
> Use a generic uint64_t for formats instead of an ABI endian specific
> __le64 type.

Tested and it works fine.

> 
> Signed-off-by: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> ---
>  include/topology.h | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
> 
> diff --git a/include/topology.h b/include/topology.h
> index b631871..993537c 100644
> --- a/include/topology.h
> +++ b/include/topology.h
> @@ -21,6 +21,8 @@
>  #ifndef __ALSA_TOPOLOGY_H
>  #define __ALSA_TOPOLOGY_H
>  
> +#include <stdint.h>
> +
>  #ifdef __cplusplus
>  extern "C" {
>  #endif
> @@ -665,7 +667,7 @@ struct snd_tplg_stream_template {
>   */
>  struct snd_tplg_stream_caps_template {
>  	const char *name;	/*!< name of the stream caps */
> -	__le64 formats;	/*!< supported formats SNDRV_PCM_FMTBIT_* */
> +	uint64_t formats;	/*!< supported formats SNDRV_PCM_FMTBIT_* */
>  	unsigned int rates;	/*!< supported rates SNDRV_PCM_RATE_* */
>  	unsigned int rate_min;	/*!< min rate */
>  	unsigned int rate_max;	/*!< max rate */
> -- 
> 2.5.0
> 
>
Jaroslav Kysela Nov. 10, 2015, 12:29 p.m. UTC | #2
Dne 10.11.2015 v 13:29 Vinod Koul napsal(a):
> On Mon, Nov 09, 2015 at 07:34:29PM +0530, Subhransu S. Prusty wrote:
>> On Fri, Nov 06, 2015 at 02:57:17PM +0000, Liam Girdwood wrote:
>>> On Fri, 2015-11-06 at 15:40 +0100, Takashi Iwai wrote:
>>>> On Fri, 06 Nov 2015 15:37:27 +0100,
>>>> Liam Girdwood wrote:
>>>>>
>>>>>
>>>>> >From 568f769269122e90fceee605a98a1a526db2b3d4 Mon Sep 17 00:00:00 2001
>>>>> From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
>>>>> Date: Fri, 6 Nov 2015 14:30:36 +0000
>>>>> Subject: [PATCH] topology: remove little endian type from userspace header.
>>>>>
>>>>> Use a generic unsigned long long for formats instead of an ABI endian
>>>>> specific __le64 type.
>>>>
>>>> Or use uint64_t instead.  This is the standard definition of 64bit
>>>> integer.  I thought we already include stdint.h somewhere, but you can
>>>> included it there again to be sure, too.
>>>>
>>>
>>> I didn't see stdint.h so used unsigned long long on the first patch. The
>>> patch below fixes this though :-
>>>
>>> From 52d3023e482ac856692bf27819d97d9a037a055b Mon Sep 17 00:00:00 2001
>>> From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
>>> Date: Fri, 6 Nov 2015 14:30:36 +0000
>>> Subject: [PATCH] topology: remove little endian type from userspace header.
>>>
>>> Use a generic uint64_t for formats instead of an ABI endian specific
>>> __le64 type.
>>
>> Tested and it works fine.
> 
> Hi Takashi,
> 
> Is this fix okay, was this applied ?
> 

Yes, it's in alsa-lib-1.1.0, too:

http://git.alsa-project.org/?p=alsa-lib.git;a=summary

					Jaroslav
Vinod Koul Nov. 10, 2015, 12:29 p.m. UTC | #3
On Mon, Nov 09, 2015 at 07:34:29PM +0530, Subhransu S. Prusty wrote:
> On Fri, Nov 06, 2015 at 02:57:17PM +0000, Liam Girdwood wrote:
> > On Fri, 2015-11-06 at 15:40 +0100, Takashi Iwai wrote:
> > > On Fri, 06 Nov 2015 15:37:27 +0100,
> > > Liam Girdwood wrote:
> > > > 
> > > > 
> > > > >From 568f769269122e90fceee605a98a1a526db2b3d4 Mon Sep 17 00:00:00 2001
> > > > From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> > > > Date: Fri, 6 Nov 2015 14:30:36 +0000
> > > > Subject: [PATCH] topology: remove little endian type from userspace header.
> > > > 
> > > > Use a generic unsigned long long for formats instead of an ABI endian
> > > > specific __le64 type.
> > > 
> > > Or use uint64_t instead.  This is the standard definition of 64bit
> > > integer.  I thought we already include stdint.h somewhere, but you can
> > > included it there again to be sure, too.
> > > 
> > 
> > I didn't see stdint.h so used unsigned long long on the first patch. The
> > patch below fixes this though :-
> > 
> > From 52d3023e482ac856692bf27819d97d9a037a055b Mon Sep 17 00:00:00 2001
> > From: Liam Girdwood <liam.r.girdwood@linux.intel.com>
> > Date: Fri, 6 Nov 2015 14:30:36 +0000
> > Subject: [PATCH] topology: remove little endian type from userspace header.
> > 
> > Use a generic uint64_t for formats instead of an ABI endian specific
> > __le64 type.
> 
> Tested and it works fine.

Hi Takashi,

Is this fix okay, was this applied ?
diff mbox

Patch

diff --git a/include/topology.h b/include/topology.h
index b631871..993537c 100644
--- a/include/topology.h
+++ b/include/topology.h
@@ -21,6 +21,8 @@ 
 #ifndef __ALSA_TOPOLOGY_H
 #define __ALSA_TOPOLOGY_H
 
+#include <stdint.h>
+
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -665,7 +667,7 @@  struct snd_tplg_stream_template {
  */
 struct snd_tplg_stream_caps_template {
 	const char *name;	/*!< name of the stream caps */
-	__le64 formats;	/*!< supported formats SNDRV_PCM_FMTBIT_* */
+	uint64_t formats;	/*!< supported formats SNDRV_PCM_FMTBIT_* */
 	unsigned int rates;	/*!< supported rates SNDRV_PCM_RATE_* */
 	unsigned int rate_min;	/*!< min rate */
 	unsigned int rate_max;	/*!< max rate */