[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAFd5g47imcBAPNqrX+ZpmVzw8mgaPiBX_ip0euFAgmTA3cxitA@mail.gmail.com>
Date: Fri, 28 Jan 2022 16:21:13 -0500
From: Brendan Higgins <brendanhiggins@...gle.com>
To: Daniel Latypov <dlatypov@...gle.com>
Cc: davidgow@...gle.com, linux-kernel@...r.kernel.org,
kunit-dev@...glegroups.com, linux-kselftest@...r.kernel.org,
skhan@...uxfoundation.org
Subject: Re: [PATCH] kunit: cleanup assertion macro internal variables
On Thu, Jan 27, 2022 at 4:52 PM Daniel Latypov <dlatypov@...gle.com> wrote:
>
> All the operands should be tagged `const`.
> We're only assigning them to variables so that we can compare them (e.g.
> check if left == right, etc.) and avoid evaluating expressions multiple
> times.
>
> There's no need for them to be mutable.
Agreed.
> Also rename the helper variable `loc` to `__loc` like we do with
> `__assertion` and `__strs` to avoid potential name collisions with user
> code.
Probably not necessary since we create a new code block (we are inside
of an if-statement, do-while-loop, etc), but I don't really care
either way.
> Signed-off-by: Daniel Latypov <dlatypov@...gle.com>
Reviewed-by: Brendan Higgins <brendanhiggins@...gle.com>
Powered by blists - more mailing lists