All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
@ 2026-07-06 13:01 Alexander Usyskin
  2026-07-06 14:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Alexander Usyskin @ 2026-07-06 13:01 UTC (permalink / raw)
  To: Arnd Bergmann, Greg Kroah-Hartman, Badal Nilawar, Andy Shevchenko
  Cc: linux-kernel, Menachem Adin, Alexander Usyskin, stable,
	kernel test robot

Fix the mix between __le32 and integer by casting
the MEI_LB2_CMD constant as __le32 while using it.

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

Cc: stable@vger.kernel.org
Fixes: 773a43b8627f ("mei: lb: add late binding version 2")
Reported-by: kernel test robot <lkp@intel.com>
Closes: https://lore.kernel.org/oe-kbuild-all/202605091533.79Zcv3CX-lkp@intel.com/
Signed-off-by: Alexander Usyskin <alexander.usyskin@intel.com>
---
Changes in v2:
- Move cast to where macro is actually compared and assigned (GregKH)
- Link to v1: https://lore.kernel.org/r/20260610-fix_type_le-v1-1-15c2b08b6451@intel.com
---
 drivers/misc/mei/mei_lb.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/misc/mei/mei_lb.c b/drivers/misc/mei/mei_lb.c
index f6a258c2b838..9fa69acf28d5 100644
--- a/drivers/misc/mei/mei_lb.c
+++ b/drivers/misc/mei/mei_lb.c
@@ -281,7 +281,7 @@ static int mei_lb_check_response_v2(const struct device *dev, ssize_t bytes,
 			bytes, sizeof(rsp->rheader));
 		return -ENOMSG;
 	}
-	if (rsp->rheader.header.command_id != MEI_LB2_CMD) {
+	if (rsp->rheader.header.command_id != cpu_to_le32(MEI_LB2_CMD)) {
 		dev_err(dev, "Mismatch command: 0x%x instead of 0x%x\n",
 			rsp->rheader.header.command_id, MEI_LB2_CMD);
 		return -EPROTO;
@@ -327,7 +327,7 @@ static int mei_lb_push_payload_v2(struct device *dev, struct mei_cl_device *clde
 		if (sent_data + chunk_size == payload_size)
 			last_chunk = MEI_LB2_FLAG_LST_CHUNK;
 
-		req->header.command_id = MEI_LB2_CMD;
+		req->header.command_id = cpu_to_le32(MEI_LB2_CMD);
 		req->type = cpu_to_le32(type);
 		req->flags = cpu_to_le32(flags | first_chunk | last_chunk);
 		req->reserved = 0;

---
base-commit: dc59e4fea9d83f03bad6bddf3fa2e52491777482
change-id: 20260603-fix_type_le-0184c7ed2399

Best regards,
-- 
Alexander Usyskin <alexander.usyskin@intel.com>


^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-06 13:01 [PATCH char-misc v2] mei: lb: fix incorrect type in assignment Alexander Usyskin
@ 2026-07-06 14:32 ` Greg Kroah-Hartman
  2026-07-07  6:43   ` Usyskin, Alexander
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-06 14:32 UTC (permalink / raw)
  To: Alexander Usyskin
  Cc: Arnd Bergmann, Badal Nilawar, Andy Shevchenko, linux-kernel,
	Menachem Adin, stable, kernel test robot

On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:
> Fix the mix between __le32 and integer by casting
> the MEI_LB2_CMD constant as __le32 while using it.
> 
> 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
> 
> Cc: stable@vger.kernel.org

Why cc: stable?  It doesn't actually cause any functional change to the
code at all, right?  This isn't running on s390, or am I mistaken?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-06 14:32 ` Greg Kroah-Hartman
@ 2026-07-07  6:43   ` Usyskin, Alexander
  2026-07-07  7:21     ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Usyskin, Alexander @ 2026-07-07  6:43 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Arnd Bergmann, Nilawar, Badal, Andy Shevchenko,
	linux-kernel@vger.kernel.org, Adin, Menachem,
	stable@vger.kernel.org, lkp

> Subject: Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
> 
> On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:
> > Fix the mix between __le32 and integer by casting
> > the MEI_LB2_CMD constant as __le32 while using it.
> >
> > 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
> >
> > Cc: stable@vger.kernel.org
> 
> Why cc: stable?  It doesn't actually cause any functional change to the
> code at all, right?  This isn't running on s390, or am I mistaken?
> 

This driver is for discrete graphics card, so it may run on non-x86 system, thus all conversions.

I've been told that if there is Fixes: for commit that already in stable, I should cc: stable.
If it is not hard rule, I'll drop cc: from the next patch revision.

- - 
Thanks,
Sasha



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-07  6:43   ` Usyskin, Alexander
@ 2026-07-07  7:21     ` Andy Shevchenko
  2026-07-07  8:47       ` Greg Kroah-Hartman
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-07-07  7:21 UTC (permalink / raw)
  To: Usyskin, Alexander
  Cc: Greg Kroah-Hartman, Arnd Bergmann, Nilawar, Badal,
	linux-kernel@vger.kernel.org, Adin, Menachem,
	stable@vger.kernel.org, lkp

On Tue, Jul 07, 2026 at 06:43:20AM +0000, Usyskin, Alexander wrote:
> > On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:

...

> > > Cc: stable@vger.kernel.org
> > 
> > Why cc: stable?  It doesn't actually cause any functional change to the
> > code at all, right?  This isn't running on s390, or am I mistaken?
> 
> This driver is for discrete graphics card, so it may run on non-x86 system, thus all conversions.
> 
> I've been told that if there is Fixes: for commit that already in stable, I should cc: stable.
> If it is not hard rule, I'll drop cc: from the next patch revision.

Cc'ing stable@ is a rule which is documented in-tree. Many developers just omit
it for unknown reasons.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-07  7:21     ` Andy Shevchenko
@ 2026-07-07  8:47       ` Greg Kroah-Hartman
  2026-07-07  9:02         ` Andy Shevchenko
  0 siblings, 1 reply; 7+ messages in thread
From: Greg Kroah-Hartman @ 2026-07-07  8:47 UTC (permalink / raw)
  To: Andy Shevchenko
  Cc: Usyskin, Alexander, Arnd Bergmann, Nilawar, Badal,
	linux-kernel@vger.kernel.org, Adin, Menachem,
	stable@vger.kernel.org, lkp

On Tue, Jul 07, 2026 at 10:21:42AM +0300, Andy Shevchenko wrote:
> On Tue, Jul 07, 2026 at 06:43:20AM +0000, Usyskin, Alexander wrote:
> > > On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:
> 
> ...
> 
> > > > Cc: stable@vger.kernel.org
> > > 
> > > Why cc: stable?  It doesn't actually cause any functional change to the
> > > code at all, right?  This isn't running on s390, or am I mistaken?
> > 
> > This driver is for discrete graphics card, so it may run on non-x86 system, thus all conversions.
> > 
> > I've been told that if there is Fixes: for commit that already in stable, I should cc: stable.
> > If it is not hard rule, I'll drop cc: from the next patch revision.
> 
> Cc'ing stable@ is a rule which is documented in-tree. Many developers just omit
> it for unknown reasons.

My point is that this is NOT an actual bugfix that needs to be applied
anywhere except during the next merge window, as all it does is make
sparse quiet (which is a valid change).  It doesn't do anything "real"
as this hardware is not on any big-endian systems.

Please don't send stuff to stable that does not actually need to be in a
stable kernel tree.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-07  8:47       ` Greg Kroah-Hartman
@ 2026-07-07  9:02         ` Andy Shevchenko
  2026-07-07 11:33           ` Usyskin, Alexander
  0 siblings, 1 reply; 7+ messages in thread
From: Andy Shevchenko @ 2026-07-07  9:02 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Usyskin, Alexander, Arnd Bergmann, Nilawar, Badal,
	linux-kernel@vger.kernel.org, Adin, Menachem,
	stable@vger.kernel.org, lkp

On Tue, Jul 07, 2026 at 10:47:42AM +0200, Greg Kroah-Hartman wrote:
> On Tue, Jul 07, 2026 at 10:21:42AM +0300, Andy Shevchenko wrote:
> > On Tue, Jul 07, 2026 at 06:43:20AM +0000, Usyskin, Alexander wrote:
> > > > On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:

...

> > > > > Cc: stable@vger.kernel.org
> > > > 
> > > > Why cc: stable?  It doesn't actually cause any functional change to the
> > > > code at all, right?  This isn't running on s390, or am I mistaken?
> > > 
> > > This driver is for discrete graphics card, so it may run on non-x86 system, thus all conversions.
> > > 
> > > I've been told that if there is Fixes: for commit that already in stable, I should cc: stable.
> > > If it is not hard rule, I'll drop cc: from the next patch revision.
> > 
> > Cc'ing stable@ is a rule which is documented in-tree. Many developers just omit
> > it for unknown reasons.
> 
> My point is that this is NOT an actual bugfix that needs to be applied
> anywhere except during the next merge window, as all it does is make
> sparse quiet (which is a valid change).  It doesn't do anything "real"
> as this hardware is not on any big-endian systems.

I was not objecting that. My comment was regarding to "if it's not a hard rule".

> Please don't send stuff to stable that does not actually need to be in a
> stable kernel tree.

Fully agree.

-- 
With Best Regards,
Andy Shevchenko



^ permalink raw reply	[flat|nested] 7+ messages in thread

* RE: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
  2026-07-07  9:02         ` Andy Shevchenko
@ 2026-07-07 11:33           ` Usyskin, Alexander
  0 siblings, 0 replies; 7+ messages in thread
From: Usyskin, Alexander @ 2026-07-07 11:33 UTC (permalink / raw)
  To: Andy Shevchenko, Greg Kroah-Hartman
  Cc: Arnd Bergmann, Nilawar, Badal, linux-kernel@vger.kernel.org,
	Adin, Menachem, stable@vger.kernel.org, lkp

> Subject: Re: [PATCH char-misc v2] mei: lb: fix incorrect type in assignment
> 
> On Tue, Jul 07, 2026 at 10:47:42AM +0200, Greg Kroah-Hartman wrote:
> > On Tue, Jul 07, 2026 at 10:21:42AM +0300, Andy Shevchenko wrote:
> > > On Tue, Jul 07, 2026 at 06:43:20AM +0000, Usyskin, Alexander wrote:
> > > > > On Mon, Jul 06, 2026 at 04:01:30PM +0300, Alexander Usyskin wrote:
> 
> ...
> 
> > > > > > Cc: stable@vger.kernel.org
> > > > >
> > > > > Why cc: stable?  It doesn't actually cause any functional change to the
> > > > > code at all, right?  This isn't running on s390, or am I mistaken?
> > > >
> > > > This driver is for discrete graphics card, so it may run on non-x86 system,
> thus all conversions.
> > > >
> > > > I've been told that if there is Fixes: for commit that already in stable, I
> should cc: stable.
> > > > If it is not hard rule, I'll drop cc: from the next patch revision.
> > >
> > > Cc'ing stable@ is a rule which is documented in-tree. Many developers just
> omit
> > > it for unknown reasons.
> >
> > My point is that this is NOT an actual bugfix that needs to be applied
> > anywhere except during the next merge window, as all it does is make
> > sparse quiet (which is a valid change).  It doesn't do anything "real"
> > as this hardware is not on any big-endian systems.
> 
> I was not objecting that. My comment was regarding to "if it's not a hard
> rule".
> 
> > Please don't send stuff to stable that does not actually need to be in a
> > stable kernel tree.
> 
> Fully agree.
> 

Bottom line: it is hard rule, but not for such unimportant patch.
I'll drop cc in v3.
Should I also drop Fixes: line?

- - 
Thanks,
Sasha



^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-07-07 11:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-07-06 13:01 [PATCH char-misc v2] mei: lb: fix incorrect type in assignment Alexander Usyskin
2026-07-06 14:32 ` Greg Kroah-Hartman
2026-07-07  6:43   ` Usyskin, Alexander
2026-07-07  7:21     ` Andy Shevchenko
2026-07-07  8:47       ` Greg Kroah-Hartman
2026-07-07  9:02         ` Andy Shevchenko
2026-07-07 11:33           ` Usyskin, Alexander

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.