mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bixuan Cui <cuibixuan@huawei.com>
Cc: linux-kernel@vger.kernel.org, abbotti@mev.co.uk,
	hsweeten@visionengravers.com, grandmaster@al2klimov.de
Subject: Re: [PATCH -next v2] staging: comedi: Remove unused variable ‘min_full_scale’ and function 'get_min_full_scales'
Date: Fri, 14 May 2021 09:52:13 +0200	[thread overview]
Message-ID: <YJ4sLVlncZoQkNJm@kroah.com> (raw)
In-Reply-To: <20210514085214.53941-1-cuibixuan@huawei.com>

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

  reply	other threads:[~2021-05-14  7:52 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-05-14  8:52 Bixuan Cui
2021-05-14  7:52 ` Greg KH [this message]
2021-05-14 11:16   ` Ian Abbott
2021-05-14 11:54     ` Greg KH
2021-05-17  9:44 ` Ian Abbott
2021-05-19  1:07   ` Bixuan Cui

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=YJ4sLVlncZoQkNJm@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=abbotti@mev.co.uk \
    --cc=cuibixuan@huawei.com \
    --cc=grandmaster@al2klimov.de \
    --cc=hsweeten@visionengravers.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®