Re: [PATCH 2/2] comedi/ni_pcidio: make all defines uppercase

2018-12-17 Thread Alexander Schroth
We agree that preserving the reverse-engineered knowledge is more
important than reducing code size. In turn, we have modified the patch
to keep these defines and converted them to uppercase as well.
Also, we agree that further abbreviating would be a bad idea.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 2/2] comedi/ni_pcidio: make all defines uppercase

2018-12-11 Thread Spencer Olson
On Tue, Dec 11, 2018 at 3:50 AM Alexander Schroth
 wrote:
>
> According to the Linux coding guidelines, defines should be written
> in uppercase. This patch converts all define-statements in the
> ni_pcidio.c file to uppercase, thus matching the coding style of the
> kernel.
>
> Signed-off-by: Alexander Schroth 
> Signed-off-by: Marco Ammon 
> ---
>  drivers/staging/comedi/drivers/ni_pcidio.c | 306 +++--
>  1 file changed, 154 insertions(+), 152 deletions(-)
>
> diff --git a/drivers/staging/comedi/drivers/ni_pcidio.c 
> b/drivers/staging/comedi/drivers/ni_pcidio.c
> index 91ffcfb45f55..350b32643a50 100644
> --- a/drivers/staging/comedi/drivers/ni_pcidio.c
> +++ b/drivers/staging/comedi/drivers/ni_pcidio.c
> @@ -49,71 +49,72 @@
>
>  /* defines for the PCI-DIO-32HS */
>
> -#define Interrupt_And_Window_Status4   /* R */
> +#define INTERRUPT_AND_WINDOW_STATUS4   /* R */
>
> -#define Master_DMA_And_Interrupt_Control 5 /* W */
> -#define DataLeft   BIT(0)
> +#define MASTER_DMA_AND_INTERRUPT_CONTROL 5 /* W */
> +#define DATA_LEFT  BIT(0)
>
> -#define Group_1_Flags  6   /* R */
> -#define TransferReady  BIT(0)
> -#define CountExpired   BIT(1)
> -#define Waited BIT(5)
> -#define PrimaryTC  BIT(6)
> -#define SecondaryTCBIT(7)
> +#define GROUP_1_FLAGS  6   /* R */
> +#define TRANSFER_READY BIT(0)
> +#define COUNT_EXPIRED  BIT(1)
> +#define WAITED BIT(5)
> +#define PRIMARY_TC BIT(6)
> +#define SECONDARY_TC   BIT(7)
>/* #define SerialRose */
>/* #define ReqRose */
>/* #define Paused */
>
> -#define Group_1_First_Clear6   /* W */
> -#define ClearWaitedBIT(3)
> -#define ClearPrimaryTC BIT(4)
> -#define ClearSecondaryTC   BIT(5)
> +#define GROUP_1_FIRST_CLEAR6   /* W */
> +#define CLEAR_WAITED   BIT(3)
> +#define CLEAR_PRIMARY_TC   BIT(4)
> +#define CLEAR_SECONDARY_TC BIT(5)
>
> -#define Group_1_FIFO   8   /* W */
> +#define GROUP_1_FIFO   8   /* W */
>
> -#define Transfer_Count 20
> -#define Chip_Version   27
> -#define Port_IO(x) (28 + (x))
> -#define Port_Pin_Directions(x) (32 + (x))
> -#define Port_Pin_Mask(x)   (36 + (x))
> +#define TRANSFER_COUNT 20
> +#define CHIP_VERSION   27
> +#define PORT_IO(x) (28 + (x))
> +#define PORT_PIN_DIRECTIONS(x) (32 + (x))
> +#define PORT_PIN_MASK(x)   (36 + (x))
>
> -#define Group_1_Second_Clear   46  /* W */
> -#define ClearExpired   BIT(0)
> +#define GROUP_1_SECOND_CLEAR   46  /* W */
> +#define CLEAR_EXPIRED  BIT(0)
>
> -#define Data_Path  64
> +#define DATA_PATH  64
>
> -#define Protocol_Register_165
> -#define OpMode Protocol_Register_1
> -#define RunMode(x) ((x) & 7)
> -#define Numbered   BIT(3)
> +#define PROTOCOL_REGISTER_165
> +#define OP_MODEPROTOCOL_REGISTER_1
> +#define RUN_MODE(x)((x) & 7)
> +#define NUMBERED   BIT(3)
>
> -#define Protocol_Register_266
> -#define ClockReg   Protocol_Register_2
> -#define DataLatching(x)   (((x) & 3) << 5)
> +#define PROTOCOL_REGISTER_266
> +#define CLOCK_REG  PROTOCOL_REGISTER_2
> +#define DATA_LATCHING(x)   (((x) & 3) << 5)
>
> -#define Protocol_Register_367
> -#define Sequence   Protocol_Register_3
> +#define PROTOCOL_REGISTER_367
> +#define SEQUENCE   PROTOCOL_REGISTER_3
>
> -#define Protocol_Register_14   68  /* 16 bit */
> -#define ClockSpeed Protocol_Register_14
> +#define PROTOCOL_REGISTER_14   68  /* 16 bit */
> +#define CLOCK_SPEEDPROTOCOL_REGISTER_14
>
> -#define Protocol_Register_470
> -#define ReqReg Protocol_Register_4
> +#define PROTOCOL_REGISTER_470
> +#define REQ_REGPROTOCOL_REGISTER_4
>
> -#define Protocol_Register_571
> -#define BlockMode  Protocol_Register_5
> +#define PROTOCOL_REGISTER_571
> +#define BLOCK_MODE PROTOCOL_REGISTER_5
>
> -#define Protocol_Register_673
> -#define LinePolarities