linux-i2c.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Wolfram Sang <wsa@kernel.org>
To: Jean Delvare <jdelvare@suse.de>
Cc: Linux I2C <linux-i2c@vger.kernel.org>,
	David Jedynak <sileasresearch@gmail.com>
Subject: Re: [PATCH] i2cset: Fix short writes with mask
Date: Tue, 8 Sep 2020 08:51:11 +0200	[thread overview]
Message-ID: <20200908065111.GA5936@ninjato> (raw)
In-Reply-To: <20200903110054.52a3a69f@endymion>

[-- Attachment #1: Type: text/plain, Size: 950 bytes --]

On Thu, Sep 03, 2020 at 11:00:54AM +0200, Jean Delvare wrote:
> Short writes used "daddress" for the value, but the masking code did
> not expect that, and instead applied the mask to a variable that was
> never used.
> 
> So change short writes to use "value" for the value, as all other
> commands do. Adjust all code paths accordingly.
> 
> Reported by David Jedynak.
> 
> Signed-off-by: Jean Delvare <jdelvare@suse.de>

Reviewed-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Tested-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Passed my test as well. One question:

> @@ -140,7 +140,7 @@ static int confirm(const char *filename,
>  	} else
>  		fprintf(stderr, "data 0x%02x%s, mode %s.\n", value,
>  			vmask ? " (masked)" : "",
> -			size == I2C_SMBUS_BYTE_DATA ? "byte" : "word");
> +			size == I2C_SMBUS_WORD_DATA ? "word" : "byte");

Does this really change something or is it a refactoring leftover?


[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2020-09-08  6:51 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-03  9:00 [PATCH] i2cset: Fix short writes with mask Jean Delvare
2020-09-08  6:51 ` Wolfram Sang [this message]
2020-09-08 15:19   ` Jean Delvare
2020-09-08 15:40     ` Wolfram Sang
2020-09-08 21:08       ` Jean Delvare

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200908065111.GA5936@ninjato \
    --to=wsa@kernel.org \
    --cc=jdelvare@suse.de \
    --cc=linux-i2c@vger.kernel.org \
    --cc=sileasresearch@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).