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:   Thu, 26 Oct 2017 15:48:52 +0200
From:   Alexandre Belloni <alexandre.belloni@...e-electrons.com>
To:     SF Markus Elfring <elfring@...rs.sourceforge.net>
Cc:     linux-iio@...r.kernel.org, Andreas Dannenberg <dannenberg@...com>,
        Felipe Balbi <balbi@...com>, Hartmut Knaack <knaack.h@....de>,
        Javier Martinez Canillas <javier@....samsung.com>,
        Jonathan Cameron <jic23@...nel.org>,
        Lars-Peter Clausen <lars@...afoo.de>,
        Peter Meerwald-Stadler <pmeerw@...erw.net>,
        LKML <linux-kernel@...r.kernel.org>,
        kernel-janitors@...r.kernel.org
Subject: Re: [PATCH] iio/light/opt3001: Use common error handling code in
 opt3001_get_lux()

On 26/10/2017 at 14:17:30 +0200, SF Markus Elfring wrote:
> From: Markus Elfring <elfring@...rs.sourceforge.net>
> Date: Thu, 26 Oct 2017 14:06:49 +0200
> 
> * Add jump targets so that two error messages are stored only once
>   at the end of this function implementation.
> 
> * Adjust condition checks.
> 
> * Replace string literals by references to two global constant variables
>   in eight functions.
> 
> This issue was detected by using the Coccinelle software.
> 
> Signed-off-by: Markus Elfring <elfring@...rs.sourceforge.net>
> ---
>  drivers/iio/light/opt3001.c | 88 +++++++++++++++++++--------------------------
>  1 file changed, 36 insertions(+), 52 deletions(-)
> 
> diff --git a/drivers/iio/light/opt3001.c b/drivers/iio/light/opt3001.c
> index 54d88b60e303..23d7d4e6ae61 100644
> --- a/drivers/iio/light/opt3001.c
> +++ b/drivers/iio/light/opt3001.c
> @@ -77,6 +77,9 @@
>  #define OPT3001_RESULT_READY_SHORT	150
>  #define OPT3001_RESULT_READY_LONG	1000
>  
> +static char const read_failure[] = "failed to read register %02x\n";
> +static char const write_failure[] = "failed to write register %02x\n";
> +

If you are going to do that, why don't you use only one string: "failed
to %s register %02x\n"?


-- 
Alexandre Belloni, Free Electrons
Embedded Linux and Kernel engineering
http://free-electrons.com

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ