Re: [PATCH v2 1/3] staging: media: atomisp: replace CSS_ALIGN() with standard __aligned
From: Andy Shevchenko
Date: Wed Jun 24 2026 - 08:07:25 EST
On Thu, Jun 18, 2026 at 06:12:44PM +0300, Igor Putko wrote:
> Replace the custom drivers/staging/media/atomisp-specific CSS_ALIGN()
> macro with the standard kernel __aligned() attribute. This aligns the
> driver with the kernel coding style and is a preparation for removing the
> entire custom platform_support.h header.
...
> +++ b/drivers/staging/media/atomisp/pci/ia_css_acc_types.h
> #include <system_local.h> /* HAS_IRQ_MAP_VERSION_# */
> #include <type_support.h>
> -#include <platform_support.h>
> #include <debug_global.h>
> #include <linux/bits.h>
> +#include <linux/compiler.h>
While at it move the linux/*.h to be on top of the local ones. And group them.
<linux/*.h>
...blank line...
<local ones *.h>
Since there are a lot of uXX, just include types.h instead of compiler.h.
...
> struct ia_css_blob_info {
> u32 bss_target; /** Start position of bss in SP dmem */
> u32 bss_size; /** Size of bss section */
> /** Dynamic data filled by loader */
> - CSS_ALIGN(const void *code,
> - 8); /** Code section absolute pointer within fw, code = icache + text */
> - CSS_ALIGN(const void *data,
> - 8); /** Data section absolute pointer within fw, data = data + bss */
> + /* Code section absolute pointer within fw, code = icache + text */
> + const void *code __aligned(8);
> + /** Data section absolute pointer within fw, data = data + bss */
> + const void *data __aligned(8);
> };
...
> struct ia_css_binary_info {
> - CSS_ALIGN(u32 id, 8); /* IA_CSS_BINARY_ID_* */
> + u32 id __aligned(8); /* IA_CSS_BINARY_ID_* */
...
> struct ia_css_binary_xinfo {
> /* Rest of the binary info, only interesting to the host. */
> enum ia_css_acc_type type;
>
> - CSS_ALIGN(s32 num_output_formats, 8);
> + s32 num_output_formats __aligned(8);
> enum ia_css_frame_format output_formats[IA_CSS_FRAME_FORMAT_NUM];
>
> - CSS_ALIGN(s32 num_vf_formats, 8); /** number of supported vf formats */
> + s32 num_vf_formats __aligned(8); /** number of supported vf formats */
> enum ia_css_frame_format
> vf_formats[IA_CSS_FRAME_FORMAT_NUM]; /** types of supported vf formats */
> u8 num_output_pins;
> ia_css_ptr xmem_addr;
>
> - CSS_ALIGN(const struct ia_css_blob_descr *blob, 8);
> - CSS_ALIGN(u32 blob_index, 8);
> - CSS_ALIGN(union ia_css_all_memory_offsets mem_offsets, 8);
> - CSS_ALIGN(struct ia_css_binary_xinfo *next, 8);
> + const struct ia_css_blob_descr *blob __aligned(8);
> + u32 blob_index __aligned(8);
> + union ia_css_all_memory_offsets mem_offsets __aligned(8);
> + struct ia_css_binary_xinfo *next __aligned(8);
> };
...
> struct ia_css_fw_info {
> size_t header_size; /** size of fw header */
>
> - CSS_ALIGN(u32 type, 8);
> + u32 type __aligned(8);
> union ia_css_fw_union info; /** Binary info */
> struct ia_css_blob_info blob; /** Blob info */
> /* Dynamic part */
> struct ia_css_fw_info *next;
>
> - CSS_ALIGN(u32 loaded, 8); /** Firmware has been loaded */
> - CSS_ALIGN(const u8 *isp_code, 8); /** ISP pointer to code */
> + u32 loaded __aligned(8); /** Firmware has been loaded */
> + const u8 *isp_code __aligned(8); /** ISP pointer to code */
> /** Firmware handle between user space and kernel */
> - CSS_ALIGN(u32 handle, 8);
> + u32 handle __aligned(8);
> /** Sections to copy from/to ISP */
> struct ia_css_isp_param_css_segments mem_initializers;
...
Looking at the above, I think the best is to move the definition from
platform_support.h to ia_css_acc_types.h. The rest what you changed
seems fine with the explicit __aligned() attributes.
So, we can do it in two steps:
- replace in the other files first (as this patch does)
- move the definition to the ia_css_acc_types.h
- ...the rest of the series as is (I haven't reviewed those yet, though)...
--
With Best Regards,
Andy Shevchenko