mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Mark Brown <broonie@kernel.org>
To: Guenter Roeck <linux@roeck-us.net>
Cc: linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] regmap: kunit: Ensure that changed bytes are actually different
Date: Fri, 9 Feb 2024 22:39:09 +0000	[thread overview]
Message-ID: <ZcapjWTuggJNdV/o@finisterre.sirena.org.uk> (raw)
In-Reply-To: <7d077da1-e792-4570-914e-5c26de420c43@roeck-us.net>

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

On Fri, Feb 09, 2024 at 02:07:38PM -0800, Guenter Roeck wrote:

> This is actually worse than v1 because hw_buf[6] isn't used anywhere.
> Making sure that the values in the val[] array don't match the values
> in hw_buf[6..7] doesn't add any value.

Yeah, I realised after reading your earlier mail.  It's passing for me
somehow.

> FWIW, I had struggled with the re-use of val[0] for two different tests
> (on hw_buf[2] and hw_buf[4]) myself. The only solution other than making sure
> that it neither matches hw_buf[2] nor hw_buf[4] I came up with was to use a
> separate variable for the accesses to hw_buf[4] (or hw_buf[6] in the old code).
Indeed, it was fine with the old code due to not caring about having
different values but we need to generate three values now.

>         get_changed_bytes(&hw_buf[6], &val[0], sizeof(val));
> +       // Let's cheat.
> +       // Remember, the above code doesn't look into hw_buf[2..5],
> +       // so anything might be in there, including the values from
> +       // the val[] array.
> +       hw_buf[2] = val[0];
> +       hw_buf[3] = val[1];
> +       hw_buf[4] = val[0];
> +       hw_buf[5] = val[1];

I don't understand how this interacts with the pre-sync check?

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

  reply	other threads:[~2024-02-09 22:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-09 21:33 Mark Brown
2024-02-09 22:07 ` Guenter Roeck
2024-02-09 22:39   ` Mark Brown [this message]
2024-02-09 23:20     ` Guenter Roeck
2024-02-10 12:44       ` Mark Brown

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=ZcapjWTuggJNdV/o@finisterre.sirena.org.uk \
    --to=broonie@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    /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

all inboxes | Powered by JetHome®