netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] nfc: store __be16 value in __be16 variable
@ 2023-06-08 11:21 Simon Horman
  2023-06-08 23:29 ` Samudrala, Sridhar
  2023-06-09  4:23 ` Kalesh Anakkur Purayil
  0 siblings, 2 replies; 4+ messages in thread
From: Simon Horman @ 2023-06-08 11:21 UTC (permalink / raw)
  To: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Krzysztof Kozlowski, Luca Ceresoli, Michael Walle,
	Uwe Kleine-König, netdev

Use a __be16 variable to store the store the big endian value of header
in nxp_nci_i2c_fw_read().

Flagged by sparse as:

 .../i2c.c:113:22: warning: cast to restricted __be16

No functional changes intended.
Compile tested only.

Signed-off-by: Simon Horman <horms@kernel.org>
---
 drivers/nfc/nxp-nci/i2c.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
index baddaf242d18..dca25a0c2f33 100644
--- a/drivers/nfc/nxp-nci/i2c.c
+++ b/drivers/nfc/nxp-nci/i2c.c
@@ -97,8 +97,8 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy,
 			       struct sk_buff **skb)
 {
 	struct i2c_client *client = phy->i2c_dev;
-	u16 header;
 	size_t frame_len;
+	__be16 header;
 	int r;
 
 	r = i2c_master_recv(client, (u8 *) &header, NXP_NCI_FW_HDR_LEN);


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

* Re: [PATCH net-next] nfc: store __be16 value in __be16 variable
  2023-06-08 11:21 [PATCH net-next] nfc: store __be16 value in __be16 variable Simon Horman
@ 2023-06-08 23:29 ` Samudrala, Sridhar
  2023-06-09  4:23 ` Kalesh Anakkur Purayil
  1 sibling, 0 replies; 4+ messages in thread
From: Samudrala, Sridhar @ 2023-06-08 23:29 UTC (permalink / raw)
  To: Simon Horman, David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni
  Cc: Krzysztof Kozlowski, Luca Ceresoli, Michael Walle,
	Uwe Kleine-König, netdev



On 6/8/2023 4:21 AM, Simon Horman wrote:
> Use a __be16 variable to store the store the big endian value of header
> in nxp_nci_i2c_fw_read().
> 
> Flagged by sparse as:
> 
>   .../i2c.c:113:22: warning: cast to restricted __be16
> 
> No functional changes intended.
> Compile tested only.
> 
> Signed-off-by: Simon Horman <horms@kernel.org>

Reviewed-by: Sridhar Samudrala <sridhar.samudrala@intel.com>


> ---
>   drivers/nfc/nxp-nci/i2c.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index baddaf242d18..dca25a0c2f33 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -97,8 +97,8 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy *phy,
>   			       struct sk_buff **skb)
>   {
>   	struct i2c_client *client = phy->i2c_dev;
> -	u16 header;
>   	size_t frame_len;
> +	__be16 header;
>   	int r;
>   
>   	r = i2c_master_recv(client, (u8 *) &header, NXP_NCI_FW_HDR_LEN);
> 
> 

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

* Re: [PATCH net-next] nfc: store __be16 value in __be16 variable
  2023-06-08 11:21 [PATCH net-next] nfc: store __be16 value in __be16 variable Simon Horman
  2023-06-08 23:29 ` Samudrala, Sridhar
@ 2023-06-09  4:23 ` Kalesh Anakkur Purayil
  2023-06-09  8:44   ` Simon Horman
  1 sibling, 1 reply; 4+ messages in thread
From: Kalesh Anakkur Purayil @ 2023-06-09  4:23 UTC (permalink / raw)
  To: Simon Horman
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Krzysztof Kozlowski, Luca Ceresoli, Michael Walle,
	Uwe Kleine-König, netdev


[-- Attachment #1.1: Type: text/plain, Size: 1148 bytes --]

On Thu, Jun 8, 2023 at 4:52 PM Simon Horman <horms@kernel.org> wrote:

> Use a __be16 variable to store the store the big endian value of header
>
[Kalesh]: Minor nit, looks like a typo as "store the" is repeating.

> in nxp_nci_i2c_fw_read().
>
> Flagged by sparse as:
>
>  .../i2c.c:113:22: warning: cast to restricted __be16
>
> No functional changes intended.
> Compile tested only.
>
> Signed-off-by: Simon Horman <horms@kernel.org>
> ---
>  drivers/nfc/nxp-nci/i2c.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/nfc/nxp-nci/i2c.c b/drivers/nfc/nxp-nci/i2c.c
> index baddaf242d18..dca25a0c2f33 100644
> --- a/drivers/nfc/nxp-nci/i2c.c
> +++ b/drivers/nfc/nxp-nci/i2c.c
> @@ -97,8 +97,8 @@ static int nxp_nci_i2c_fw_read(struct nxp_nci_i2c_phy
> *phy,
>                                struct sk_buff **skb)
>  {
>         struct i2c_client *client = phy->i2c_dev;
> -       u16 header;
>         size_t frame_len;
> +       __be16 header;
>         int r;
>
>         r = i2c_master_recv(client, (u8 *) &header, NXP_NCI_FW_HDR_LEN);
>
>
>

-- 
Regards,
Kalesh A P

[-- Attachment #1.2: Type: text/html, Size: 1920 bytes --]

[-- Attachment #2: S/MIME Cryptographic Signature --]
[-- Type: application/pkcs7-signature, Size: 4239 bytes --]

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

* Re: [PATCH net-next] nfc: store __be16 value in __be16 variable
  2023-06-09  4:23 ` Kalesh Anakkur Purayil
@ 2023-06-09  8:44   ` Simon Horman
  0 siblings, 0 replies; 4+ messages in thread
From: Simon Horman @ 2023-06-09  8:44 UTC (permalink / raw)
  To: Kalesh Anakkur Purayil
  Cc: David S. Miller, Eric Dumazet, Jakub Kicinski, Paolo Abeni,
	Krzysztof Kozlowski, Luca Ceresoli, Michael Walle,
	Uwe Kleine-König, netdev

On Fri, Jun 09, 2023 at 09:53:16AM +0530, Kalesh Anakkur Purayil wrote:
> On Thu, Jun 8, 2023 at 4:52 PM Simon Horman <horms@kernel.org> wrote:
> 
> > Use a __be16 variable to store the store the big endian value of header
> >
> [Kalesh]: Minor nit, looks like a typo as "store the" is repeating.

Thanks,

of course you are right.
I'll address this in a v2.

-- 
pw-bot: cr



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

end of thread, other threads:[~2023-06-09  8:44 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-06-08 11:21 [PATCH net-next] nfc: store __be16 value in __be16 variable Simon Horman
2023-06-08 23:29 ` Samudrala, Sridhar
2023-06-09  4:23 ` Kalesh Anakkur Purayil
2023-06-09  8:44   ` Simon Horman

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).