All of lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Dan Carpenter <dan.carpenter@linaro.org>
Cc: Anatolij Gustschin <agust@denx.de>,
	Simon Glass <sjg@chromium.org>,
	u-boot@lists.denx.de
Subject: Re: [PATCH] video: Add parentheses around VNBYTES() macro
Date: Tue, 8 Aug 2023 21:39:30 -0400	[thread overview]
Message-ID: <20230809013930.GR3630934@bill-the-cat> (raw)
In-Reply-To: <1628fc37-2c9f-493d-82c2-9bf225f2645a@moroto.mountain>

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

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.

-- 
Tom

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

  parent reply	other threads:[~2023-08-09  1:39 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 [this message]
2023-09-19  1:04   ` Simon Glass
2023-09-19 15:14     ` Tom Rini
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=20230809013930.GR3630934@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.