From: Alex Elder <elder@ieee.org>
To: Joe Perches <joe@perches.com>,
Greg KH <gregkh@linuxfoundation.org>,
Zhansaya Bagdauletkyzy <zhansayabagdaulet@gmail.com>
Cc: johan@kernel.org, elder@kernel.org, greybus-dev@lists.linaro.org,
linux-staging@lists.linux.dev, linux-kernel@vger.kernel.org,
outreachy-kernel@googlegroups.com
Subject: Re: [PATCH] staging: greybus: Match parentheses alignment
Date: Wed, 14 Apr 2021 08:17:38 -0500 [thread overview]
Message-ID: <1607b040-6bc4-9a58-ae81-4ea0adf5885d@ieee.org> (raw)
In-Reply-To: <7d7be8bcc0e80d826083890ed7791070ad25e603.camel@perches.com>
On 4/6/21 12:21 PM, Joe Perches wrote:
> On Tue, 2021-04-06 at 15:27 +0200, Greg KH wrote:
>> On Tue, Apr 06, 2021 at 06:42:59PM +0600, Zhansaya Bagdauletkyzy wrote:
>>> Match next line with open parentheses by adding tabs/spaces
>>> to conform with Linux kernel coding style.
>>> Reported by checkpatch.
> []
>>> diff --git a/drivers/staging/greybus/camera.c b/drivers/staging/greybus/camera.c
> []
>>> @@ -378,8 +378,8 @@ struct ap_csi_config_request {
>>> #define GB_CAMERA_CSI_CLK_FREQ_MARGIN 150000000U
>>>
>>>
>>> static int gb_camera_setup_data_connection(struct gb_camera *gcam,
>>> - struct gb_camera_configure_streams_response *resp,
>>> - struct gb_camera_csi_params *csi_params)
>>> + struct gb_camera_configure_streams_response *resp,
>>> + struct gb_camera_csi_params *csi_params)
>>
>> And now you violate another coding style requirement, which means
>> someone will send another patch to fix that up and around and around it
>> goes...
>
> None of the coding style document is an actual requirement Greg.
> It's all rules of thumb. Useful rules, but not hard and fast right?
I agree with this, but this ambiguity causes some problems.
Greybus is a go-to place for just-starting developers to
work with some reasonably good "real" code. But someone
just starting has no way of judging whether the warnings
issued by checkpatch are real or not. Even experienced
developers will lack the insight to judge this if they
are modifying on a less-familiar part of the kernel.
The result--for Greybus certainly--is fairly regular
stream patches that suggest making trivial changes based
on checkpatch recommendations. And unfortunately each
one is destined to be rejected by the maintainers. This
is no good for anybody.
Can you think of a way to try to further characterize
how "serious" a warning message is? I recognize that
even if (for example) you had something like 1-10 severity
scale, the scale might not be uniform across the whole
kernel tree. Perhaps (like the -W options for GCC) there
could be a way to specify in a Makefile which checkpatch
messages are reported/not reported? I don't claim that's
a good suggestion, but if I could optionally indicate
somewhere that "two consecutive blank lines is OK for
Greybus" (one example that comes to mind) I might do so.
> To me, the biggest issue with this code isn't whether or not the
> code is aligned at open parentheses or stays within 80 columns,
> but is the use of 30+ character length identifiers.
I agree with you on this one... I've worked with code
like that and it's very difficult to make it readable.
I've made a mental note to go look at this and see if
I can make it better. I can't say when I'll get to it
but I think it's a good suggestion.
-Alex
> Using identifiers of that length makes using 80 column, or even
> 100 column length lines infeasible.
>
> Perhaps seeing if include/linux/greybus/greybus_protocols.h
> could be updated to use shorter length identifiers might be useful.
>
> The median length identifier there is ~25 chars long and the
> maximum length identifier is ~50 chars.
>
>
>
next prev parent reply other threads:[~2021-04-14 13:17 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-06 12:42 Zhansaya Bagdauletkyzy
2021-04-06 13:27 ` Greg KH
2021-04-06 17:21 ` Joe Perches
2021-04-14 13:17 ` Alex Elder [this message]
2021-04-14 14:29 ` Joe Perches
2021-04-14 14:35 ` Alex Elder
2021-04-14 16:11 ` Joe Perches
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1607b040-6bc4-9a58-ae81-4ea0adf5885d@ieee.org \
--to=elder@ieee.org \
--cc=elder@kernel.org \
--cc=gregkh@linuxfoundation.org \
--cc=greybus-dev@lists.linaro.org \
--cc=joe@perches.com \
--cc=johan@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-staging@lists.linux.dev \
--cc=outreachy-kernel@googlegroups.com \
--cc=zhansayabagdaulet@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®