All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: Dan Carpenter <dan.carpenter@linaro.org>,
	Anatolij Gustschin <agust@denx.de>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] video: Add parentheses around VNBYTES() macro
Date: Tue, 19 Sep 2023 11:14:56 -0400	[thread overview]
Message-ID: <20230919151456.GL305624@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ3cooZZGKryY5UwBpd7O2kL5W1z++QxQf-Z304eaKvzUg@mail.gmail.com>

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

On Mon, Sep 18, 2023 at 07:04:41PM -0600, Simon Glass wrote:
> Hi Tom, Dan,
> 
> On Tue, 8 Aug 2023 at 19:39, Tom Rini <trini@konsulko.com> wrote:
> >
> > On Wed, Jul 26, 2023 at 09:54:08AM +0300, Dan Carpenter wrote:
> >
> > > The VNBYTES() macro needs to have parentheses to prevent some (harmless)
> > > macro expansion bugs.  The VNBYTES() macro is used like this:
> > >
> > >       VID_TO_PIXEL(x) * VNBYTES(vid_priv->bpix)
> > >
> > > The * operation is done before the / operation.  It still ends up with
> > > the same results, but it's not ideal.
> > >
> > > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> >
> > In that this seems correct:
> >
> > Applied to u-boot/next, thanks!
> >
> > But I want to note that with gcc-13.1 (and binutils 2.40) or more
> > specifically the kernel.org arm/aarch64/etc toolchains, this causes the
> > generated code to change:
> >    aarch64: (for 1/1 boards) all +8.0 text +8.0
> >             bananapi-m5    : all +8 text +8
> >                u-boot: add: 0/0, grow: 1/0 bytes: 8/0 (8)
> >                  function                                   old     new   delta
> >                  video_post_probe                           248     256      +8
> >
> > So I don't know that this was a harmless bug.
> 
> Hmm I should have read the comment directly above...
> 
> "Note we omit the outer brackets to allow multiplication by fractional pixels."
> 
> Having said that, it doesn't seem to matter getting (if indeed we do)
> a less accurate result.

But we should fix the comment then, or decide no, this is intentional.

-- 
Tom

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

  reply	other threads:[~2023-09-19 15:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-07-26  6:54 [PATCH] video: Add parentheses around VNBYTES() macro Dan Carpenter
2023-07-27  0:49 ` Simon Glass
2023-08-09  1:39 ` Tom Rini
2023-09-19  1:04   ` Simon Glass
2023-09-19 15:14     ` Tom Rini [this message]
2024-09-02  8:17       ` Miquel Raynal
2024-09-06 18:34         ` Tom Rini

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=20230919151456.GL305624@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=agust@denx.de \
    --cc=dan.carpenter@linaro.org \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.