Re: [PATCH] thunderbolt: thunderbolt: add vendor's NVM formats

From: Greg KH
Date: Mon Aug 15 2022 - 02:41:06 EST


On Mon, Aug 15, 2022 at 12:11:45PM +0800, Szuying Chen wrote:
> +/* ASMedia specific validation mode */
> +#define nvm_upgrade 0
> +#define nvm_add 1
> +#define nvm_write 2

Why is this not an enum?

And why is this specific to a single vendor, yet that vendor name is not
in the #define?

> +struct nvm_asmedia {
> + u32 date;

__le32?

> + u32 customerID:16;
> + u32 version:8;
> + u32 reserved:8;

Are you sure these bitfields are correct on all platforms?

thanks,

greg k-h