Re: [PATCH] comedi: drivers: ni_pcimio: Remove the code enclosed by #if 0 and its #endif

From: Deepak R Varma
Date: Fri Mar 10 2023 - 10:56:46 EST


On Fri, Mar 10, 2023 at 06:01:19AM -0800, Sumitra Sharma wrote:
> Reported by checkpatch.pl:
>
> WARNING: Consider removing the code enclosd by this #if 0 and its #endif
> at line 482, 501, 570.
>
> Signed-off-by: Sumitra Sharma <sumitraartsy@xxxxxxxxx>
> ---
> drivers/comedi/drivers/ni_pcimio.c | 48 ------------------------------
> 1 file changed, 48 deletions(-)

Hi Sumitra,
Nice first attempt. However, you should be working in the drivers/staging
directory for now.

Also, specific to the following change, the device definitions may be useful to
people who have those devices and can be added to the driver by simply removing
the #if 0 condition. Hence, these commented blocks are likely retained due to
same reason.

Thank you,
Deepak.

>
> diff --git a/drivers/comedi/drivers/ni_pcimio.c b/drivers/comedi/drivers/ni_pcimio.c
> index 0b055321023d..1603095f2ed9 100644
> --- a/drivers/comedi/drivers/ni_pcimio.c
> +++ b/drivers/comedi/drivers/ni_pcimio.c
> @@ -479,43 +479,6 @@ static const struct ni_board_struct ni_boards[] = {
> .ao_speed = 250,
> .caldac = { ad8804, ad8804 },
> },
> -#if 0
> - /* The 6115 boards probably need their own driver */
> - [BOARD_PCI6115] = { /* .device_id = 0x2ed0, */
> - .name = "pci-6115",
> - .n_adchan = 4,
> - .ai_maxdata = 0x0fff,
> - .ai_fifo_depth = 8192,
> - .gainlkup = ai_gain_611x,
> - .ai_speed = 100,
> - .n_aochan = 2,
> - .ao_maxdata = 0xffff,
> - .ao_671x = 1,
> - .ao_fifo_depth = 2048,
> - .ao_speed = 250,
> - .reg_611x = 1,
> - /* XXX */
> - .caldac = { ad8804_debug, ad8804_debug, ad8804_debug },
> - },
> -#endif
> -#if 0
> - [BOARD_PXI6115] = { /* .device_id = ????, */
> - .name = "pxi-6115",
> - .n_adchan = 4,
> - .ai_maxdata = 0x0fff,
> - .ai_fifo_depth = 8192,
> - .gainlkup = ai_gain_611x,
> - .ai_speed = 100,
> - .n_aochan = 2,
> - .ao_maxdata = 0xffff,
> - .ao_671x = 1,
> - .ao_fifo_depth = 2048,
> - .ao_speed = 250,
> - .reg_611x = 1,
> - /* XXX */
> - .caldac = { ad8804_debug, ad8804_debug, ad8804_debug },
> - },
> -#endif
> [BOARD_PCI6711] = {
> .name = "pci-6711",
> .n_aochan = 4,
> @@ -567,17 +530,6 @@ static const struct ni_board_struct ni_boards[] = {
> .reg_type = ni_reg_6711,
> .caldac = { ad8804_debug },
> },
> -#if 0
> - [BOARD_PXI6731] = { /* .device_id = ????, */
> - .name = "pxi-6731",
> - .n_aochan = 4,
> - .ao_maxdata = 0xffff,
> - .ao_fifo_depth = 8192,
> - .ao_range_table = &range_bipolar10,
> - .reg_type = ni_reg_6711,
> - .caldac = { ad8804_debug },
> - },
> -#endif
> [BOARD_PCI6733] = {
> .name = "pci-6733",
> .n_aochan = 8,
> --
> 2.25.1
>
>