Linux kernel staging patches
 help / color / mirror / Atom feed
* [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned))
@ 2026-06-18 12:09 Igor Putko
  2026-06-18 12:53 ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Igor Putko @ 2026-06-18 12:09 UTC (permalink / raw)
  To: hansg, mchehab, gregkh
  Cc: andy, sakari.ailus, linux-media, linux-staging, linux-kernel,
	Igor Putko

Replace the GCC-specific __attribute__((aligned(a))) with the standard
__aligned(a) macro to match the kernel coding style.

The checkpatch.pl error about complex macro values is a false positive
here, as enclosing the macro expansion in parentheses breaks declaration
syntax.

Signed-off-by: Igor Putko <igorpetindev@gmail.com>
---
 .../media/atomisp/pci/hive_isp_css_include/platform_support.h   | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h b/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
index 473d8d4fb9ba..9aa445c45e9f 100644
--- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
+++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
@@ -20,6 +20,6 @@
 #define UINT32_MAX UINT_MAX
 #define UCHAR_MAX  (255)
 
-#define CSS_ALIGN(d, a) d __attribute__((aligned(a)))
+#define CSS_ALIGN(d, a) d __aligned(a)
 
 #endif /* __PLATFORM_SUPPORT_H_INCLUDED__ */
-- 
2.34.1


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

* Re: [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned))
  2026-06-18 12:09 [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned)) Igor Putko
@ 2026-06-18 12:53 ` Andy Shevchenko
  2026-06-18 13:04   ` Andy Shevchenko
  0 siblings, 1 reply; 3+ messages in thread
From: Andy Shevchenko @ 2026-06-18 12:53 UTC (permalink / raw)
  To: Igor Putko
  Cc: hansg, mchehab, gregkh, andy, sakari.ailus, linux-media,
	linux-staging, linux-kernel

On Thu, Jun 18, 2026 at 03:09:51PM +0300, Igor Putko wrote:
> Replace the GCC-specific __attribute__((aligned(a))) with the standard
> __aligned(a) macro to match the kernel coding style.
> 
> The checkpatch.pl error about complex macro values is a false positive
> here, as enclosing the macro expansion in parentheses breaks declaration
> syntax.

...

> --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
> +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h

>  #define UINT32_MAX UINT_MAX
>  #define UCHAR_MAX  (255)
>  
> -#define CSS_ALIGN(d, a) d __attribute__((aligned(a)))
> +#define CSS_ALIGN(d, a) d __aligned(a)

Ah, nice finding! But this header should be killed. It means that rather
kill the macro altogether and replace all occurrences with the proper
attribute (see the history of math_support.h as an example).

-- 
With Best Regards,
Andy Shevchenko



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

* Re: [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned))
  2026-06-18 12:53 ` Andy Shevchenko
@ 2026-06-18 13:04   ` Andy Shevchenko
  0 siblings, 0 replies; 3+ messages in thread
From: Andy Shevchenko @ 2026-06-18 13:04 UTC (permalink / raw)
  To: Igor Putko
  Cc: hansg, mchehab, gregkh, andy, sakari.ailus, linux-media,
	linux-staging, linux-kernel

On Thu, Jun 18, 2026 at 03:53:26PM +0300, Andy Shevchenko wrote:
> On Thu, Jun 18, 2026 at 03:09:51PM +0300, Igor Putko wrote:
> > Replace the GCC-specific __attribute__((aligned(a))) with the standard
> > __aligned(a) macro to match the kernel coding style.
> > 
> > The checkpatch.pl error about complex macro values is a false positive
> > here, as enclosing the macro expansion in parentheses breaks declaration
> > syntax.

...

> > --- a/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
> > +++ b/drivers/staging/media/atomisp/pci/hive_isp_css_include/platform_support.h
> 
> >  #define UINT32_MAX UINT_MAX
> >  #define UCHAR_MAX  (255)
> >  
> > -#define CSS_ALIGN(d, a) d __attribute__((aligned(a)))
> > +#define CSS_ALIGN(d, a) d __aligned(a)
> 
> Ah, nice finding! But this header should be killed. It means that rather
> kill the macro altogether and replace all occurrences with the proper
> attribute (see the history of math_support.h as an example).

For the record, I just have checked and in this entire header the only
CSS_ALIGN() is used by the driver, the rest is already a dead code, so the plan
is that:
 - replace CSS_ALIGN() by respective __aligned() in the users
   (be sure necessary headers are included, usually linux/types.h)
 - drop *or* replace (if there are two categories, make two distinct changes)
   the platform_support.h inclusion in the following files

 drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf.h
 drivers/staging/media/atomisp/pci/base/circbuf/interface/ia_css_circbuf_desc.h
 drivers/staging/media/atomisp/pci/base/refcount/src/refcount.c
 drivers/staging/media/atomisp/pci/hive_isp_css_include/type_support.h
 drivers/staging/media/atomisp/pci/hive_isp_css_shared/host/tag.c
 drivers/staging/media/atomisp/pci/ia_css_acc_types.h
 drivers/staging/media/atomisp/pci/runtime/frame/interface/ia_css_frame_comm.h
 drivers/staging/media/atomisp/pci/runtime/inputfifo/src/inputfifo.c
 drivers/staging/media/atomisp/pci/runtime/isp_param/interface/ia_css_isp_param_types.h
 drivers/staging/media/atomisp/pci/runtime/isys/interface/ia_css_isys_comm.h
 drivers/staging/media/atomisp/pci/runtime/isys/src/csi_rx_rmgr.c
 drivers/staging/media/atomisp/pci/runtime/isys/src/ibuf_ctrl_rmgr.c
 drivers/staging/media/atomisp/pci/runtime/isys/src/isys_dma_rmgr.c
 drivers/staging/media/atomisp/pci/runtime/isys/src/isys_init.c
 drivers/staging/media/atomisp/pci/runtime/isys/src/isys_stream2mmio_rmgr.c
 drivers/staging/media/atomisp/pci/runtime/queue/interface/ia_css_queue.h
 drivers/staging/media/atomisp/pci/runtime/rmgr/src/rmgr_vbuf.c
 drivers/staging/media/atomisp/pci/sh_css_firmware.c
 drivers/staging/media/atomisp/pci/sh_css_hrt.c
 drivers/staging/media/atomisp/pci/sh_css_internal.h
 drivers/staging/media/atomisp/pci/sh_css_param_shading.c
 drivers/staging/media/atomisp/pci/sh_css_params.c

 - drop platform_support.h for good

So, I expect three *or* four patches in a series.

-- 
With Best Regards,
Andy Shevchenko



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

end of thread, other threads:[~2026-06-18 13:04 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-18 12:09 [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned)) Igor Putko
2026-06-18 12:53 ` Andy Shevchenko
2026-06-18 13:04   ` Andy Shevchenko

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox