2018-08-29 14:52:38

by Colin King

[permalink] [raw]
Subject: [PATCH][V2] power: supply: cros_usbpd: remove unused pointer 'dev'

From: Colin Ian King <[email protected]>

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 <[email protected]>
---

V2: change subject to include 'cros_usbpd' and also send to Sameer.

---
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



2018-08-29 22:36:24

by Sebastian Reichel

[permalink] [raw]
Subject: Re: [PATCH][V2] power: supply: cros_usbpd: remove unused pointer 'dev'

Hi,

On Wed, Aug 29, 2018 at 03:51:06PM +0100, Colin King wrote:
> From: Colin Ian King <[email protected]>
>
> 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 <[email protected]>
> ---
>
> V2: change subject to include 'cros_usbpd' and also send to Sameer.
>
> ---

Thanks, queued with 'Reviewed-by: Krzysztof Kozlowski <[email protected]>'
Please don't forget to carrier over previously received Rb Tags!

-- Sebastian

> 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
>


Attachments:
(No filename) (1.43 kB)
signature.asc (849.00 B)
Download all attachments