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:   Tue, 19 Nov 2019 09:33:02 +0000
From:   Peter Rosin <peda@...ntia.se>
To:     Lei YU <mine260309@...il.com>, Wolfram Sang <wsa@...-dreams.de>,
        "linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] docs: i2c: Fix return value of i2c_smbus_xxx functions

On 2019-11-19 09:56, Lei YU wrote:
> In i2c/dev-interface.rst it said
> 
>> All these transactions return -1 on failure
> 
> But actually the i2c_smbus_xxx functions return negative error numbers
> on failure, instead of -1.
> 
> Fix the document.
> 
> Signed-off-by: Lei YU <mine260309@...il.com>
> ---
>  Documentation/i2c/dev-interface.rst | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/Documentation/i2c/dev-interface.rst b/Documentation/i2c/dev-interface.rst
> index 69c23a3..73b77c3 100644
> --- a/Documentation/i2c/dev-interface.rst
> +++ b/Documentation/i2c/dev-interface.rst
> @@ -163,8 +163,8 @@ for details) through the following functions::
>    __s32 i2c_smbus_write_block_data(int file, __u8 command, __u8 length,
>                                     __u8 *values);
>  
> -All these transactions return -1 on failure; you can read errno to see
> -what happened. The 'write' transactions return 0 on success; the
> +All these transactions return negative value on failure; you can read errno to
> +see what happened. The 'write' transactions return 0 on success; the

s/return negative/return a negative/

And the line is now too long compared to the rest of the text, so you
need to rewrap the paragraph.

And why do you need to dig around in errno if the negative errno has
already been returned?

>  'read' transactions return the read value, except for read_block, which
>  returns the number of values read. The block buffers need not be longer
>  than 32 bytes.
> 

Hmm, unrelated, but should that perhaps be "must not" instead of "need not"?

Cheers,
Peter

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ