lkml.org 
[lkml]   [2021]   [May]   [14]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH -next v2] staging: co medi: Remove unused variable ‘min full scale ’ and function 'get_min_full_scales'
On Fri, May 14, 2021 at 04:52:14PM +0800, 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@huawei.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;

Are you _SURE_ that this is ok to do? You are reading from the
hardware, and that is sometimes required depending on the
internal-to-the-device state machine.

Have you tested to verify that not doing these reads does not break
something?

This is a constant theme in these "remove variables that are not being
used" patches, please be aware that how hardware works is very specific
and when you mess with how it is accessed, that has the chance of
causing problems.

thanks,

greg k-h

\
 
 \ /
  Last update: 2021-05-14 09:53    [W:0.073 / U:0.856 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site