All of lore.kernel.org
 help / color / mirror / Atom feed
From: Nayna <nayna-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
To: Jarkko Sakkinen
	<jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>,
	Tomas Winkler
	<tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
Cc: tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org,
	linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
Subject: Re: [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd
Date: Tue, 6 Dec 2016 14:46:43 +0530	[thread overview]
Message-ID: <584681FB.2070708@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161203153236.jmulnrlvoitvjnhq-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>



On 12/03/2016 09:02 PM, Jarkko Sakkinen wrote:
> On Wed, Nov 23, 2016 at 12:04:11PM +0200, Tomas Winkler wrote:
>> Functions tpm_transmit and transmit_cmd are referenced
>> from other functions kdoc hence deserve documentation.
>>
>> Signed-off-by: Tomas Winkler <tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
>
> Do you mind if I change TPM_DIGEST_SIZE to SHA1_DIGEST_SIZE?
>
> I'm looking to drop TPM_DIGEST_SIZE eventually.

I was thinking if we should use SHA1_DIGEST_SIZE directly from
<crypto/sha.h>, or probably <crypto/hash_info.h>

Thanks & Regards,
     - Nayna


>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org>
>
> /Jarkko
>
>> ---
>> V2: Add some missing '.'
>>   drivers/char/tpm/tpm-interface.c | 33 ++++++++++++++++++++++++++++-----
>>   1 file changed, 28 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
>> index a2688ac2b48f..769d8b0d31a3 100644
>> --- a/drivers/char/tpm/tpm-interface.c
>> +++ b/drivers/char/tpm/tpm-interface.c
>> @@ -328,8 +328,17 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
>>   }
>>   EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
>>
>> -/*
>> - * Internal kernel interface to transmit TPM commands
>> +/**
>> + * tmp_transmit - Internal kernel interface to transmit TPM commands.
>> + *
>> + * @chip: TPM chip to use
>> + * @buf: TPM command buffer
>> + * @bufsiz: length of the TPM command buffer
>> + * @flags: tpm transmit flags - bitmap
>> + *
>> + * Return:
>> + *     0 when the operation is successful.
>> + *     A negative number for system errors (errno).
>>    */
>>   ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
>>   		     unsigned int flags)
>> @@ -409,9 +418,21 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
>>   	return rc;
>>   }
>>
>> -#define TPM_DIGEST_SIZE 20
>> -#define TPM_RET_CODE_IDX 6
>> -
>> +/**
>> + * tmp_transmit_cmd - send a tpm command to the device
>> + *    The function extracts tpm out header return code
>> + *
>> + * @chip: TPM chip to use
>> + * @cmd: TPM command buffer
>> + * @len: length of the TPM command
>> + * @flags: tpm transmit flags - bitmap
>> + * @desc: command description used in the error message
>> + *
>> + * Return:
>> + *     0 when the operation is successful.
>> + *     A negative number for system errors (errno).
>> + *     A positive number for a TPM error.
>> + */
>>   ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
>>   			 int len, unsigned int flags, const char *desc)
>>   {
>> @@ -434,6 +455,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
>>   	return err;
>>   }
>>
>> +#define TPM_DIGEST_SIZE 20
>> +#define TPM_RET_CODE_IDX 6
>>   #define TPM_INTERNAL_RESULT_SIZE 200
>>   #define TPM_ORD_GET_CAP cpu_to_be32(101)
>>   #define TPM_ORD_GET_RANDOM cpu_to_be32(70)
>> --
>> 2.7.4
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
>


------------------------------------------------------------------------------
Developer Access Program for Intel Xeon Phi Processors
Access to Intel Xeon Phi processor-based developer platforms.
With one year of Intel Parallel Studio XE.
Training and support from Colfax.
Order your platform today.http://sdm.link/xeonphi

WARNING: multiple messages have this Message-ID (diff)
From: Nayna <nayna@linux.vnet.ibm.com>
To: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>,
	Tomas Winkler <tomas.winkler@intel.com>
Cc: tpmdd-devel@lists.sourceforge.net, linux-kernel@vger.kernel.org
Subject: Re: [tpmdd-devel] [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd
Date: Tue, 6 Dec 2016 14:46:43 +0530	[thread overview]
Message-ID: <584681FB.2070708@linux.vnet.ibm.com> (raw)
In-Reply-To: <20161203153236.jmulnrlvoitvjnhq@intel.com>



On 12/03/2016 09:02 PM, Jarkko Sakkinen wrote:
> On Wed, Nov 23, 2016 at 12:04:11PM +0200, Tomas Winkler wrote:
>> Functions tpm_transmit and transmit_cmd are referenced
>> from other functions kdoc hence deserve documentation.
>>
>> Signed-off-by: Tomas Winkler <tomas.winkler@intel.com>
>
> Do you mind if I change TPM_DIGEST_SIZE to SHA1_DIGEST_SIZE?
>
> I'm looking to drop TPM_DIGEST_SIZE eventually.

I was thinking if we should use SHA1_DIGEST_SIZE directly from
<crypto/sha.h>, or probably <crypto/hash_info.h>

Thanks & Regards,
     - Nayna


>
> Reviewed-by: Jarkko Sakkinen <jarkko.sakkinen@linux.intel.com>
>
> /Jarkko
>
>> ---
>> V2: Add some missing '.'
>>   drivers/char/tpm/tpm-interface.c | 33 ++++++++++++++++++++++++++++-----
>>   1 file changed, 28 insertions(+), 5 deletions(-)
>>
>> diff --git a/drivers/char/tpm/tpm-interface.c b/drivers/char/tpm/tpm-interface.c
>> index a2688ac2b48f..769d8b0d31a3 100644
>> --- a/drivers/char/tpm/tpm-interface.c
>> +++ b/drivers/char/tpm/tpm-interface.c
>> @@ -328,8 +328,17 @@ unsigned long tpm_calc_ordinal_duration(struct tpm_chip *chip,
>>   }
>>   EXPORT_SYMBOL_GPL(tpm_calc_ordinal_duration);
>>
>> -/*
>> - * Internal kernel interface to transmit TPM commands
>> +/**
>> + * tmp_transmit - Internal kernel interface to transmit TPM commands.
>> + *
>> + * @chip: TPM chip to use
>> + * @buf: TPM command buffer
>> + * @bufsiz: length of the TPM command buffer
>> + * @flags: tpm transmit flags - bitmap
>> + *
>> + * Return:
>> + *     0 when the operation is successful.
>> + *     A negative number for system errors (errno).
>>    */
>>   ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
>>   		     unsigned int flags)
>> @@ -409,9 +418,21 @@ ssize_t tpm_transmit(struct tpm_chip *chip, const u8 *buf, size_t bufsiz,
>>   	return rc;
>>   }
>>
>> -#define TPM_DIGEST_SIZE 20
>> -#define TPM_RET_CODE_IDX 6
>> -
>> +/**
>> + * tmp_transmit_cmd - send a tpm command to the device
>> + *    The function extracts tpm out header return code
>> + *
>> + * @chip: TPM chip to use
>> + * @cmd: TPM command buffer
>> + * @len: length of the TPM command
>> + * @flags: tpm transmit flags - bitmap
>> + * @desc: command description used in the error message
>> + *
>> + * Return:
>> + *     0 when the operation is successful.
>> + *     A negative number for system errors (errno).
>> + *     A positive number for a TPM error.
>> + */
>>   ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
>>   			 int len, unsigned int flags, const char *desc)
>>   {
>> @@ -434,6 +455,8 @@ ssize_t tpm_transmit_cmd(struct tpm_chip *chip, const void *cmd,
>>   	return err;
>>   }
>>
>> +#define TPM_DIGEST_SIZE 20
>> +#define TPM_RET_CODE_IDX 6
>>   #define TPM_INTERNAL_RESULT_SIZE 200
>>   #define TPM_ORD_GET_CAP cpu_to_be32(101)
>>   #define TPM_ORD_GET_RANDOM cpu_to_be32(70)
>> --
>> 2.7.4
>>
>
> ------------------------------------------------------------------------------
> Check out the vibrant tech community on one of the world's most
> engaging tech sites, SlashDot.org! http://sdm.link/slashdot
> _______________________________________________
> tpmdd-devel mailing list
> tpmdd-devel@lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/tpmdd-devel
>

  parent reply	other threads:[~2016-12-06  9:16 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-11-23 10:04 [PATCH v2 0/4] tpm: kdoc cleanup Tomas Winkler
     [not found] ` <1479895454-15076-1-git-send-email-tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-11-23 10:04   ` [PATCH v2 1/4] tpm: add kdoc for tpm_transmit and tpm_transmit_cmd Tomas Winkler
2016-11-23 10:04     ` Tomas Winkler
     [not found]     ` <1479895454-15076-2-git-send-email-tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 15:32       ` Jarkko Sakkinen
2016-12-03 15:32         ` Jarkko Sakkinen
     [not found]         ` <20161203153236.jmulnrlvoitvjnhq-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 16:15           ` Jarkko Sakkinen
2016-12-03 16:15             ` Jarkko Sakkinen
2016-12-06  9:16           ` Nayna [this message]
2016-12-06  9:16             ` [tpmdd-devel] " Nayna
     [not found]             ` <584681FB.2070708-23VcF4HTsmIX0ybBhKVfKdBPR1lH4CV8@public.gmane.org>
2016-12-06 12:11               ` Winkler, Tomas
2016-12-06 12:11                 ` [tpmdd-devel] " Winkler, Tomas
2016-11-23 10:04   ` [PATCH v2 2/4] tpm/tpm2-chip: fix kdoc errors Tomas Winkler
2016-11-23 10:04     ` Tomas Winkler
     [not found]     ` <1479895454-15076-3-git-send-email-tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 15:34       ` Jarkko Sakkinen
2016-12-03 15:34         ` Jarkko Sakkinen
     [not found]         ` <20161203153417.r4fue7uoka3xcaqo-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 16:16           ` Jarkko Sakkinen
2016-12-03 16:16             ` Jarkko Sakkinen
2016-11-23 10:04   ` [PATCH v2 3/4] tmp: use pdev for parent device in tpm_chip_alloc Tomas Winkler
2016-11-23 10:04     ` Tomas Winkler
2016-12-03 15:35     ` Jarkko Sakkinen
     [not found]       ` <20161203153530.yk3ilrg74qwg2f7a-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org>
2016-12-03 16:16         ` Jarkko Sakkinen
2016-12-03 16:16           ` Jarkko Sakkinen
2016-11-23 10:04   ` [PATCH v2 4/4] tpm/vtpm: fix kdoc warnings Tomas Winkler
2016-11-23 10:04     ` Tomas Winkler
2016-12-03 15:36     ` Jarkko Sakkinen
2016-12-03 16:17       ` Jarkko Sakkinen
2016-11-23 15:59   ` [PATCH v2 0/4] tpm: kdoc cleanup Jarkko Sakkinen
2016-11-23 15:59     ` Jarkko Sakkinen
2016-11-24 13:19   ` Jarkko Sakkinen
2016-11-24 13:19     ` Jarkko Sakkinen
2016-12-03 16:19   ` Jarkko Sakkinen
2016-12-03 16:19     ` Jarkko Sakkinen

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=584681FB.2070708@linux.vnet.ibm.com \
    --to=nayna-23vcf4htsmix0ybbhkvfkdbpr1lh4cv8@public.gmane.org \
    --cc=jarkko.sakkinen-VuQAYsv1563Yd54FQh9/CA@public.gmane.org \
    --cc=linux-kernel-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=tomas.winkler-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=tpmdd-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.