LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Aakash Hemadri <aakashhemadri123@gmail.com>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	Larry Finger <Larry.Finger@lwfinger.net>,
	Phillip Potter <phil@philpotter.co.uk>
Cc: linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org
Subject: [PATCH v2 5/5] staging: r8188eu: incorrect type in assignment
Date: Thu, 19 Aug 2021 13:47:57 +0530	[thread overview]
Message-ID: <6fa4a97fd0c2f0e3be6066ab6f059097e8cd29af.1629360917.git.aakashhemadri123@gmail.com> (raw)
In-Reply-To: <cover.1629360917.git.aakashhemadri123@gmail.com>

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@gmail.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


      parent reply	other threads:[~2021-08-19  8:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-19  8:17 [PATCH v2 0/5] staging: r8188eu: fix sparse warnings Aakash Hemadri
2021-08-19  8:17 ` [PATCH v2 1/5] staging: r8188eu: restricted __be16 degrades to int Aakash Hemadri
2021-08-19  8:17 ` [PATCH v2 2/5] staging: r8188eu: cast to restricted __be32 Aakash Hemadri
2021-08-19 12:58   ` Fabio M. De Francesco
2021-08-19 17:19   ` Greg Kroah-Hartman
2021-08-20 11:40     ` Aakash Hemadri
2021-08-20 21:44   ` Larry Finger
2021-08-21 14:21     ` Aakash Hemadri
2021-08-22 21:30     ` David Laight
2021-08-23  8:26       ` Aakash Hemadri
2021-08-23 14:19       ` Larry Finger
2021-08-19  8:17 ` [PATCH v2 3/5] staging: r8188eu: incorrect type in csum_ipv6_magic Aakash Hemadri
2021-08-20 21:38   ` Larry Finger
2021-08-21 14:19     ` Aakash Hemadri
2021-08-20 21:48   ` Larry Finger
2021-08-19  8:17 ` [PATCH v2 4/5] staging: r8188eu: restricted __be16 degrades to int Aakash Hemadri
2021-08-19 17:20   ` Greg Kroah-Hartman
2021-08-20 15:10     ` Fabio M. De Francesco
2021-08-21 14:18       ` Aakash Hemadri
2021-08-19  8:17 ` Aakash Hemadri [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=6fa4a97fd0c2f0e3be6066ab6f059097e8cd29af.1629360917.git.aakashhemadri123@gmail.com \
    --to=aakashhemadri123@gmail.com \
    --cc=Larry.Finger@lwfinger.net \
    --cc=gregkh@linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-staging@lists.linux.dev \
    --cc=phil@philpotter.co.uk \
    --subject='Re: [PATCH v2 5/5] staging: r8188eu: incorrect type in assignment' \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link

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