Re: [PATCH v5 3/3] staging: r8188eu: incorrect type in assignment

From: Dan Carpenter
Date: Fri Sep 03 2021 - 04:12:10 EST


On Thu, Sep 02, 2021 at 11:28:45AM +0200, Greg Kroah-Hartman wrote:
> On Sat, Aug 28, 2021 at 04:40:46PM +0530, Aakash Hemadri wrote:
> > @@ -512,7 +512,7 @@ int nat25_db_handle(struct adapter *priv, struct sk_buff *skb, int method)
> > tag->tag_len = htons(MAGIC_CODE_LEN+RTL_RELAY_TAG_LEN+old_tag_len);
> >
> > /* insert the magic_code+client mac in relay tag */
> > - pMagic = (unsigned short *)tag->tag_data;
> > + pMagic = (__be16 *)tag->tag_data;
>
> Is this whole function ever actually called?
>
> Can someone run a ftrace on the driver to see if this function ever
> runs, and if not, remove it?
>

Yeah. That was my thinking when reviewing this patchset is that the NAT
stuff is probably not well tested. It's only used for WIFI_STATION_STATE
or WIFI_ADHOC_STATE.

I don't think it's dead code but having NAT code in the driver is the
wrong layer probably?

regards,
dan carpenter