Re: [PATCH 20/20] staging:rtl8192u: Rename OWN - Style

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Mon, Sep 10, 2018 at 05:09:27PM +0200, Greg KH wrote:
> On Sat, Sep 01, 2018 at 12:02:50AM +0100, John Whitmore wrote:
> > Rename the member variable 'OWN' to 'own', this is to comply with the
> > coding standard, where variables are named in lowercase.
> > 
> > This is a simple coding style change which should have no impact on
> > runtime code execution.
> > 
> > Signed-off-by: John Whitmore <johnfwhitmore@xxxxxxxxx>
> > ---
> >  drivers/staging/rtl8192u/r8192U.h      | 2 +-
> >  drivers/staging/rtl8192u/r8192U_core.c | 2 +-
> >  2 files changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192u/r8192U.h b/drivers/staging/rtl8192u/r8192U.h
> > index 68e82b32a88e..f963b664e221 100644
> > --- a/drivers/staging/rtl8192u/r8192U.h
> > +++ b/drivers/staging/rtl8192u/r8192U.h
> > @@ -165,7 +165,7 @@ struct tx_desc_819x_usb {
> >  	u8	last_seg:1;
> >  	u8	first_seg:1;
> >  	u8	linip:1;
> > -	u8	OWN:1;
> > +	u8	own:1;
> >  
> >  	/* DWORD 1 */
> >  	u8	TxFWInfoSize;
> > diff --git a/drivers/staging/rtl8192u/r8192U_core.c b/drivers/staging/rtl8192u/r8192U_core.c
> > index 911d0214b48a..4d0f70ec31ac 100644
> > --- a/drivers/staging/rtl8192u/r8192U_core.c
> > +++ b/drivers/staging/rtl8192u/r8192U_core.c
> > @@ -1558,7 +1558,7 @@ short rtl8192_tx(struct net_device *dev, struct sk_buff *skb)
> >  	/* DWORD 0 */
> >  	tx_desc->first_seg = 1;
> >  	tx_desc->last_seg = 1;
> > -	tx_desc->OWN = 1;
> > +	tx_desc->own = 1;
> 
> Is this another case of a variable being set once and then never used?
> 
> If so, just delete it.
> 
> thanks,
> 
> greg k-h

em, I wasn't sure because that variable's a memeber of the sk_buff * passed
into the funtion. That function should be static to the file and is only
called from function rtl8192_hard_start_xmit() but that's a function
pointer which is sort of exported:

        priv->ieee80211->softmac_hard_start_xmit = rtl8192_hard_start_xmit;

Having said that the 'OWN' member is part of the private data:

	struct tx_desc_819x_usb *tx_desc = (struct tx_desc_819x_usb *)skb->data;

Like I say I wasn't sure so played it safe. I guess it's private data so nobody
outside the driver should be messing with that data, and I'm not sure how
public that function is.

I'll read some, ponder a bit and have another go.

jwhitmore
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel



[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux