Re: [PATCH v3 01/10] staging: r8188eu: use Linux kernel variable naming convention

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

 



On Thu, Oct 20, 2022 at 01:22:50PM +0530, Deepak R Varma wrote:
> Follow the Linux Kernel coding style variable naming convention instead
> of using camelCase style. Issue reported by checkpatch script for
> these variables:
>         tagLen, tagType, networkAddr, ipAddr, macAddr
> 
> Signed-off-by: Deepak R Varma <drv@xxxxxxxxx>
> ---
> 
> Changes in v3:
>    -- None
> 
> Changes in v1 [actually v2]:
>    1. Improve patch description per feedback from julia.lawall@xxxxxxxx
> 
> 
>  drivers/staging/r8188eu/core/rtw_br_ext.c | 112 +++++++++++-----------
>  1 file changed, 56 insertions(+), 56 deletions(-)
> 
> diff --git a/drivers/staging/r8188eu/core/rtw_br_ext.c b/drivers/staging/r8188eu/core/rtw_br_ext.c
> index 4c5f30792a46..79daf8f269d6 100644
> --- a/drivers/staging/r8188eu/core/rtw_br_ext.c
> +++ b/drivers/staging/r8188eu/core/rtw_br_ext.c
> @@ -50,17 +50,17 @@
>  static unsigned char *__nat25_find_pppoe_tag(struct pppoe_hdr *ph, unsigned short type)
>  {
>  	unsigned char *cur_ptr, *start_ptr;
> -	unsigned short tagLen, tagType;
> +	unsigned short tag_len, tag_type;
> 
>  	start_ptr = (unsigned char *)ph->tag;
>  	cur_ptr = (unsigned char *)ph->tag;
>  	while ((cur_ptr - start_ptr) < ntohs(ph->length)) {
>  		/*  prevent un-alignment access */
> -		tagType = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
> -		tagLen  = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
> -		if (tagType == type)
> +		tag_type = (unsigned short)((cur_ptr[0] << 8) + cur_ptr[1]);
> +		tag_len  = (unsigned short)((cur_ptr[2] << 8) + cur_ptr[3]);
> +		if (tag_type == type)
>  			return cur_ptr;
> -		cur_ptr = cur_ptr + TAG_HDR_LEN + tagLen;
> +		cur_ptr = cur_ptr + TAG_HDR_LEN + tag_len;
>  	}
>  	return NULL;
>  }
> @@ -111,32 +111,32 @@ static int  __nat25_has_expired(struct nat25_network_db_entry *fdb)
>  	return 0;
>  }
> 
> -static void __nat25_generate_ipv4_network_addr(unsigned char *networkAddr,

As others have said, just make "networkAddr" be "addr" and then it will
be a lot cleaner and smaller overall.

thanks,

greg k-h




[Index of Archives]     [Linux Driver Development]     [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