Re: [PATCH] staging: media: atomisp: prefer __aligned over __attribute__((aligned))

From: Andy Shevchenko

Date: Thu Jun 18 2026 - 09:04:37 EST


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