Re: [PATCH char-misc] mei: lb: fix incorrect type in assignment

From: Greg Kroah-Hartman

Date: Fri Jul 03 2026 - 07:08:06 EST


On Wed, Jun 10, 2026 at 03:57:52PM +0300, Alexander Usyskin wrote:
> Fix the mix between __le32 and integer by defining
> the MEI_LB2_CMD constant as __le32.
>
> Fixes sparse waring:
> drivers/misc/mei/mei_lb.c:284:32: sparse: sparse: restricted __le32 degrades to integer
> drivers/misc/mei/mei_lb.c:330:40: sparse: sparse: incorrect type in assignment (different base types) @@ expected restricted __le32 [usertype] command_id @@ got int @@
> drivers/misc/mei/mei_lb.c:330:40: sparse: expected restricted __le32 [usertype] command_id
> drivers/misc/mei/mei_lb.c:330:40: sparse: got int
>
> Fixes: 773a43b8627f ("mei: lb: add late binding version 2")
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: https://lore.kernel.org/oe-kbuild-all/202605091533.79Zcv3CX-lkp@xxxxxxxxx/
> Signed-off-by: Alexander Usyskin <alexander.usyskin@xxxxxxxxx>
> ---
> drivers/misc/mei/mei_lb.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/misc/mei/mei_lb.c b/drivers/misc/mei/mei_lb.c
> index f6a258c2b838..a4e3f788c8b8 100644
> --- a/drivers/misc/mei/mei_lb.c
> +++ b/drivers/misc/mei/mei_lb.c
> @@ -104,7 +104,7 @@ struct mei_lb_rsp {
>
> /* Late Binding version 2 */
>
> -#define MEI_LB2_CMD 0x01
> +#define MEI_LB2_CMD cpu_to_le32(0x01)

This will give you an odd thing when you use this directly in a printk()
later on. So perhaps fix this correctly where it is used instead?

thanks,

greg k-h