[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210218012702.GX4718@ziepe.ca>
Date: Wed, 17 Feb 2021 21:27:02 -0400
From: Jason Gunthorpe <jgg@...pe.ca>
To: Jarkko Sakkinen <jarkko@...nel.org>
Cc: David Laight <David.Laight@...lab.com>,
Lino Sanfilippo <LinoSanfilippo@....de>,
"peterhuewe@....de" <peterhuewe@....de>,
"stefanb@...ux.vnet.ibm.com" <stefanb@...ux.vnet.ibm.com>,
"James.Bottomley@...senpartnership.com"
<James.Bottomley@...senpartnership.com>,
"linux-integrity@...r.kernel.org" <linux-integrity@...r.kernel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Lino Sanfilippo <l.sanfilippo@...bus.com>
Subject: Re: [PATCH v4] tpm: fix reference counting for struct tpm_chip
On Thu, Feb 18, 2021 at 12:14:11AM +0200, Jarkko Sakkinen wrote:
> On Tue, Feb 16, 2021 at 04:31:26PM +0000, David Laight wrote:
> > ...
> > > > > + get_device(&chip->dev);
> > > > > + chip->devs.release = tpm_devs_release;
> > > > > + chip->devs.devt =
> > > > > + MKDEV(MAJOR(tpm_devt), chip->dev_num + TPM_NUM_DEVICES);
> > >
> > > Isn't this less than 100 chars?
> >
> > Still best kept under 80 if 'reasonable'?
> >
> > Really it is just split in the wrong place:
> > chip->devs.devt = MKDEV(MAJOR(tpm_devt),
> > chip->dev_num + TPM_NUM_DEVICES);
>
>
> Well it looks crap IMHO. Would be more reasonable to have it in a single
> like. And it is legit too, since it is accepted by checkpatch.
>
> You might break the lines within 80 chars if it is somehow "logically"
> consistent.
FWIW, I've become kind of tired of the style wishywashyness I've
mostly been happy to accept anything that clang-format spits out for
ordinary C constructs.
It is good enough and universally usable. If devs don't have it linked
to their editor to format single expression or format selected blocks,
they are missing out :)
The community consensus on style is quite unclear. Is 1 or 2 above the
majority preference? Does this case fall under the new "use more than
80 cols if it improves readability?" I have no idea.
Frankly, for most people writing driver code, if they consistently use
clang-format their work will be alot better than if they try to do it
by hand. It takes a lot of experiance to reliably eyeball something
close to the kernel style..
Jason
Powered by blists - more mailing lists