[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <6fa4a97fd0c2f0e3be6066ab6f059097e8cd29af.1629360917.git.aakashhemadri123@gmail.com>
Date: Thu, 19 Aug 2021 13:47:57 +0530
From: Aakash Hemadri <aakashhemadri123@...il.com>
To: Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Larry Finger <Larry.Finger@...inger.net>,
Phillip Potter <phil@...lpotter.co.uk>
Cc: linux-staging@...ts.linux.dev, linux-kernel@...r.kernel.org
Subject: [PATCH v2 5/5] staging: r8188eu: incorrect type in assignment
Fix sparse warning:
> rtw_br_ext.c:516:57: warning: incorrect type in assignment
(different base types)
> rtw_br_ext.c:516:57: expected unsigned short
> rtw_br_ext.c:516:57: got restricted __be16 [usertype]
*pMagic expects unsigned short not __be16, so remove htons and cast
MAGIC_CODE as unsigned short
Signed-off-by: Aakash Hemadri <aakashhemadri123@...il.com>
---
drivers/staging/r8188eu/core/rtw_br_ext.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
index 14b2935cab98..600a38330579 100644
--- a/drivers/staging/r8188eu/core/rtw_br_ext.c
+++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
@@ -513,7 +513,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
/* insert the magic_code+client mac in relay tag */
pMagic = (unsigned short *)tag->tag_data;
- *pMagic = htons(MAGIC_CODE);
+ *pMagic = (unsigned short)MAGIC_CODE;
memcpy(tag->tag_data+MAGIC_CODE_LEN, skb->data+ETH_ALEN, ETH_ALEN);
/* Add relay tag */
--
2.32.0
Powered by blists - more mailing lists