From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755435AbeARTWf (ORCPT ); Thu, 18 Jan 2018 14:22:35 -0500 Received: from mail-io0-f195.google.com ([209.85.223.195]:34613 "EHLO mail-io0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754913AbeARTW3 (ORCPT ); Thu, 18 Jan 2018 14:22:29 -0500 X-Google-Smtp-Source: ACJfBos5qVQlF80VW7doHz6SPMhDNmroiJ7w2Fo/9fFq1yXzAwzxrHHtQFloDSfQkoj546gVCerRPA== Date: Thu, 18 Jan 2018 11:22:25 -0800 From: Dmitry Torokhov To: Colin King Cc: Guenter Roeck , linux-input@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] input: cyapa: remove redundant assignment to 'pwr_cmd' Message-ID: <20180118192225.n6scc424psan7iwn@dtor-ws> References: <20180117104519.19422-1-colin.king@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180117104519.19422-1-colin.king@canonical.com> User-Agent: NeoMutt/20170609 (1.8.3) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jan 17, 2018 at 10:45:19AM +0000, Colin King wrote: > From: Colin Ian King > > The variable pwr_cmd is being assigned to cyapa->suspend_power_mode > twice, once during the declaration and once after taking an > interruptible mutex lock. Remove the redundant first assignment > since the value is never read and it is outside the mutex lock. > > Cleans up clang warning: > drivers/input/mouse/cyapa.c:743:5: warning: Value stored to 'pwr_cmd' > during its initialization is never read > > Signed-off-by: Colin Ian King Applied, thank you. > --- > drivers/input/mouse/cyapa.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/input/mouse/cyapa.c b/drivers/input/mouse/cyapa.c > index fd8865c65caf..dfd3873513e4 100644 > --- a/drivers/input/mouse/cyapa.c > +++ b/drivers/input/mouse/cyapa.c > @@ -740,7 +740,7 @@ static ssize_t cyapa_show_suspend_scanrate(struct device *dev, > char *buf) > { > struct cyapa *cyapa = dev_get_drvdata(dev); > - u8 pwr_cmd = cyapa->suspend_power_mode; > + u8 pwr_cmd; > u16 sleep_time; > int len; > int error; > -- > 2.15.1 > -- Dmitry