linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Rasmus Villemoes <linux@rasmusvillemoes.dk>
To: Willy Tarreau <w@1wt.eu>
Cc: "Paul E. McKenney" <paulmck@kernel.org>,
	linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] selftests/nolibc: add 7 tests for memcmp()
Date: Thu, 27 Oct 2022 11:09:55 +0200	[thread overview]
Message-ID: <0b8feeb2-6ec6-d2af-8aa7-0bf34e7ab4b2@rasmusvillemoes.dk> (raw)
In-Reply-To: <20221026195224.GA24197@1wt.eu>

On 26/10/2022 21.52, Willy Tarreau wrote:
> On Wed, Oct 26, 2022 at 11:08:41AM +0200, Rasmus Villemoes wrote:
>> On 26/10/2022 07.39, Willy Tarreau wrote:
>>>
>>> No more false positives nor false negatives anymore. I'm sending you
>>> the patch separately.
>>
>> While you're at it, may I suggest also adding a few test cases where the
>> buffers differ by 128, e.g. 0x0 v 0x80 and 0x40 v 0xc0.
> 
> I initially thought about it but changed my mind for +/- 0xc0 that
> covered the same cases in my opinion. Do you have a particular error
> case in mind that would be caught by this one that the other one does
> not catch ?

Not really, but in a sense the opposite: for the +/- 0xc0 case, both
ways of comparison will give the wrong sign because -192 becomes +64 and
vice versa. For +/- 0x80, one way of doing the comparison will
"accidentally" produce the right answer, and I thought that might also
be a little interesting.

I'm fine for proposing a respin of the patch to improve
> it if it brings some value,

It's your call, you can respin, do an incremental patch, or just ignore
me :)

Rasmus

  reply	other threads:[~2022-10-27  9:10 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-21  6:03 [PATCH] selftests/nolibc: add 7 tests for memcmp() Willy Tarreau
2022-10-21 15:56 ` Paul E. McKenney
2022-10-21 17:01   ` Willy Tarreau
2022-10-21 17:07     ` Paul E. McKenney
2022-10-21 17:20       ` Willy Tarreau
2022-10-21 18:00         ` Paul E. McKenney
2022-10-22 11:22           ` Willy Tarreau
2022-10-24 15:53             ` Paul E. McKenney
2022-10-26  5:39               ` Willy Tarreau
2022-10-26  9:08                 ` Rasmus Villemoes
2022-10-26 19:52                   ` Willy Tarreau
2022-10-27  9:09                     ` Rasmus Villemoes [this message]
2022-10-27 17:20                       ` Willy Tarreau
2022-10-26 13:57                 ` Paul E. McKenney
2022-10-26 14:17                   ` Willy Tarreau

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=0b8feeb2-6ec6-d2af-8aa7-0bf34e7ab4b2@rasmusvillemoes.dk \
    --to=linux@rasmusvillemoes.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=paulmck@kernel.org \
    --cc=w@1wt.eu \
    /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).