[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <091a2ad3-d0d9-b196-c0cf-b5c6653a51f2@aquantia.com>
Date: Mon, 8 Oct 2018 13:49:55 +0000
From: Igor Russkikh <Igor.Russkikh@...antia.com>
To: Andrew Lunn <andrew@...n.ch>
CC: "David S . Miller" <davem@...emloft.net>,
"linux-usb@...r.kernel.org" <linux-usb@...r.kernel.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
Dmitry Bezrukov <Dmitry.Bezrukov@...antia.com>
Subject: Re: [PATCH net-next 14/19] net: usb: aqc111: Implement set_rx_mode
callback
Hi Andrew,
>> +{
>> + struct usbnet *dev = netdev_priv(net);
>> + struct aqc111_data *aqc111_data = (struct aqc111_data *)dev->data[0];
>
>> + u8 *m_filter = ((u8 *)dev->data) + 12;
>
> Please could you explain is.
Oh, that was a legacy code, the idea is it used spare area in dev->data array to
keep permanently 8 bytes for mcast filter request.
But the truth is usbnet_write anyway preallocates the data buffer and copies the data in there.
Therefore its really better to just allocate m_filter on stack to make the code clean.
Regards,
Igor
Powered by blists - more mailing lists