[alsa-devel] [PATCH] ALSA: uapi: Replace __packed with __attribute__((packed))

Takashi Iwai tiwai at suse.de
Fri Feb 7 16:17:41 CET 2020


On Fri, 07 Feb 2020 17:15:33 +0100,
Amadeusz Sławiński wrote:
> 
> Userspace doesn't know what __packed is, change it to
> __attribute__((packed)), like in the rest of a header.
> 
> Fixes: 348f48220b97 (ASoC: topology: Move v4 manifest header data structures to uapi)
> 
> Signed-off-by: Amadeusz Sławiński <amadeuszx.slawinski at linux.intel.com>

Is it a general consensus that we have to replace that?
Userspace doesn't know of __u16 unless it's defined, either, for
example.


thanks,

Takashi

> ---
>  include/uapi/sound/asoc.h | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/include/uapi/sound/asoc.h b/include/uapi/sound/asoc.h
> index 6048553c119d..1ae8b06691cb 100644
> --- a/include/uapi/sound/asoc.h
> +++ b/include/uapi/sound/asoc.h
> @@ -586,7 +586,7 @@ struct snd_soc_tplg_manifest_v4 {
>  	__le32 pcm_elems;	/* number of PCM elements */
>  	__le32 dai_link_elems;	/* number of DAI link elements */
>  	struct snd_soc_tplg_private priv;
> -} __packed;
> +} __attribute((packed));
>  
>  /* Stream Capabilities v4 */
>  struct snd_soc_tplg_stream_caps_v4 {
> @@ -604,7 +604,7 @@ struct snd_soc_tplg_stream_caps_v4 {
>  	__le32 period_size_max;	/* max period size bytes */
>  	__le32 buffer_size_min;	/* min buffer size bytes */
>  	__le32 buffer_size_max;	/* max buffer size bytes */
> -} __packed;
> +} __attribute((packed));
>  
>  /* PCM v4 */
>  struct snd_soc_tplg_pcm_v4 {
> @@ -619,7 +619,7 @@ struct snd_soc_tplg_pcm_v4 {
>  	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* for DAI link */
>  	__le32 num_streams;	/* number of streams */
>  	struct snd_soc_tplg_stream_caps_v4 caps[2]; /* playback and capture for DAI */
> -} __packed;
> +} __attribute((packed));
>  
>  /* Physical link config v4 */
>  struct snd_soc_tplg_link_config_v4 {
> @@ -627,6 +627,6 @@ struct snd_soc_tplg_link_config_v4 {
>  	__le32 id;              /* unique ID - used to match */
>  	struct snd_soc_tplg_stream stream[SND_SOC_TPLG_STREAM_CONFIG_MAX]; /* supported configs playback and captrure */
>  	__le32 num_streams;     /* number of streams */
> -} __packed;
> +} __attribute((packed));
>  
>  #endif
> -- 
> 2.17.1
> 


More information about the Alsa-devel mailing list