From: Jarkko Sakkinen <jarkko@kernel.org>
To: Jason Gunthorpe <jgg@ziepe.ca>
Cc: David Laight <David.Laight@aculab.com>,
Lino Sanfilippo <LinoSanfilippo@gmx.de>,
"peterhuewe@gmx.de" <peterhuewe@gmx.de>,
"stefanb@linux.vnet.ibm.com" <stefanb@linux.vnet.ibm.com>,
"James.Bottomley@hansenpartnership.com"
<James.Bottomley@hansenpartnership.com>,
"linux-integrity@vger.kernel.org"
<linux-integrity@vger.kernel.org>,
"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
Lino Sanfilippo <l.sanfilippo@kunbus.com>
Subject: Re: [PATCH v4] tpm: fix reference counting for struct tpm_chip
Date: Fri, 19 Feb 2021 09:07:44 +0200 [thread overview]
Message-ID: <YC9jwIFUzP+aRal0@kernel.org> (raw)
In-Reply-To: <20210218012702.GX4718@ziepe.ca>
On Wed, Feb 17, 2021 at 09:27:02PM -0400, Jason Gunthorpe wrote:
> 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.
A. I would not mind if it was already merged. Since it isn't, I don't
see the point not fixing it.
> 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.
B. I need to maintain this, once it's merged.
C. A smaller diff for a critical bug fix. I actually allow style
compromises for fixes to be backported *when* it makes the overall
diff smaller.
D. Has more odds to make future changes smaller as the whole thing is
in a single code line.
> 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..
For me it gives a framework to review patches in multiple subsystems.
If I have to constantly think whether to allow this and that shift
from the kernel coding style, it makes the whole process for me more
fuzzy and chaotic.
As I said (A), it would not be end of the world if this had been
merged already. I also want to state that I do sometimes make mistakes
when reviewing code, and am happy to take critique from that :-)
> Jason
/Jarkko
next prev parent reply other threads:[~2021-02-19 7:08 UTC|newest]
Thread overview: 16+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-02-16 0:30 [PATCH v4] TPM fixes Lino Sanfilippo
2021-02-16 0:31 ` [PATCH v4] tpm: fix reference counting for struct tpm_chip Lino Sanfilippo
2021-02-16 8:27 ` Jarkko Sakkinen
2021-02-16 12:53 ` Jason Gunthorpe
2021-02-16 16:04 ` Jarkko Sakkinen
2021-02-16 16:09 ` Jarkko Sakkinen
2021-02-16 16:11 ` Jarkko Sakkinen
2021-02-16 19:08 ` Lino Sanfilippo
2021-02-16 16:31 ` David Laight
2021-02-17 22:14 ` Jarkko Sakkinen
2021-02-18 1:27 ` Jason Gunthorpe
2021-02-19 7:07 ` Jarkko Sakkinen [this message]
2021-02-16 19:15 ` Lino Sanfilippo
2021-02-16 19:04 ` Lino Sanfilippo
2021-02-16 16:52 ` Stefan Berger
2021-02-16 19:17 ` Lino Sanfilippo
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=YC9jwIFUzP+aRal0@kernel.org \
--to=jarkko@kernel.org \
--cc=David.Laight@aculab.com \
--cc=James.Bottomley@hansenpartnership.com \
--cc=LinoSanfilippo@gmx.de \
--cc=jgg@ziepe.ca \
--cc=l.sanfilippo@kunbus.com \
--cc=linux-integrity@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=stefanb@linux.vnet.ibm.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;
as well as URLs for NNTP newsgroup(s).