From: Ben Dooks Subject: usbnet private-data accessor functions Date: Fri, 12 Oct 2018 10:16:35 +0100 Message-ID: <20181012091642.21294-1-ben.dooks@codethink.co.uk> Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Cc: linux-usb@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kernel@lists.codethink.co.uk, gregkh@linuxfoundation.org, bjorn@mork.no, steve.glendinning@shawell.net To: davem@davemloft.net, netdev@vger.kernel.org Return-path: Sender: linux-kernel-owner@vger.kernel.org List-Id: netdev.vger.kernel.org I have been looking at the usbnet drivers and the possibility of some code cleanups. One of the things I've found is that changing the way the drivers use the private data with the usbnet structure is often hand-coded each time is needed. An easy cleanp (and making it easier in the future to change the access method) would be to add an inline conversion function to each driver so that it is done in one place. Future work would be to look at the usbnet.data and see if it could be changed (such as moving to a union, allocation of the data after the usbnet structure, or similar).