lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 29 Nov 2019 14:02:37 -0800
From:   Guenter Roeck <groeck@...gle.com>
To:     Enric Balletbo i Serra <enric.balletbo@...labora.com>
Cc:     linux-kernel <linux-kernel@...r.kernel.org>,
        Collabora Kernel ML <kernel@...labora.com>,
        Guenter Roeck <groeck@...omium.org>,
        Benson Leung <bleung@...omium.org>,
        Dmitry Torokhov <dtor@...omium.org>, fparent@...libre.com,
        Linux PM list <linux-pm@...r.kernel.org>,
        Sebastian Reichel <sre@...nel.org>
Subject: Re: [PATCH] power: supply: cros_usbpd: Remove dev_err() getting the
 number of ports

On Fri, Nov 29, 2019 at 1:59 PM Enric Balletbo i Serra
<enric.balletbo@...labora.com> wrote:
>
> When a device has no support to get the charger number of ports, it
> doesn't have to result in a dev_err(), print saying "Could not get
> charger port count" using a dev_info() would suffice. In such case,
> the dev_info() message is already printed but the dev_err() is annoying,
> specially, on those devices that doesn't support the command. So remove
> the dev_err().
>
> Signed-off-by: Enric Balletbo i Serra <enric.balletbo@...labora.com>

Reviewed-by: Guenter Roeck <groeck@...omium.org>

> ---
>
>  drivers/power/supply/cros_usbpd-charger.c | 10 ++--------
>  1 file changed, 2 insertions(+), 8 deletions(-)
>
> diff --git a/drivers/power/supply/cros_usbpd-charger.c b/drivers/power/supply/cros_usbpd-charger.c
> index 6cc7c3910e09..ffad9ee03a68 100644
> --- a/drivers/power/supply/cros_usbpd-charger.c
> +++ b/drivers/power/supply/cros_usbpd-charger.c
> @@ -132,11 +132,8 @@ static int cros_usbpd_charger_get_num_ports(struct charger_data *charger)
>         ret = cros_usbpd_charger_ec_command(charger, 0,
>                                             EC_CMD_CHARGE_PORT_COUNT,
>                                             NULL, 0, &resp, sizeof(resp));
> -       if (ret < 0) {
> -               dev_err(charger->dev,
> -                       "Unable to get the number of ports (err:0x%x)\n", ret);
> +       if (ret < 0)
>                 return ret;
> -       }
>
>         return resp.port_count;
>  }
> @@ -148,11 +145,8 @@ static int cros_usbpd_charger_get_usbpd_num_ports(struct charger_data *charger)
>
>         ret = cros_usbpd_charger_ec_command(charger, 0, EC_CMD_USB_PD_PORTS,
>                                             NULL, 0, &resp, sizeof(resp));
> -       if (ret < 0) {
> -               dev_err(charger->dev,
> -                       "Unable to get the number or ports (err:0x%x)\n", ret);
> +       if (ret < 0)
>                 return ret;
> -       }
>
>         return resp.num_ports;
>  }
> --
> 2.20.1
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ