Re: [PATCH] staging: sm750fb: fix camelCase names

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

 



On Sun, May 14, 2023 at 02:00:40PM +0200, Dalvin-Ehinoma Noah Aiguobas wrote:
> Adhere to Linux kernel coding style.
> 
> Reported by checkpatch:
> 
> Avoid CamelCase:
> Rename variables and functions in ddk750_sii164.c which cause styleproblem.
> 
> Signed-off-by: Dalvin-Ehinoma Noah Aiguobas <pharcodra@xxxxxxxxx>
> ---
>  drivers/staging/sm750fb/ddk750_sii164.c | 104 ++++++++++++------------
>  1 file changed, 52 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/staging/sm750fb/ddk750_sii164.c b/drivers/staging/sm750fb/ddk750_sii164.c
> index 3da1796cd7aa..4b8f9e617a91 100644
> --- a/drivers/staging/sm750fb/ddk750_sii164.c
> +++ b/drivers/staging/sm750fb/ddk750_sii164.c
> @@ -12,11 +12,11 @@
>  #define USE_HW_I2C
>  
>  #ifdef USE_HW_I2C
> -    #define i2cWriteReg sm750_hw_i2c_write_reg
> -    #define i2cReadReg  sm750_hw_i2c_read_reg
> +    #define i2c_write_reg sm750_hw_i2c_write_reg
> +    #define i2c_read_reg  sm750_hw_i2c_read_reg
>  #else
> -    #define i2cWriteReg sm750_sw_i2c_write_reg
> -    #define i2cReadReg  sm750_sw_i2c_read_reg
> +    #define i2c_write_reg sm750_sw_i2c_write_reg
> +    #define i2c_read_reg  sm750_sw_i2c_read_reg
>  #endif

Why are these needed at all?  The above #define is always set, so just
unwind these to use the real function calls insteadd.

>  
>  /* SII164 Vendor and Device ID */
> @@ -25,7 +25,7 @@
>  
>  #ifdef SII164_FULL_FUNCTIONS
>  /* Name of the DVI Controller chip */
> -static char *gDviCtrlChipName = "Silicon Image SiI 164";
> +static char *g_dvi_ctrl_chip_name = "Silicon Image SiI 164";

Why did you keep the "g_" here?  That is keeping an odd identifier name
for no reason.

>  #endif
>  
>  /*
> @@ -37,14 +37,14 @@ static char *gDviCtrlChipName = "Silicon Image SiI 164";
>   */
>  unsigned short sii164_get_vendor_id(void)
>  {
> -	unsigned short vendorID;
> +	unsigned short vendor_ID;

Isn't the original the term used by the i2c specification?  If so,
please don't change it.

>  
> -	vendorID = ((unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
> +	vendor_ID = ((unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
>  					       SII164_VENDOR_ID_HIGH) << 8) |
> -		   (unsigned short)i2cReadReg(SII164_I2C_ADDRESS,
> +		   (unsigned short)i2c_read_reg(SII164_I2C_ADDRESS,
>  					      SII164_VENDOR_ID_LOW);

You didn't fix up the indentation here either :(

I stopped reviewing here, sorry.

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