Linux-fbdev Archive mirror
 help / color / mirror / Atom feed
* [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
@ 2022-10-28 13:30 Deepak R Varma
  2022-10-29  7:32 ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-10-28 13:30 UTC (permalink / raw)
  To: outreachy, Greg Kroah-Hartman, dri-devel, linux-fbdev,
	linux-staging, linux-kernel

The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
based computation such as sizeof(foo)/sizeof(foo[0]) for finding
number of elements in an array. Issue identified using coccicheck.

Signed-off-by: Deepak R Varma <drv@mailo.com>
---
 drivers/staging/fbtft/fbtft.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 2c2b5f1c1df3..5506a473be91 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__))
--
2.34.1




^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  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
  0 siblings, 1 reply; 12+ messages in thread
From: Greg Kroah-Hartman @ 2022-10-29  7:32 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: outreachy, dri-devel, linux-fbdev, linux-staging, linux-kernel

On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> number of elements in an array. Issue identified using coccicheck.
> 
> Signed-off-by: Deepak R Varma <drv@mailo.com>
> ---
>  drivers/staging/fbtft/fbtft.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> index 2c2b5f1c1df3..5506a473be91 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__ }))

Please please please test-build your patches before sending them out.
To not do so just wastes reviewer resources :(

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-10-29  7:32 ` Greg Kroah-Hartman
@ 2022-10-29 16:58   ` Deepak R Varma
  2022-10-29 17:34     ` Julia Lawall
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-10-29 16:58 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: outreachy, dri-devel, linux-fbdev, linux-staging, linux-kernel

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

On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > number of elements in an array. Issue identified using coccicheck.
> >
> > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > ---
> >  drivers/staging/fbtft/fbtft.h | 2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > index 2c2b5f1c1df3..5506a473be91 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__ }))
>
> Please please please test-build your patches before sending them out.
> To not do so just wastes reviewer resources :(

Hello Greg,
I did build the .ko files by making the driver/staging/fbtft/ path. I verified
.o and .ko files were built.

I did a make clean just now and was again able to rebuild without any errors.
Please see the attached log file.

Is there something wrong with the way I am firing the build?

Thank you,
./drv

>
> thanks,
>
> greg k-h

[-- Attachment #2: fbtft_build.log --]
[-- Type: text/plain, Size: 10909 bytes --]

drv@ubunlion:~/git/kernels/staging$ git show HEAD
commit d7f07b9179428a4b84bcb7a90574edcea8c37fc4 (HEAD -> cocci-patches)
Author: Deepak R Varma <drv@mailo.com>
Date:   Fri Oct 28 18:40:54 2022 +0530

    staging: fbtft: Use ARRAY_SIZE() to get argument count

    The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
    based computation such as sizeof(foo)/sizeof(foo[0]) for finding
    number of elements in an array. Issue identified using coccicheck.

    Signed-off-by: Deepak R Varma <drv@mailo.com>

diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
index 2c2b5f1c1df3..5506a473be91 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@ubunlion:~/git/kernels/staging$ make M=drivers/staging/fbtft/
drv@ubunlion:~/git/kernels/staging$ make M=drivers/staging/fbtft/ clean
  CLEAN   drivers/staging/fbtft/Module.symvers
drv@ubunlion:~/git/kernels/staging$ make M=drivers/staging/fbtft/
  CC [M]  drivers/staging/fbtft/fbtft-core.o
  CC [M]  drivers/staging/fbtft/fbtft-sysfs.o
  CC [M]  drivers/staging/fbtft/fbtft-bus.o
  CC [M]  drivers/staging/fbtft/fbtft-io.o
  LD [M]  drivers/staging/fbtft/fbtft.o
  CC [M]  drivers/staging/fbtft/fb_agm1264k-fl.o
  CC [M]  drivers/staging/fbtft/fb_bd663474.o
  CC [M]  drivers/staging/fbtft/fb_hx8340bn.o
  CC [M]  drivers/staging/fbtft/fb_hx8347d.o
  CC [M]  drivers/staging/fbtft/fb_hx8353d.o
  CC [M]  drivers/staging/fbtft/fb_hx8357d.o
  CC [M]  drivers/staging/fbtft/fb_ili9163.o
  CC [M]  drivers/staging/fbtft/fb_ili9320.o
  CC [M]  drivers/staging/fbtft/fb_ili9325.o
  CC [M]  drivers/staging/fbtft/fb_ili9340.o
  CC [M]  drivers/staging/fbtft/fb_ili9341.o
  CC [M]  drivers/staging/fbtft/fb_ili9481.o
  CC [M]  drivers/staging/fbtft/fb_ili9486.o
  CC [M]  drivers/staging/fbtft/fb_pcd8544.o
  CC [M]  drivers/staging/fbtft/fb_ra8875.o
  CC [M]  drivers/staging/fbtft/fb_s6d02a1.o
  CC [M]  drivers/staging/fbtft/fb_s6d1121.o
  CC [M]  drivers/staging/fbtft/fb_seps525.o
  CC [M]  drivers/staging/fbtft/fb_sh1106.o
  CC [M]  drivers/staging/fbtft/fb_ssd1289.o
  CC [M]  drivers/staging/fbtft/fb_ssd1305.o
  CC [M]  drivers/staging/fbtft/fb_ssd1306.o
  CC [M]  drivers/staging/fbtft/fb_ssd1325.o
  CC [M]  drivers/staging/fbtft/fb_ssd1331.o
  CC [M]  drivers/staging/fbtft/fb_ssd1351.o
  CC [M]  drivers/staging/fbtft/fb_st7735r.o
  CC [M]  drivers/staging/fbtft/fb_st7789v.o
  CC [M]  drivers/staging/fbtft/fb_tinylcd.o
  CC [M]  drivers/staging/fbtft/fb_tls8204.o
  CC [M]  drivers/staging/fbtft/fb_uc1611.o
  CC [M]  drivers/staging/fbtft/fb_uc1701.o
  CC [M]  drivers/staging/fbtft/fb_upd161704.o
  MODPOST drivers/staging/fbtft/Module.symvers
  CC [M]  drivers/staging/fbtft/fb_agm1264k-fl.mod.o
  LD [M]  drivers/staging/fbtft/fb_agm1264k-fl.ko
  BTF [M] drivers/staging/fbtft/fb_agm1264k-fl.ko
Skipping BTF generation for drivers/staging/fbtft/fb_agm1264k-fl.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_bd663474.mod.o
  LD [M]  drivers/staging/fbtft/fb_bd663474.ko
  BTF [M] drivers/staging/fbtft/fb_bd663474.ko
Skipping BTF generation for drivers/staging/fbtft/fb_bd663474.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_hx8340bn.mod.o
  LD [M]  drivers/staging/fbtft/fb_hx8340bn.ko
  BTF [M] drivers/staging/fbtft/fb_hx8340bn.ko
Skipping BTF generation for drivers/staging/fbtft/fb_hx8340bn.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_hx8347d.mod.o
  LD [M]  drivers/staging/fbtft/fb_hx8347d.ko
  BTF [M] drivers/staging/fbtft/fb_hx8347d.ko
Skipping BTF generation for drivers/staging/fbtft/fb_hx8347d.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_hx8353d.mod.o
  LD [M]  drivers/staging/fbtft/fb_hx8353d.ko
  BTF [M] drivers/staging/fbtft/fb_hx8353d.ko
Skipping BTF generation for drivers/staging/fbtft/fb_hx8353d.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_hx8357d.mod.o
  LD [M]  drivers/staging/fbtft/fb_hx8357d.ko
  BTF [M] drivers/staging/fbtft/fb_hx8357d.ko
Skipping BTF generation for drivers/staging/fbtft/fb_hx8357d.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9163.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9163.ko
  BTF [M] drivers/staging/fbtft/fb_ili9163.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9163.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9320.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9320.ko
  BTF [M] drivers/staging/fbtft/fb_ili9320.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9320.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9325.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9325.ko
  BTF [M] drivers/staging/fbtft/fb_ili9325.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9325.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9340.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9340.ko
  BTF [M] drivers/staging/fbtft/fb_ili9340.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9340.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9341.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9341.ko
  BTF [M] drivers/staging/fbtft/fb_ili9341.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9341.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9481.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9481.ko
  BTF [M] drivers/staging/fbtft/fb_ili9481.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9481.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ili9486.mod.o
  LD [M]  drivers/staging/fbtft/fb_ili9486.ko
  BTF [M] drivers/staging/fbtft/fb_ili9486.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ili9486.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_pcd8544.mod.o
  LD [M]  drivers/staging/fbtft/fb_pcd8544.ko
  BTF [M] drivers/staging/fbtft/fb_pcd8544.ko
Skipping BTF generation for drivers/staging/fbtft/fb_pcd8544.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ra8875.mod.o
  LD [M]  drivers/staging/fbtft/fb_ra8875.ko
  BTF [M] drivers/staging/fbtft/fb_ra8875.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ra8875.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_s6d02a1.mod.o
  LD [M]  drivers/staging/fbtft/fb_s6d02a1.ko
  BTF [M] drivers/staging/fbtft/fb_s6d02a1.ko
Skipping BTF generation for drivers/staging/fbtft/fb_s6d02a1.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_s6d1121.mod.o
  LD [M]  drivers/staging/fbtft/fb_s6d1121.ko
  BTF [M] drivers/staging/fbtft/fb_s6d1121.ko
Skipping BTF generation for drivers/staging/fbtft/fb_s6d1121.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_seps525.mod.o
  LD [M]  drivers/staging/fbtft/fb_seps525.ko
  BTF [M] drivers/staging/fbtft/fb_seps525.ko
Skipping BTF generation for drivers/staging/fbtft/fb_seps525.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_sh1106.mod.o
  LD [M]  drivers/staging/fbtft/fb_sh1106.ko
  BTF [M] drivers/staging/fbtft/fb_sh1106.ko
Skipping BTF generation for drivers/staging/fbtft/fb_sh1106.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1289.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1289.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1289.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1289.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1305.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1305.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1305.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1305.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1306.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1306.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1306.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1306.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1325.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1325.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1325.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1325.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1331.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1331.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1331.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1331.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_ssd1351.mod.o
  LD [M]  drivers/staging/fbtft/fb_ssd1351.ko
  BTF [M] drivers/staging/fbtft/fb_ssd1351.ko
Skipping BTF generation for drivers/staging/fbtft/fb_ssd1351.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_st7735r.mod.o
  LD [M]  drivers/staging/fbtft/fb_st7735r.ko
  BTF [M] drivers/staging/fbtft/fb_st7735r.ko
Skipping BTF generation for drivers/staging/fbtft/fb_st7735r.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_st7789v.mod.o
  LD [M]  drivers/staging/fbtft/fb_st7789v.ko
  BTF [M] drivers/staging/fbtft/fb_st7789v.ko
Skipping BTF generation for drivers/staging/fbtft/fb_st7789v.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_tinylcd.mod.o
  LD [M]  drivers/staging/fbtft/fb_tinylcd.ko
  BTF [M] drivers/staging/fbtft/fb_tinylcd.ko
Skipping BTF generation for drivers/staging/fbtft/fb_tinylcd.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_tls8204.mod.o
  LD [M]  drivers/staging/fbtft/fb_tls8204.ko
  BTF [M] drivers/staging/fbtft/fb_tls8204.ko
Skipping BTF generation for drivers/staging/fbtft/fb_tls8204.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_uc1611.mod.o
  LD [M]  drivers/staging/fbtft/fb_uc1611.ko
  BTF [M] drivers/staging/fbtft/fb_uc1611.ko
Skipping BTF generation for drivers/staging/fbtft/fb_uc1611.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_uc1701.mod.o
  LD [M]  drivers/staging/fbtft/fb_uc1701.ko
  BTF [M] drivers/staging/fbtft/fb_uc1701.ko
Skipping BTF generation for drivers/staging/fbtft/fb_uc1701.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fb_upd161704.mod.o
  LD [M]  drivers/staging/fbtft/fb_upd161704.ko
  BTF [M] drivers/staging/fbtft/fb_upd161704.ko
Skipping BTF generation for drivers/staging/fbtft/fb_upd161704.ko due to unavailability of vmlinux
  CC [M]  drivers/staging/fbtft/fbtft.mod.o
  LD [M]  drivers/staging/fbtft/fbtft.ko
  BTF [M] drivers/staging/fbtft/fbtft.ko
Skipping BTF generation for drivers/staging/fbtft/fbtft.ko due to unavailability of vmlinux
drv@ubunlion:~/git/kernels/staging$


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-10-29 16:58   ` Deepak R Varma
@ 2022-10-29 17:34     ` Julia Lawall
  2022-10-31  7:11       ` Deepak R Varma
  0 siblings, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2022-10-29 17:34 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Greg Kroah-Hartman, outreachy, dri-devel, linux-fbdev,
	linux-staging, linux-kernel



On Sat, 29 Oct 2022, Deepak R Varma wrote:

> On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > > number of elements in an array. Issue identified using coccicheck.
> > >
> > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > ---
> > >  drivers/staging/fbtft/fbtft.h | 2 +-
> > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > >
> > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > > index 2c2b5f1c1df3..5506a473be91 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__ }))
> >
> > Please please please test-build your patches before sending them out.
> > To not do so just wastes reviewer resources :(
>
> Hello Greg,
> I did build the .ko files by making the driver/staging/fbtft/ path. I verified
> .o and .ko files were built.
>
> I did a make clean just now and was again able to rebuild without any errors.
> Please see the attached log file.
>
> Is there something wrong with the way I am firing the build?

The change is in the definition of a macro.  The compiler won't help you
in this case unless the macro is actually used in code that is compiled.
Find the uses and check for any nearby ifdefs.  For file foo.c you can
also do make foo.i to see the result of reducing ifdef and expanding
macros.  Then you can see if the code you changed is actually included in
the build.

julia

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-10-29 17:34     ` Julia Lawall
@ 2022-10-31  7:11       ` Deepak R Varma
  2022-10-31  9:40         ` Deepak R Varma
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-10-31  7:11 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg Kroah-Hartman, outreachy, dri-devel, linux-fbdev,
	linux-staging, linux-kernel

On Sat, Oct 29, 2022 at 07:34:26PM +0200, Julia Lawall wrote:
>
>
> On Sat, 29 Oct 2022, Deepak R Varma wrote:
>
> > On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> > > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > > > number of elements in an array. Issue identified using coccicheck.
> > > >
> > > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > > ---
> > > >  drivers/staging/fbtft/fbtft.h | 2 +-
> > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > >
> > > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > > > index 2c2b5f1c1df3..5506a473be91 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__ }))
> > >
> > > Please please please test-build your patches before sending them out.
> > > To not do so just wastes reviewer resources :(
> >
> > Hello Greg,
> > I did build the .ko files by making the driver/staging/fbtft/ path. I verified
> > .o and .ko files were built.
> >
> > I did a make clean just now and was again able to rebuild without any errors.
> > Please see the attached log file.
> >
> > Is there something wrong with the way I am firing the build?
>
> The change is in the definition of a macro.  The compiler won't help you
> in this case unless the macro is actually used in code that is compiled.
> Find the uses and check for any nearby ifdefs.  For file foo.c you can
> also do make foo.i to see the result of reducing ifdef and expanding
> macros.  Then you can see if the code you changed is actually included in
> the build.

Okay. This is helpful. I understand. Looking into the file where the macro
expansion is reported to be failed.

Thank you,
./drv

>
> julia
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  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
  0 siblings, 2 replies; 12+ messages in thread
From: Deepak R Varma @ 2022-10-31  9:40 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg Kroah-Hartman, outreachy, dri-devel, linux-fbdev,
	linux-staging, linux-kernel

On Mon, Oct 31, 2022 at 12:41:40PM +0530, Deepak Varma wrote:
> On Sat, Oct 29, 2022 at 07:34:26PM +0200, Julia Lawall wrote:
> >
> >
> > On Sat, 29 Oct 2022, Deepak R Varma wrote:
> >
> > > On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> > > > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > > > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > > > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > > > > number of elements in an array. Issue identified using coccicheck.
> > > > >
> > > > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > > > ---
> > > > >  drivers/staging/fbtft/fbtft.h | 2 +-
> > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > >
> > > > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > > > > index 2c2b5f1c1df3..5506a473be91 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__ }))
> > > >
> > > > Please please please test-build your patches before sending them out.
> > > > To not do so just wastes reviewer resources :(
> > >
> > > Hello Greg,
> > > I did build the .ko files by making the driver/staging/fbtft/ path. I verified
> > > .o and .ko files were built.
> > >
> > > I did a make clean just now and was again able to rebuild without any errors.
> > > Please see the attached log file.
> > >
> > > Is there something wrong with the way I am firing the build?
> >
> > The change is in the definition of a macro.  The compiler won't help you
> > in this case unless the macro is actually used in code that is compiled.
> > Find the uses and check for any nearby ifdefs.  For file foo.c you can
> > also do make foo.i to see the result of reducing ifdef and expanding
> > macros.  Then you can see if the code you changed is actually included in
> > the build.
>
> Okay. This is helpful. I understand. Looking into the file where the macro
> expansion is reported to be failed.

Hi Julia,
I could see the macro expansions in the .i files for the fbtft-core.c and
fb_hx8353d.c file. I am not sure why it built successfully on my x86 though. The
error in Kerbel bot seems to be specific to ARM arch. I will try that later
today. I am on the right track to the build error triage?

Also, while reviewing the macro expansion, I saw change in the computation that
seems odd to me. In the denominator of the expanded macro, there is a "+
((int)...." computation that I am not sure if is result of ARRAY_SIZE. I have
attached the old anf the new .i file diff for your review. If you get a change
could you help me understand why this additional computation is added to the
denominator?

Thank you,
./drv
>
> Thank you,
> ./drv
>
> >
> > julia
> >
>
>
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-10-31  9:40         ` Deepak R Varma
@ 2022-10-31  9:41           ` Deepak R Varma
  2022-10-31 12:05           ` Julia Lawall
  1 sibling, 0 replies; 12+ messages in thread
From: Deepak R Varma @ 2022-10-31  9:41 UTC (permalink / raw)
  To: Julia Lawall
  Cc: Greg Kroah-Hartman, outreachy, dri-devel, linux-fbdev,
	linux-staging, linux-kernel

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

On Mon, Oct 31, 2022 at 03:10:27PM +0530, Deepak Varma wrote:
> On Mon, Oct 31, 2022 at 12:41:40PM +0530, Deepak Varma wrote:
> > On Sat, Oct 29, 2022 at 07:34:26PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Sat, 29 Oct 2022, Deepak R Varma wrote:
> > >
> > > > On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> > > > > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > > > > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > > > > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > > > > > number of elements in an array. Issue identified using coccicheck.
> > > > > >
> > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > > > > ---
> > > > > >  drivers/staging/fbtft/fbtft.h | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > > > > > index 2c2b5f1c1df3..5506a473be91 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__ }))
> > > > >
> > > > > Please please please test-build your patches before sending them out.
> > > > > To not do so just wastes reviewer resources :(
> > > >
> > > > Hello Greg,
> > > > I did build the .ko files by making the driver/staging/fbtft/ path. I verified
> > > > .o and .ko files were built.
> > > >
> > > > I did a make clean just now and was again able to rebuild without any errors.
> > > > Please see the attached log file.
> > > >
> > > > Is there something wrong with the way I am firing the build?
> > >
> > > The change is in the definition of a macro.  The compiler won't help you
> > > in this case unless the macro is actually used in code that is compiled.
> > > Find the uses and check for any nearby ifdefs.  For file foo.c you can
> > > also do make foo.i to see the result of reducing ifdef and expanding
> > > macros.  Then you can see if the code you changed is actually included in
> > > the build.
> >
> > Okay. This is helpful. I understand. Looking into the file where the macro
> > expansion is reported to be failed.
>
> Hi Julia,
> I could see the macro expansions in the .i files for the fbtft-core.c and
> fb_hx8353d.c file. I am not sure why it built successfully on my x86 though. The
> error in Kerbel bot seems to be specific to ARM arch. I will try that later
> today. I am on the right track to the build error triage?
>
> Also, while reviewing the macro expansion, I saw change in the computation that
> seems odd to me. In the denominator of the expanded macro, there is a "+
> ((int)...." computation that I am not sure if is result of ARRAY_SIZE. I have
> attached the old anf the new .i file diff for your review. If you get a change
> could you help me understand why this additional computation is added to the
> denominator?

File now attached.

>
> Thank you,
> ./drv
> >
> > Thank you,
> > ./drv
> >
> > >
> > > julia
> > >
> >
> >
> >
>
>
>

[-- Attachment #2: fbtft-core.diff --]
[-- Type: text/x-diff, Size: 2398 bytes --]

74422c74422,74428
< # 242 "drivers/staging/fbtft/fbtft.h"
---
> 
> 
> 
> 
> 
> 
> 
74644c74650
<  ((par)->fbtftops.write_register(par, (sizeof((int[]){MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF}) / sizeof(int)), MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF))
---
>  ((par)->fbtftops.write_register(par, (sizeof(((int[]){ MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF })) / sizeof((((int[]){ MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF }))[0]) + ((int)(sizeof(struct { int:(-!!(__builtin_types_compatible_p(typeof((((int[]){ MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF }))), typeof(&(((int[]){ MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF }))[0])))); })))), MIPI_DCS_SET_COLUMN_ADDRESS, (xs >> 8) & 0xFF, xs & 0xFF, (xe >> 8) & 0xFF, xe & 0xFF))
74647c74653
<  ((par)->fbtftops.write_register(par, (sizeof((int[]){MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF}) / sizeof(int)), MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF))
---
>  ((par)->fbtftops.write_register(par, (sizeof(((int[]){ MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF })) / sizeof((((int[]){ MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF }))[0]) + ((int)(sizeof(struct { int:(-!!(__builtin_types_compatible_p(typeof((((int[]){ MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF }))), typeof(&(((int[]){ MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF }))[0])))); })))), MIPI_DCS_SET_PAGE_ADDRESS, (ys >> 8) & 0xFF, ys & 0xFF, (ye >> 8) & 0xFF, ye & 0xFF))
74650c74656
<  ((par)->fbtftops.write_register(par, (sizeof((int[]){MIPI_DCS_WRITE_MEMORY_START}) / sizeof(int)), MIPI_DCS_WRITE_MEMORY_START));
---
>  ((par)->fbtftops.write_register(par, (sizeof(((int[]){ MIPI_DCS_WRITE_MEMORY_START })) / sizeof((((int[]){ MIPI_DCS_WRITE_MEMORY_START }))[0]) + ((int)(sizeof(struct { int:(-!!(__builtin_types_compatible_p(typeof((((int[]){ MIPI_DCS_WRITE_MEMORY_START }))), typeof(&(((int[]){ MIPI_DCS_WRITE_MEMORY_START }))[0])))); })))), MIPI_DCS_WRITE_MEMORY_START));

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  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
  1 sibling, 1 reply; 12+ messages in thread
From: Julia Lawall @ 2022-10-31 12:05 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Julia Lawall, Greg Kroah-Hartman, outreachy, dri-devel,
	linux-fbdev, linux-staging, linux-kernel



On Mon, 31 Oct 2022, Deepak R Varma wrote:

> On Mon, Oct 31, 2022 at 12:41:40PM +0530, Deepak Varma wrote:
> > On Sat, Oct 29, 2022 at 07:34:26PM +0200, Julia Lawall wrote:
> > >
> > >
> > > On Sat, 29 Oct 2022, Deepak R Varma wrote:
> > >
> > > > On Sat, Oct 29, 2022 at 09:32:50AM +0200, Greg Kroah-Hartman wrote:
> > > > > On Fri, Oct 28, 2022 at 07:00:05PM +0530, Deepak R Varma wrote:
> > > > > > The ARRAY_SIZE(foo) macro should be preferred over sizeof operator
> > > > > > based computation such as sizeof(foo)/sizeof(foo[0]) for finding
> > > > > > number of elements in an array. Issue identified using coccicheck.
> > > > > >
> > > > > > Signed-off-by: Deepak R Varma <drv@mailo.com>
> > > > > > ---
> > > > > >  drivers/staging/fbtft/fbtft.h | 2 +-
> > > > > >  1 file changed, 1 insertion(+), 1 deletion(-)
> > > > > >
> > > > > > diff --git a/drivers/staging/fbtft/fbtft.h b/drivers/staging/fbtft/fbtft.h
> > > > > > index 2c2b5f1c1df3..5506a473be91 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__ }))
> > > > >
> > > > > Please please please test-build your patches before sending them out.
> > > > > To not do so just wastes reviewer resources :(
> > > >
> > > > Hello Greg,
> > > > I did build the .ko files by making the driver/staging/fbtft/ path. I verified
> > > > .o and .ko files were built.
> > > >
> > > > I did a make clean just now and was again able to rebuild without any errors.
> > > > Please see the attached log file.
> > > >
> > > > Is there something wrong with the way I am firing the build?
> > >
> > > The change is in the definition of a macro.  The compiler won't help you
> > > in this case unless the macro is actually used in code that is compiled.
> > > Find the uses and check for any nearby ifdefs.  For file foo.c you can
> > > also do make foo.i to see the result of reducing ifdef and expanding
> > > macros.  Then you can see if the code you changed is actually included in
> > > the build.
> >
> > Okay. This is helpful. I understand. Looking into the file where the macro
> > expansion is reported to be failed.
>
> Hi Julia,
> I could see the macro expansions in the .i files for the fbtft-core.c and
> fb_hx8353d.c file. I am not sure why it built successfully on my x86 though. The
> error in Kerbel bot seems to be specific to ARM arch. I will try that later
> today. I am on the right track to the build error triage?
>
> Also, while reviewing the macro expansion, I saw change in the computation that
> seems odd to me. In the denominator of the expanded macro, there is a "+
> ((int)...." computation that I am not sure if is result of ARRAY_SIZE. I have
> attached the old anf the new .i file diff for your review. If you get a change
> could you help me understand why this additional computation is added to the
> denominator?

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

>
> Thank you,
> ./drv
> >
> > Thank you,
> > ./drv
> >
> > >
> > > julia
> > >
> >
> >
> >
>
>
>

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-10-31 12:05           ` Julia Lawall
@ 2022-11-04 12:01             ` Deepak R Varma
  2022-11-04 14:42               ` Deepak R Varma
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-11-04 12:01 UTC (permalink / raw)
  To: Julia Lawall, Greg Kroah-Hartman
  Cc: outreachy, dri-devel, linux-fbdev, linux-staging, linux-kernel

[-- 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$


^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-11-04 12:01             ` Deepak R Varma
@ 2022-11-04 14:42               ` Deepak R Varma
  2022-11-09 15:00                 ` Deepak R Varma
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-11-04 14:42 UTC (permalink / raw)
  To: Julia Lawall, Greg Kroah-Hartman
  Cc: outreachy, dri-devel, linux-fbdev, linux-staging, linux-kernel

On Fri, Nov 04, 2022 at 05:31:24PM +0530, Deepak R Varma wrote:
> 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?

Looks like the change I proposed is causing nesting inside the write_reg
function due to additional set of { & } brackets for the __VA_ARGS__ symbol.

Am I understanding it right?

>
> Thank you,
> ./drv




^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-11-04 14:42               ` Deepak R Varma
@ 2022-11-09 15:00                 ` Deepak R Varma
  2022-11-09 16:00                   ` Greg Kroah-Hartman
  0 siblings, 1 reply; 12+ messages in thread
From: Deepak R Varma @ 2022-11-09 15:00 UTC (permalink / raw)
  To: Julia Lawall, Greg Kroah-Hartman
  Cc: outreachy, dri-devel, linux-fbdev, linux-staging, linux-kernel

On Fri, Nov 04, 2022 at 08:12:11PM +0530, Deepak R Varma wrote:
> On Fri, Nov 04, 2022 at 05:31:24PM +0530, Deepak R Varma wrote:
> > 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?
>
> Looks like the change I proposed is causing nesting inside the write_reg
> function due to additional set of { & } brackets for the __VA_ARGS__ symbol.
>
> Am I understanding it right?

Hello Julia, Greg,
I am unable to reproduce this build failure on my local machine. I tried the X86
and arm based build. I am unable to troubleshoot this further. Do you have any
other suggestions? If not, I will drop this patch from my watch list.

Thank you,
./drv

>
> >
> > Thank you,
> > ./drv
>
>
>
>



^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH] staging: fbtft: Use ARRAY_SIZE() to get argument count
  2022-11-09 15:00                 ` Deepak R Varma
@ 2022-11-09 16:00                   ` Greg Kroah-Hartman
  0 siblings, 0 replies; 12+ messages in thread
From: Greg Kroah-Hartman @ 2022-11-09 16:00 UTC (permalink / raw)
  To: Deepak R Varma
  Cc: Julia Lawall, outreachy, dri-devel, linux-fbdev, linux-staging,
	linux-kernel

On Wed, Nov 09, 2022 at 08:30:52PM +0530, Deepak R Varma wrote:
> On Fri, Nov 04, 2022 at 08:12:11PM +0530, Deepak R Varma wrote:
> > On Fri, Nov 04, 2022 at 05:31:24PM +0530, Deepak R Varma wrote:
> > > 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?
> >
> > Looks like the change I proposed is causing nesting inside the write_reg
> > function due to additional set of { & } brackets for the __VA_ARGS__ symbol.
> >
> > Am I understanding it right?
> 
> Hello Julia, Greg,
> I am unable to reproduce this build failure on my local machine. I tried the X86
> and arm based build. I am unable to troubleshoot this further. Do you have any
> other suggestions? If not, I will drop this patch from my watch list.

Please just drop it, it is not a correct change to make.

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2022-11-09 16:00 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2022-11-04 14:42               ` Deepak R Varma
2022-11-09 15:00                 ` Deepak R Varma
2022-11-09 16:00                   ` Greg Kroah-Hartman

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 read-only IMAP folder(s) and NNTP newsgroup(s).