From: Jason Gunthorpe <jgunthorpe@obsidianresearch.com>
To: Ashley Lai <adlai@linux.vnet.ibm.com>
Cc: tpmdd-devel@lists.sourceforge.net,
Peter Huewe <peterhuewe@gmx.de>,
linux-kernel@vger.kernel.org
Subject: Re: [tpmdd-devel] [PATCH 2/5 v2] tpm: Pull everything related to sysfs into tpm-sysfs.c
Date: Sat, 16 Nov 2013 17:24:11 -0700 [thread overview]
Message-ID: <20131117002411.GB22861@obsidianresearch.com> (raw)
In-Reply-To: <1384645999.7518.46.camel@fishsauce>
On Sat, Nov 16, 2013 at 05:53:19PM -0600, Ashley Lai wrote:
> > +/* XXX for now this helper is duplicated in tpm.c */
>
> I think you mean this is duplicated in tpm-interface.c. Is there a
> reason why we cannot add this to tpm.h to avoid this duplication?
Indeed, it was called tpm.c when I wrote it :)
I left it because I think there should be a public API to send a
command that makes sense, and transmit_cmd is not good. But, that can
come later, so lets share them for now.
> > +static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd,
> > + int len, const char *desc)
> > +{
>
>
> > +static ssize_t pubek_show(struct device *dev, struct device_attribute *attr,
> > + char *buf)
>
> Most of the functions in this file are moved from tpm-interface.c
> without any modification to the code. Why do we need to change the
> function names in this file? Unless there is a good reason for it
> otherwise I would prefer to keep the same function names.
When I did the sysfs attribute lists in this file I used the modern
sysfs macros:
>> +static DEVICE_ATTR_RO(pubek);
Which are safer to use, but do require the function name to match
the sysfs file name.
So all sysfs functions must be in the form <FILENAME>_show.
Jason
next prev parent reply other threads:[~2013-11-17 0:24 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-11-04 3:38 tpm: Remainder of earlier clean up Jason Gunthorpe
2013-11-04 3:38 ` [PATCH 1/5 v2] tpm: Pull everything related to /dev/tpmX into tpm-dev.c Jason Gunthorpe
2013-11-16 22:18 ` [tpmdd-devel] " Ashley Lai
2013-11-17 0:12 ` Jason Gunthorpe
2013-11-04 3:38 ` [PATCH 2/5 v2] tpm: Pull everything related to sysfs into tpm-sysfs.c Jason Gunthorpe
2013-11-16 23:53 ` [tpmdd-devel] " Ashley Lai
2013-11-17 0:24 ` Jason Gunthorpe [this message]
2013-11-04 3:38 ` [PATCH 3/5 v2] tpm: Create a tpm_class_ops structure and use it in the drivers Jason Gunthorpe
2013-11-17 0:57 ` [tpmdd-devel] " Ashley Lai
2013-11-04 3:38 ` [PATCH 4/5 v2] tpm: Use the ops structure instead of a copy in tpm_vendor_specific Jason Gunthorpe
2013-11-17 1:09 ` [tpmdd-devel] " Ashley Lai
2013-11-04 3:38 ` [PATCH 5/5 v2] tpm: Make tpm-dev allocate a per-file structure Jason Gunthorpe
2013-11-17 2:01 ` [tpmdd-devel] " Ashley Lai
2013-11-08 16:54 ` [tpmdd-devel] tpm: Remainder of earlier clean up Ashley Lai
2013-11-08 17:23 ` Aw: " Peter Huewe
2013-12-07 13:21 ` Peter Hüwe
2013-12-10 1:33 ` Jason Gunthorpe
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=20131117002411.GB22861@obsidianresearch.com \
--to=jgunthorpe@obsidianresearch.com \
--cc=adlai@linux.vnet.ibm.com \
--cc=linux-kernel@vger.kernel.org \
--cc=peterhuewe@gmx.de \
--cc=tpmdd-devel@lists.sourceforge.net \
/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®