linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/2] fix sparse warnings
@ 2021-02-21 15:30 karthik alapati
  2021-02-21 15:31 ` [PATCH 1/2] staging: wimax/i2400m: fix byte-order issue karthik alapati
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: karthik alapati @ 2021-02-21 15:30 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg
  Cc: devel, linux-kernel

the following patches fixes two  byte-order issues
and fixes these sparse warnings


drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types)
drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    expected restricted __le16 [usertype] length
drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    got unsigned long
.
drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer


karthik alapati (2):
  staging: wimax/i2400m: fix byte-order issue
  staging: wimax/i2400m: convert __le32 type to host byte-order

 drivers/staging/wimax/i2400m/fw.c        | 2 +-
 drivers/staging/wimax/i2400m/op-rfkill.c | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

-- 
2.30.1


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

* [PATCH 1/2] staging: wimax/i2400m: fix byte-order issue
  2021-02-21 15:30 [PATCH 0/2] fix sparse warnings karthik alapati
@ 2021-02-21 15:31 ` karthik alapati
  2021-02-21 15:31 ` [PATCH 2/2] staging: wimax/i2400m: convert __le32 type to host byte-order karthik alapati
  2021-02-24 14:56 ` [PATCH 0/2] fix sparse warnings karthek
  2 siblings, 0 replies; 6+ messages in thread
From: karthik alapati @ 2021-02-21 15:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg
  Cc: devel, linux-kernel

fix sparse byte-order warnings by converting host byte-order
type to __le16 byte-order types before assigning to hdr.length

Signed-off-by: karthik alapati <mail@karthek.com>
---
 drivers/staging/wimax/i2400m/op-rfkill.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wimax/i2400m/op-rfkill.c b/drivers/staging/wimax/i2400m/op-rfkill.c
index a159808f0..0f438ae6a 100644
--- a/drivers/staging/wimax/i2400m/op-rfkill.c
+++ b/drivers/staging/wimax/i2400m/op-rfkill.c
@@ -86,7 +86,7 @@ int i2400m_op_rfkill_sw_toggle(struct wimax_dev *wimax_dev,
 	if (cmd == NULL)
 		goto error_alloc;
 	cmd->hdr.type = cpu_to_le16(I2400M_MT_CMD_RF_CONTROL);
-	cmd->hdr.length = sizeof(cmd->sw_rf);
+	cmd->hdr.length = cpu_to_le16(sizeof(cmd->sw_rf));
 	cmd->hdr.version = cpu_to_le16(I2400M_L3L4_VERSION);
 	cmd->sw_rf.hdr.type = cpu_to_le16(I2400M_TLV_RF_OPERATION);
 	cmd->sw_rf.hdr.length = cpu_to_le16(sizeof(cmd->sw_rf.status));
-- 
2.30.1


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

* [PATCH 2/2] staging: wimax/i2400m: convert __le32 type to host byte-order
  2021-02-21 15:30 [PATCH 0/2] fix sparse warnings karthik alapati
  2021-02-21 15:31 ` [PATCH 1/2] staging: wimax/i2400m: fix byte-order issue karthik alapati
@ 2021-02-21 15:31 ` karthik alapati
  2021-02-24 14:56 ` [PATCH 0/2] fix sparse warnings karthek
  2 siblings, 0 replies; 6+ messages in thread
From: karthik alapati @ 2021-02-21 15:31 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg
  Cc: devel, linux-kernel

fix sparse type warning by converting __le32 types
to host byte-order types before comparison

Signed-off-by: karthik alapati <mail@karthek.com>
---
 drivers/staging/wimax/i2400m/fw.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/wimax/i2400m/fw.c b/drivers/staging/wimax/i2400m/fw.c
index 92ea5c101..f09de1810 100644
--- a/drivers/staging/wimax/i2400m/fw.c
+++ b/drivers/staging/wimax/i2400m/fw.c
@@ -511,7 +511,7 @@ ssize_t __i2400m_bm_ack_verify(struct i2400m *i2400m, int opcode,
 			opcode, i2400m_brh_get_response(ack));
 		goto error_ack_failed;
 	}
-	if (ack_size < ack->data_size + sizeof(*ack)) {
+	if (ack_size < le32_to_cpu(ack->data_size) + sizeof(*ack)) {
 		dev_err(dev, "boot-mode cmd %d: SW BUG "
 			"driver provided only %zu bytes for %zu bytes "
 			"of data\n", opcode, ack_size,
-- 
2.30.1


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

* Re: [PATCH 0/2] fix sparse warnings
  2021-02-21 15:30 [PATCH 0/2] fix sparse warnings karthik alapati
  2021-02-21 15:31 ` [PATCH 1/2] staging: wimax/i2400m: fix byte-order issue karthik alapati
  2021-02-21 15:31 ` [PATCH 2/2] staging: wimax/i2400m: convert __le32 type to host byte-order karthik alapati
@ 2021-02-24 14:56 ` karthek
  2021-02-24 15:06   ` Dan Carpenter
  2 siblings, 1 reply; 6+ messages in thread
From: karthek @ 2021-02-24 14:56 UTC (permalink / raw)
  To: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg
  Cc: devel, linux-kernel

On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote:
> the following patches fixes two  byte-order issues
> and fixes these sparse warnings
> 
> 
> drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types)
> drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    expected restricted __le16 [usertype] length
> drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    got unsigned long
> .
> drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer
> 
> 
> karthik alapati (2):
>   staging: wimax/i2400m: fix byte-order issue
>   staging: wimax/i2400m: convert __le32 type to host byte-order
> 
>  drivers/staging/wimax/i2400m/fw.c        | 2 +-
>  drivers/staging/wimax/i2400m/op-rfkill.c | 2 +-
>  2 files changed, 2 insertions(+), 2 deletions(-)
> 
> -- 
> 2.30.1
> 
ping?

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

* Re: [PATCH 0/2] fix sparse warnings
  2021-02-24 14:56 ` [PATCH 0/2] fix sparse warnings karthek
@ 2021-02-24 15:06   ` Dan Carpenter
  2021-02-24 16:12     ` karthek
  0 siblings, 1 reply; 6+ messages in thread
From: Dan Carpenter @ 2021-02-24 15:06 UTC (permalink / raw)
  To: karthek
  Cc: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg, devel, linux-kernel

On Wed, Feb 24, 2021 at 08:26:41PM +0530, karthek wrote:
> On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote:
> > the following patches fixes two  byte-order issues
> > and fixes these sparse warnings
> > 
> > 
> > drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types)
> > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    expected restricted __le16 [usertype] length
> > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    got unsigned long
> > .
> > drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer
> > 
> > 
> > karthik alapati (2):
> >   staging: wimax/i2400m: fix byte-order issue
> >   staging: wimax/i2400m: convert __le32 type to host byte-order
> > 
> >  drivers/staging/wimax/i2400m/fw.c        | 2 +-
> >  drivers/staging/wimax/i2400m/op-rfkill.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > -- 
> > 2.30.1
> > 
> ping?

The merge window is open so no one is merging these types of fixes now.
Wait until -rc1 is out, and then give the maintainer two weeks to look
at your patch and get back to you.

regards,
dan carpenter


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

* Re: [PATCH 0/2] fix sparse warnings
  2021-02-24 15:06   ` Dan Carpenter
@ 2021-02-24 16:12     ` karthek
  0 siblings, 0 replies; 6+ messages in thread
From: karthek @ 2021-02-24 16:12 UTC (permalink / raw)
  To: Dan Carpenter
  Cc: Greg Kroah-Hartman, Lee Jones, Jakub Kicinski, Arnd Bergmann,
	Johannes Berg, devel, linux-kernel

On Wed, Feb 24, 2021 at 06:06:48PM +0300, Dan Carpenter wrote:
> On Wed, Feb 24, 2021 at 08:26:41PM +0530, karthek wrote:
> > On Sun, Feb 21, 2021 at 09:00:48PM +0530, karthik alapati wrote:
> > > the following patches fixes two  byte-order issues
> > > and fixes these sparse warnings
> > > 
> > > 
> > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25: warning: incorrect type in assignment (different base types)
> > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    expected restricted __le16 [usertype] length
> > > drivers/staging//wimax/i2400m/op-rfkill.c:89:25:    got unsigned long
> > > .
> > > drivers/staging//wimax/i2400m/fw.c:514:27: warning: restricted __le32 degrades to integer
> > > 
> > > 
> > > karthik alapati (2):
> > >   staging: wimax/i2400m: fix byte-order issue
> > >   staging: wimax/i2400m: convert __le32 type to host byte-order
> > > 
> > >  drivers/staging/wimax/i2400m/fw.c        | 2 +-
> > >  drivers/staging/wimax/i2400m/op-rfkill.c | 2 +-
> > >  2 files changed, 2 insertions(+), 2 deletions(-)
> > > 
> > > -- 
> > > 2.30.1
> > > 
> > ping?
> 
> The merge window is open so no one is merging these types of fixes now.
> Wait until -rc1 is out, and then give the maintainer two weeks to look
> at your patch and get back to you.
> 
> regards,
> dan carpenter
>
thanks dan, Got it.

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

end of thread, other threads:[~2021-02-24 16:16 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-02-21 15:30 [PATCH 0/2] fix sparse warnings karthik alapati
2021-02-21 15:31 ` [PATCH 1/2] staging: wimax/i2400m: fix byte-order issue karthik alapati
2021-02-21 15:31 ` [PATCH 2/2] staging: wimax/i2400m: convert __le32 type to host byte-order karthik alapati
2021-02-24 14:56 ` [PATCH 0/2] fix sparse warnings karthek
2021-02-24 15:06   ` Dan Carpenter
2021-02-24 16:12     ` karthek

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).