From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_CR_TRAILER,INCLUDES_PATCH,MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9CCFAC433B4 for ; Fri, 14 May 2021 07:52:18 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 57DC261451 for ; Fri, 14 May 2021 07:52:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233274AbhENHx2 (ORCPT ); Fri, 14 May 2021 03:53:28 -0400 Received: from mail.kernel.org ([198.145.29.99]:38964 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232804AbhENHx1 (ORCPT ); Fri, 14 May 2021 03:53:27 -0400 Received: by mail.kernel.org (Postfix) with ESMTPSA id B072861446; Fri, 14 May 2021 07:52:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1620978736; bh=tauFPhaHs/I1wxs1340eEUTGjw6C403rcF9eVU4OHyQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=WzMC5erhqHrK8hDyW6hnZOXzX0EYS8KbCaNRFYqCXYPeRDvuC3qpaQ73EJBiUnpDa CcaL/TaX7oAst4BshEg1BpiK/KpXfcmD3Ba0IpvoBtuCIttUFGGfyCGrilr0fiTAdW aZ9O3LAO7bLys8IBOJQXeraunBOmktfe7gb1GklI= Date: Fri, 14 May 2021 09:52:13 +0200 From: Greg KH To: Bixuan Cui Cc: linux-kernel@vger.kernel.org, abbotti@mev.co.uk, hsweeten@visionengravers.com, grandmaster@al2klimov.de Subject: Re: [PATCH -next v2] staging: =?utf-8?Q?co?= =?utf-8?Q?medi=3A_Remove_unused_variable_=E2=80=98min=5Ffull=5Fscale?= =?utf-8?B?4oCZ?= and function 'get_min_full_scales' Message-ID: References: <20210514085214.53941-1-cuibixuan@huawei.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20210514085214.53941-1-cuibixuan@huawei.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > --- > 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