From: Deepak R Varma <drv@mailo.com>
To: Julia Lawall <julia.lawall@inria.fr>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: outreachy@lists.linux.dev, dri-devel@lists.freedesktop.org,
linux-fbdev@vger.kernel.org, linux-staging@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
Date: Fri, 4 Nov 2022 17:31:24 +0530 [thread overview]
Message-ID: <Y2T/FA0Ws9ExS+uz@qemulion> (raw)
In-Reply-To: <7dc9b4d2-413-3f65-1381-b164d810c3ee@inria.fr>
[-- Attachment #1: Type: text/plain, Size: 819 bytes --]
On Mon, Oct 31, 2022 at 01:05:32PM +0100, Julia Lawall wrote:
>
>
> I took a look, but it's pretty complex. You could take the code and
> reorganize it so that it is more readable, and then take the definition of
> the ARRAY_SIZE macro, to better see what is going on.
>
> julia
>
Hello Greg, Julia,
I was able to successfully build the fbtft object file for arm architecture as
well. I used gcc 6.5.0 and 9.5.0 tool chains. It was successful using both. I
have attached the build log from my machine for your reference.
I am also looking at the .i file and rearrange the expanded macro to understand
it. However, since it is built successfully, I am not sure if that is truly the
problem area.
Should I resend the patch and check if it still errors the kernel build bot?
Anything else I can try?
Thank you,
./drv
[-- Attachment #2: fbtft_build.log --]
[-- Type: text/plain, Size: 3034 bytes --]
drv@qemulion:~/git/kernels/staging$ git status
On branch patches-11022022
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git restore <file>..." to discard changes in working directory)
modified: drivers/staging/fbtft/fbtft.h
no changes added to commit (use "git add" and/or "git commit -a")
drv@qemulion:~/git/kernels/staging$ git diff
diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 2c2b5f1c1df3..f2ed23123849 100644
--- a/drivers/staging/fbtft/fbtft.h
+++ b/drivers/staging/fbtft/fbtft.h
@@ -231,7 +231,7 @@ struct fbtft_par {
bool polarity;
};
-#define NUMARGS(...) (sizeof((int[]){__VA_ARGS__}) / sizeof(int))
+#define NUMARGS(...) ARRAY_SIZE(((int[]){ __VA_ARGS__ }))
#define write_reg(par, ...) \
((par)->fbtftops.write_register(par, NUMARGS(__VA_ARGS__), __VA_ARGS__))
drv@qemulion:~/git/kernels/staging$ make CROSS_COMPILE=/opt/gcc-9.5.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- --jobs=8 ARCH=arm drivers/staging/fbtft/fbtft-core.o
CALL scripts/checksyscalls.sh
CC drivers/staging/fbtft/fbtft-core.o
drv@qemulion:~/git/kernels/staging$ make CROSS_COMPILE=/opt/gcc-9.5.0-nolibc/arm-linux-gnueabi/bin/arm-linux-gnueabi- --jobs=8 ARCH=arm drivers/staging/fbtft/
CALL scripts/checksyscalls.sh
CC drivers/staging/fbtft/fbtft-sysfs.o
CC drivers/staging/fbtft/fbtft-bus.o
CC drivers/staging/fbtft/fbtft-io.o
CC drivers/staging/fbtft/fb_agm1264k-fl.o
CC drivers/staging/fbtft/fb_bd663474.o
CC drivers/staging/fbtft/fb_hx8340bn.o
CC drivers/staging/fbtft/fb_hx8347d.o
CC drivers/staging/fbtft/fb_hx8353d.o
CC drivers/staging/fbtft/fb_hx8357d.o
CC drivers/staging/fbtft/fb_ili9163.o
CC drivers/staging/fbtft/fb_ili9320.o
CC drivers/staging/fbtft/fb_ili9325.o
CC drivers/staging/fbtft/fb_ili9340.o
CC drivers/staging/fbtft/fb_ili9341.o
CC drivers/staging/fbtft/fb_ili9481.o
CC drivers/staging/fbtft/fb_ili9486.o
CC drivers/staging/fbtft/fb_pcd8544.o
CC drivers/staging/fbtft/fb_ra8875.o
CC drivers/staging/fbtft/fb_s6d02a1.o
CC drivers/staging/fbtft/fb_s6d1121.o
CC drivers/staging/fbtft/fb_seps525.o
CC drivers/staging/fbtft/fb_sh1106.o
CC drivers/staging/fbtft/fb_ssd1289.o
CC drivers/staging/fbtft/fb_ssd1305.o
CC drivers/staging/fbtft/fb_ssd1306.o
CC drivers/staging/fbtft/fb_ssd1325.o
CC drivers/staging/fbtft/fb_ssd1331.o
CC drivers/staging/fbtft/fb_ssd1351.o
CC drivers/staging/fbtft/fb_st7735r.o
CC drivers/staging/fbtft/fb_st7789v.o
CC drivers/staging/fbtft/fb_tinylcd.o
CC drivers/staging/fbtft/fb_tls8204.o
CC drivers/staging/fbtft/fb_uc1611.o
CC drivers/staging/fbtft/fb_uc1701.o
CC drivers/staging/fbtft/fb_upd161704.o
AR drivers/staging/fbtft/built-in.a
drv@qemulion:~/git/kernels/staging$
next prev parent reply other threads:[~2022-11-04 12:02 UTC|newest]
Thread overview: 12+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-10-28 13:30 [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count Deepak R Varma
2022-10-29 7:32 ` Greg Kroah-Hartman
2022-10-29 16:58 ` Deepak R Varma
2022-10-29 17:34 ` Julia Lawall
2022-10-31 7:11 ` Deepak R Varma
2022-10-31 9:40 ` Deepak R Varma
2022-10-31 9:41 ` Deepak R Varma
2022-10-31 12:05 ` Julia Lawall
2022-11-04 12:01 ` Deepak R Varma [this message]
2022-11-04 14:42 ` Deepak R Varma
2022-11-09 15:00 ` Deepak R Varma
2022-11-09 16:00 ` Greg Kroah-Hartman
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=Y2T/FA0Ws9ExS+uz@qemulion \
--to=drv@mailo.com \
--cc=dri-devel@lists.freedesktop.org \
--cc=gregkh@linuxfoundation.org \
--cc=julia.lawall@inria.fr \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy@lists.linux.dev \
/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).