lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 17 May 2021 10:44:50 +0100
From:   Ian Abbott <abbotti@....co.uk>
To:     Bixuan Cui <cuibixuan@...wei.com>, linux-kernel@...r.kernel.org
Cc:     hsweeten@...ionengravers.com, gregkh@...uxfoundation.org,
        grandmaster@...klimov.de
Subject: Re: [PATCH -next v2] staging: comedi: Remove unused variable ‘min_full_scale’ and function 'get_min_full_scales'

On 14/05/2021 09:52, Bixuan Cui wrote:
> The variable ‘min_full_scale’ and function 'get_min_full_scales' are
> not used, So delete them.
> 
> Signed-off-by: Bixuan Cui <cuibixuan@...wei.com>
> ---
> Changes from v2:
> * Delete function 'get_min_full_scales'
> 
>   drivers/comedi/drivers/jr3_pci.c | 15 ---------------
>   1 file changed, 15 deletions(-)
> 
> diff --git a/drivers/comedi/drivers/jr3_pci.c b/drivers/comedi/drivers/jr3_pci.c
> index 7a02c4fa3cda..f963080dd61f 100644
> --- a/drivers/comedi/drivers/jr3_pci.c
> +++ b/drivers/comedi/drivers/jr3_pci.c
> @@ -186,19 +186,6 @@ static void set_full_scales(struct jr3_sensor __iomem *sensor,
>   	set_s16(&sensor->command_word0, 0x0a00);
>   }
>   
> -static struct six_axis_t get_min_full_scales(struct jr3_sensor __iomem *sensor)
> -{
> -	struct six_axis_t result;
> -
> -	result.fx = get_s16(&sensor->min_full_scale.fx);
> -	result.fy = get_s16(&sensor->min_full_scale.fy);
> -	result.fz = get_s16(&sensor->min_full_scale.fz);
> -	result.mx = get_s16(&sensor->min_full_scale.mx);
> -	result.my = get_s16(&sensor->min_full_scale.my);
> -	result.mz = get_s16(&sensor->min_full_scale.mz);
> -	return result;
> -}
> -
>   static struct six_axis_t get_max_full_scales(struct jr3_sensor __iomem *sensor)
>   {
>   	struct six_axis_t result;
> @@ -504,10 +491,8 @@ jr3_pci_poll_subdevice(struct comedi_subdevice *s)
>   			result = poll_delay_min_max(20, 100);
>   		} else {
>   			/* Set full scale */
> -			struct six_axis_t min_full_scale;
>   			struct six_axis_t max_full_scale;
>   
> -			min_full_scale = get_min_full_scales(sensor);
>   			max_full_scale = get_max_full_scales(sensor);
>   			set_full_scales(sensor, max_full_scale);
>   
> 

I'm pretty sure this is OK.  The min_full_scale registers are just 
informational.  The driver used to print the values, but not since 
commit a1d16659538a ("staging: comedi: jr3_pci: remove noisy printk") so 
this code is now redundant.

Reviewed-by: Ian Abbott <abbotti@....co.uk>

-- 
-=( Ian Abbott <abbotti@....co.uk> || MEV Ltd. is a company  )=-
-=( registered in England & Wales.  Regd. number: 02862268.  )=-
-=( Regd. addr.: S11 & 12 Building 67, Europa Business Park, )=-
-=( Bird Hall Lane, STOCKPORT, SK3 0XA, UK. || www.mev.co.uk )=-

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ