Re: [PATCH v3 4/6] staging: vt6655: refactor long lines of code in s_vGenerateTxParameter

From: Tanju Brunostar
Date: Sat Oct 22 2022 - 05:17:25 EST


On Sat, Oct 22, 2022 at 9:17 AM Greg KH <gregkh@xxxxxxxxxxxxxxxxxxx> wrote:
>
> On Sat, Oct 22, 2022 at 07:06:10AM +0000, Tanjuate Brunostar wrote:
> > fix checkpatch errors by refactoring long lines of code in the function: s_vGenerateTxParameter
> >
> > Signed-off-by: Tanjuate Brunostar <tanjubrunostar0@xxxxxxxxx>
> > ---
> > drivers/staging/vt6655/rxtx.c | 67 ++++++++++++++++++++++++-----------
> > 1 file changed, 46 insertions(+), 21 deletions(-)
> >
> > diff --git a/drivers/staging/vt6655/rxtx.c b/drivers/staging/vt6655/rxtx.c
> > index dc853b83459b..951d4172e9f2 100644
> > --- a/drivers/staging/vt6655/rxtx.c
> > +++ b/drivers/staging/vt6655/rxtx.c
> > @@ -839,7 +839,8 @@ s_vFillCTSHead(struct vnt_private *pDevice,
> > }
> >
> > if (byPktType == PK_TYPE_11GB || byPktType == PK_TYPE_11GA) {
> > - if (byFBOption != AUTO_FB_NONE && uDMAIdx != TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
> > + if (byFBOption != AUTO_FB_NONE && uDMAIdx !=
> > + TYPE_ATIMDMA && uDMAIdx != TYPE_BEACONDMA) {
>
> Don't break lines like this, this is now much harder to read.
>
> It should look like:
> if (byFBOption != AUTO_FB_NONE &&
> uDMAIdx != TYPE_ATIMDMA &&
> uDMAIdx != TYPE_BEACONDMA) {
>
> If you want to make it more readable, right?
>
> And that is the main point here, the coding style is to make it readable
> to us humans, the compiler doesn't care.
>
> Your change makes the logic harder to understand, not easier, which is a
> step backwards.
>
> We write code for developers first (as we have to maintain it), and the
> compiler second.
>
> thanks,
>
> greg k-h
Got it