-
Notifications
You must be signed in to change notification settings - Fork 23
General code cleanup #55
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
| u_char *ucp = (u_char *)linebuf; | ||
| uint count = 52; | ||
| char linebuf[DISP_LINE_LEN]; | ||
| uint *uip = (uint *)linebuf; |
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
8743607 to
0241b7b
Compare
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>
This pr contains a series of housekeeping patches.
Dropping a single unused
int iis 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.