linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] power: supply: remove unused pointer 'dev'
@ 2018-08-28 16:28 Colin King
  2018-08-29 13:54 ` Krzysztof Kozlowski
  0 siblings, 1 reply; 3+ messages in thread
From: Colin King @ 2018-08-28 16:28 UTC (permalink / raw)
  To: Sebastian Reichel, linux-pm; +Cc: kernel-janitors, linux-kernel

From: Colin Ian King <colin.king@canonical.com>

Pointer 'dev' is being assigned but is never used hence it is
redundant and can be removed.

Cleans up clang warning:
variable 'dev' set but not used [-Wunused-but-set-variable]

Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 drivers/power/supply/cros_usbpd-charger.c | 2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
index 688a16bacfbb..f2b8de502b82 100644
--- a/drivers/power/supply/cros_usbpd-charger.c
+++ b/drivers/power/supply/cros_usbpd-charger.c
@@ -378,12 +378,10 @@ static int cros_usbpd_charger_ec_event(struct notifier_block *nb,
 {
 	struct cros_ec_device *ec_device;
 	struct charger_data *charger;
-	struct device *dev;
 	u32 host_event;
 
 	charger = container_of(nb, struct charger_data, notifier);
 	ec_device = charger->ec_device;
-	dev = charger->dev;
 
 	host_event = cros_ec_get_host_event(ec_device);
 	if (host_event & EC_HOST_EVENT_MASK(EC_HOST_EVENT_PD_MCU)) {
-- 
2.17.1


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: remove unused pointer 'dev'
  2018-08-28 16:28 [PATCH] power: supply: remove unused pointer 'dev' Colin King
@ 2018-08-29 13:54 ` Krzysztof Kozlowski
  2018-08-29 14:15   ` Dan Carpenter
  0 siblings, 1 reply; 3+ messages in thread
From: Krzysztof Kozlowski @ 2018-08-29 13:54 UTC (permalink / raw)
  To: colin.king; +Cc: sre, linux-pm, kernel-janitors, linux-kernel

On Tue, 28 Aug 2018 at 18:29, Colin King <colin.king@canonical.com> wrote:
>
> From: Colin Ian King <colin.king@canonical.com>
>
> Pointer 'dev' is being assigned but is never used hence it is
> redundant and can be removed.
>
> Cleans up clang warning:
> variable 'dev' set but not used [-Wunused-but-set-variable]
>
> Signed-off-by: Colin Ian King <colin.king@canonical.com>
> ---
>  drivers/power/supply/cros_usbpd-charger.c | 2 --
>  1 file changed, 2 deletions(-)
>

Maybe add cros_usbpd prefix to the subject?

Anyway:
Reviewed-by: Krzysztof Kozlowski <krzk@kernel.org>

Best regards,
Krzysztof

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] power: supply: remove unused pointer 'dev'
  2018-08-29 13:54 ` Krzysztof Kozlowski
@ 2018-08-29 14:15   ` Dan Carpenter
  0 siblings, 0 replies; 3+ messages in thread
From: Dan Carpenter @ 2018-08-29 14:15 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Sameer Nanda
  Cc: colin.king, sre, linux-pm, kernel-janitors, linux-kernel

On Wed, Aug 29, 2018 at 03:54:13PM +0200, Krzysztof Kozlowski wrote:
> On Tue, 28 Aug 2018 at 18:29, Colin King <colin.king@canonical.com> wrote:
> >
> > From: Colin Ian King <colin.king@canonical.com>
> >
> > Pointer 'dev' is being assigned but is never used hence it is
> > redundant and can be removed.
> >
> > Cleans up clang warning:
> > variable 'dev' set but not used [-Wunused-but-set-variable]
> >
> > Signed-off-by: Colin Ian King <colin.king@canonical.com>
> > ---
> >  drivers/power/supply/cros_usbpd-charger.c | 2 --
> >  1 file changed, 2 deletions(-)
> >
> 
> Maybe add cros_usbpd prefix to the subject?
> 

Yeah.

The problem is that the prefix wasn't added to the subject in the
original commit f68b883e8fad ("power: supply: add cros-ec USBPD charger
driver.") which added the driver.  It's a common problem.  Normally what
happens is that someone adds a driver and then random static checker
people like Colin or I send the first fixes and we have no idea what the
correct prefix should be.  Anyway, checking the prefix is one of the
things we should look for when people add a new driver.

Also Colin you should CC Sameer because it's really his code.  Someone
should fix get_maintainer.pl so that it does git blame on the
lines before and after and adds people if the code is less than two
years old maybe.

regards,
dan carpenter


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-08-29 14:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-08-28 16:28 [PATCH] power: supply: remove unused pointer 'dev' Colin King
2018-08-29 13:54 ` Krzysztof Kozlowski
2018-08-29 14:15   ` Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).