Re: [PATCH v6] staging: media: atomisp: apply clang-format and fix checkpatch.pl errors
From: Andy Shevchenko
Date: Fri Jun 27 2025 - 12:03:47 EST
On Fri, Jun 27, 2025 at 10:56:09PM +0800, LiangCheng Wang wrote:
> Applied clang-format to the entire AtomISP driver to improve code consistency,
> readability, and adherence to Linux kernel coding style.
>
> Additionally, manually fixed all checkpatch.pl-reported ERRORs across
> the driver, including:
>
> - Macro definitions with complex expressions now wrapped in parentheses
> - Removed unnecessary parentheses in return statements
> - Avoided initializing globals to zero
> - Fixed invalid spacing around unary operators
>
> This patch only includes formatting and stylistic changes with no functional logic modifications.
>
> Suggested-by: Andy Shevchenko <andy@xxxxxxxxxx>
> Link: https://lore.kernel.org/all/aFwSgCtrK7DH3pIw@xxxxxxxxxxxxxxxxxx/
> Signed-off-by: LiangCheng Wang <zaq14760@xxxxxxxxx>
> ---
> This patch applies clang-format to the entire AtomISP driver and manually
> fixes all checkpatch.pl-reported ERRORs. The intent is to improve code
> consistency and align with kernel coding standards.
>
> Formatting and error fixes include:
> - Replacing space-based indentation with tabs
> - Wrapping complex macros in parentheses
> - Removing redundant return parentheses
> - Avoiding unnecessary zero-initialized globals
>
> The following tools were used:
> clang-format -i $(find drivers/staging/media/atomisp/ -name "*.[ch]")
> ./scripts/checkpatch.pl -f $(find drivers/staging/media/atomisp/ -name "*.[ch]") | grep '^ERROR:' -B 1 -A 2
> WARNINGs (~1500) were intentionally left untouched to keep this patch
> focused and reviewable. These may be addressed in future patches.
Thanks for this version, but no need to send such a huge changes.
Just make a public Git repo with it and provide just a cover letter.
This is unreviewable.
Looking at some changes it might be doubtful. Perhaps we need a modified
version of .clang-format for this driver. Dunno. It's up to Hans, and others
are welcome to share their opinions.
In particular I'm referring to the change of amount of TABs, like
#define FOO 1234
to
#define FOO 1234 // if it's even a TAB there!
--
With Best Regards,
Andy Shevchenko