Re: [PATCH 1/3] Staging: comedi: fix brace coding style issue in ni_tio.c This is a patch to the ni_tio.c file that fixes up a brace, indentation and overlines warning found by the checkpatch.pl tool Signed-off-by: Varayud Damian Alfredo <davarayud@xxxxxxxxx>

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

 



On Wed, 2010-11-03 at 18:19 -0300, Damian Varayud wrote:
> ---
>  drivers/staging/comedi/drivers/ni_tio.c |  154 ++++++++++++++++++-------------
>  1 files changed, 89 insertions(+), 65 deletions(-)
> 
> diff --git a/drivers/staging/comedi/drivers/ni_tio.c b/drivers/staging/comedi/drivers/ni_tio.c
> index a9bb6b1..dd3db48 100644
> --- a/drivers/staging/comedi/drivers/ni_tio.c
> +++ b/drivers/staging/comedi/drivers/ni_tio.c
> @@ -59,8 +59,8 @@ MODULE_DESCRIPTION("Comedi support for NI general-purpose counters");
>  MODULE_LICENSE("GPL");
>  
>  static inline enum Gi_Counting_Mode_Reg_Bits Gi_Alternate_Sync_Bit(enum
> -								   ni_gpct_variant
> -								   variant)
> +								ni_gpct_variant
> +								variant)

Hi Damian.

This isn't an improvement.

It'd be better as:

static inline enum Gi_Counting_Mode_Reg_Bits
Gi_Alternate_Sync_Bit(enum ni_gpct_variant variant)

> @@ -122,8 +122,8 @@ static inline enum Gi_Counting_Mode_Reg_Bits Gi_Prescale_X8_Bit(enum
>  }
>  
>  static inline enum Gi_Counting_Mode_Reg_Bits Gi_HW_Arm_Select_Mask(enum
> -								   ni_gpct_variant
> -								   variant)
> +								ni_gpct_variant
> +								variant)

here too

[]

> @@ -291,21 +296,22 @@ static void __exit ni_tio_cleanup_module(void)
>  
>  module_exit(ni_tio_cleanup_module);
>  
> -struct ni_gpct_device *ni_gpct_device_construct(struct comedi_device *dev,
> -						void (*write_register) (struct
> -									ni_gpct
> -									*
> -									counter,
> -									unsigned
> -									bits,
> -									enum
> -									ni_gpct_register
> -									reg),
> -						unsigned (*read_register)
> -						(struct ni_gpct *counter,
> -						 enum ni_gpct_register reg),
> -						enum ni_gpct_variant variant,
> -						unsigned num_counters)
> +struct ni_gpct_device *ni_gpct_device_construct
> +				(struct comedi_device *dev,
> +				void (*write_register) (struct
> +							ni_gpct
> +							*
> +							counter,
> +							unsigned
> +							bits,
> +							enum
> +							ni_gpct_register
> +							reg),
> +				unsigned (*read_register)
> +				(struct ni_gpct *counter,
> +					enum ni_gpct_register reg),
> +				enum ni_gpct_variant variant,
> +				unsigned num_counters)

And this is just plain ugly.

How about:

struct ni_gpct_device *
ni_gpct_device_construct(struct comedi_device *dev,
			 void (*write_register)(struct ni_gpct *counter,
						unsigned bit,
						enum ni_gpct_register reg),
			 unsigned (*read__register)(struct ni_gpct *counter,
						    enum ni_gpct_variant variant,
						    unsigned num_counters))

Please try to use some taste in ignoring checkpatch output
when appropriate.  80 columns isn't dicta.

cheers, Joe

_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/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