[PATCH] soc: fsl: Remove bogus packed attributes from qman.h

Leo Li leoyang.li at nxp.com
Tue Sep 1 11:50:38 AEST 2020



> -----Original Message-----
> From: Herbert Xu <herbert at gondor.apana.org.au>
> Sent: Thursday, July 30, 2020 7:53 AM
> To: Leo Li <leoyang.li at nxp.com>; linuxppc-dev at lists.ozlabs.org; linux-arm-
> kernel at lists.infradead.org
> Subject: [PATCH] soc: fsl: Remove bogus packed attributes from qman.h
> 
> There are two __packed attributes in qman.h that are both unnecessary
> and causing compiler warnings because they're conflicting with
> explicit alignment requirements set on members within the structure.

Sorry for the late response.  I missed this email previously.

These structures are descriptors used by hardware, we cannot have _ANY_ padding from the compiler.  The compiled result might be the same with or without the __packed attribute for now, but I think keep it there probably is safer for dealing with unexpected alignment requirements from the compiler in the future.

Having conflicting alignment requirements warning might means something is wrong with the structure in certain scenario.  I just tried a ARM64 build but didn't see the warnings.  Could you share the warning you got and the build setup?  Thanks.

Regards,
Leo 
> 
> This patch removes them both.
> 
> Signed-off-by: Herbert Xu <herbert at gondor.apana.org.au>
> 
> diff --git a/include/soc/fsl/qman.h b/include/soc/fsl/qman.h
> index cfe00e08e85b..d81ff185dc0b 100644
> --- a/include/soc/fsl/qman.h
> +++ b/include/soc/fsl/qman.h
> @@ -256,7 +256,7 @@ struct qm_dqrr_entry {
>  	__be32 context_b;
>  	struct qm_fd fd;
>  	u8 __reserved4[32];
> -} __packed;
> +};
>  #define QM_DQRR_VERB_VBIT		0x80
>  #define QM_DQRR_VERB_MASK		0x7f	/* where the verb
> contains; */
>  #define QM_DQRR_VERB_FRAME_DEQUEUE	0x60	/* "this format" */
> @@ -289,7 +289,7 @@ union qm_mr_entry {
>  		__be32 tag;
>  		struct qm_fd fd;
>  		u8 __reserved1[32];
> -	} __packed ern;
> +	} ern;
>  	struct {
>  		u8 verb;
>  		u8 fqs;		/* Frame Queue Status */
> --
> Email: Herbert Xu <herbert at gondor.apana.org.au>
> Home Page:
> https://eur01.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.ap
> ana.org.au%2F~herbert%2F&data=02%7C01%7Cleoyang.li%40nxp.com
> %7Cb69aca8dc53a4030b14b08d8348783a9%7C686ea1d3bc2b4c6fa92cd99c5c3
> 01635%7C0%7C0%7C637317103931120730&sdata=g3%2FJfa%2FNcuhLD5
> SYhbmhno65O1bxisVt2xltu2IMPjQ%3D&reserved=0
> PGP Key:
> https://eur01.safelinks.protection.outlook.com/?url=http:%2F%2Fgondor.ap
> ana.org.au%2F~herbert%2Fpubkey.txt&data=02%7C01%7Cleoyang.li%4
> 0nxp.com%7Cb69aca8dc53a4030b14b08d8348783a9%7C686ea1d3bc2b4c6fa9
> 2cd99c5c301635%7C0%7C0%7C637317103931120730&sdata=uSS2C4cuAL
> XcCgIhpIORK4EZ1BHHj%2BqAW2Pu%2FLrFKPM%3D&reserved=0


More information about the Linuxppc-dev mailing list