Skip to content

Conversation

@jonrebm
Copy link
Contributor

@jonrebm jonrebm commented Dec 14, 2025

This pr contains a series of housekeeping patches.

Dropping a single unused int i is probably uncontroversial, removing lengthy license headers in favor of two SPDX lines and broad code reformatting maybe less so.

Changes where made to now pass most of -Wpedantic, where adaption seemed appropriate.

I used uncrustify to enforce some basic code style rules, and added the uncrustify config to version control. The chosen ruleset is very soft and tries to be close to kernel style. I only enabled uncrustify rules where I found all changes it lead to in the current codebase to be beneficial in every single instance.

@jonrebm jonrebm mentioned this pull request Dec 14, 2025
u_char *ucp = (u_char *)linebuf;
uint count = 52;
char linebuf[DISP_LINE_LEN];
uint *uip = (uint *)linebuf;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would replace all whitespace in this line with a single space (which matches the common style in the kernel).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think aligning tabular things with spaces is a good practice if it improves clarity which I think it does here. This also isn't uncommon in the kernel.

@jonrebm jonrebm force-pushed the housekeeping branch 2 times, most recently from 8743607 to 0241b7b Compare January 14, 2026 10:25
@jonrebm jonrebm requested a review from ukleinek January 14, 2026 10:25
To avoid the warning: ISO C does not permit named variadic macros
[-Werror=variadic-macros]

This is not a functional change.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
They are nice but I don't think we're doing C23 yet and here, they
aren't helping.

To avoid the warning: use of an empty initializer is a C23 extension [-Werror,-Wc23-extensions]

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
To avoid the warning: arithmetic on a pointer to void is a GNU extension
[-Werror,-Wgnu-pointer-arith]

Change some types to make more use of unsigned char pointers for byte
sequences, to not have to introduce too many needless explicit casts.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
This error handling prevents re-reading the same bytes if the buffer is
exhausted.

This also avoids the warning:
ignoring return value of ‘read’ declared with attribute ‘warn_unused_result’ [-Werror=unused-result]

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Avoids warning for -Werror=unused-variable

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
It's less prosy this way

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Use consistent whitespace, identation etc.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
Instead, write the newline explicitly after writing the answerback
string.

Signed-off-by: Jonas Rebmann <jre@pengutronix.de>
@jonrebm jonrebm merged commit 8ee78d9 into pengutronix:main Jan 15, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants