aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPeter Huewe <peterhuewe@gmx.de>2013-10-21 18:29:14 -0400
committerPeter Huewe <peterhuewe@gmx.de>2013-10-22 13:42:48 -0400
commit0a4182692ef2b0131ffc9ae523c2dea0cd636201 (patch)
tree22c24fbc3bd44cda6b3a23e1185ff2da8eec36ea
parente907481bed439cd04fb24084baab41015b89da6e (diff)
tpm: cleanup checkpatch warnings
before we rename the file it might be a good idea to cleanup the long persisting checkpatch warnings. Since everything is really trivial, splitting the patch up would only result in noise. For the interested reader - here the checkpatch warnings: (regrouped for easer readability) ERROR: trailing whitespace + * Specifications at www.trustedcomputinggroup.org^I $ + * $ +^I/* $ +^I parameters (RSA 12->bytes: keybit, #primes, expbit) $ WARNING: unnecessary whitespace before a quoted newline + "invalid count value %x %zx \n", count, bufsiz); ERROR: do not use assignment in if condition + if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) { ERROR: space required after that ',' (ctx:VxV) + len = tpm_transmit(chip,(u8 *) cmd, len); ^ ERROR: "foo * bar" should be "foo *bar" +ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, +ssize_t tpm_show_temp_deactivated(struct device * dev, + struct device_attribute * attr, char *buf) WARNING: please, no space before tabs + * @chip_num: ^Itpm idx # or ANY$ + * @res_buf: ^ITPM_PCR value$ + * ^I^Isize of res_buf is 20 bytes (or NULL if you don't care)$ + * @chip_num: ^Itpm idx # or AN&$ + * @hash: ^Ihash value used to extend pcr value$ ERROR: code indent should use tabs where possible +^I TPM_ORD_CONTINUE_SELFTEST);$ WARNING: line over 80 characters +static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask, bool check_cancel, ERROR: trailing whitespace + * Called from tpm_<specific>.c probe function only for devices $ total: 16 errors, 7 warnings, 1554 lines checked Signed-off-by: Peter Huewe <peterhuewe@gmx.de>
-rw-r--r--drivers/char/tpm/tpm.c44
1 files changed, 22 insertions, 22 deletions
diff --git a/drivers/char/tpm/tpm.c b/drivers/char/tpm/tpm.c
index 72f0c68d466e..6ae41d337630 100644
--- a/drivers/char/tpm/tpm.c
+++ b/drivers/char/tpm/tpm.c
@@ -10,13 +10,13 @@
10 * Maintained by: <tpmdd-devel@lists.sourceforge.net> 10 * Maintained by: <tpmdd-devel@lists.sourceforge.net>
11 * 11 *
12 * Device driver for TCG/TCPA TPM (trusted platform module). 12 * Device driver for TCG/TCPA TPM (trusted platform module).
13 * Specifications at www.trustedcomputinggroup.org 13 * Specifications at www.trustedcomputinggroup.org
14 * 14 *
15 * This program is free software; you can redistribute it and/or 15 * This program is free software; you can redistribute it and/or
16 * modify it under the terms of the GNU General Public License as 16 * modify it under the terms of the GNU General Public License as
17 * published by the Free Software Foundation, version 2 of the 17 * published by the Free Software Foundation, version 2 of the
18 * License. 18 * License.
19 * 19 *
20 * Note, the TPM chip is not interrupt driven (only polling) 20 * Note, the TPM chip is not interrupt driven (only polling)
21 * and can have very long timeouts (minutes!). Hence the unusual 21 * and can have very long timeouts (minutes!). Hence the unusual
22 * calls to msleep. 22 * calls to msleep.
@@ -371,13 +371,14 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
371 return -ENODATA; 371 return -ENODATA;
372 if (count > bufsiz) { 372 if (count > bufsiz) {
373 dev_err(chip->dev, 373 dev_err(chip->dev,
374 "invalid count value %x %zx \n", count, bufsiz); 374 "invalid count value %x %zx\n", count, bufsiz);
375 return -E2BIG; 375 return -E2BIG;
376 } 376 }
377 377
378 mutex_lock(&chip->tpm_mutex); 378 mutex_lock(&chip->tpm_mutex);
379 379
380 if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) { 380 rc = chip->vendor.send(chip, (u8 *) buf, count);
381 if (rc < 0) {
381 dev_err(chip->dev, 382 dev_err(chip->dev,
382 "tpm_transmit: tpm_send: error %zd\n", rc); 383 "tpm_transmit: tpm_send: error %zd\n", rc);
383 goto out; 384 goto out;
@@ -444,7 +445,7 @@ static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd,
444{ 445{
445 int err; 446 int err;
446 447
447 len = tpm_transmit(chip,(u8 *) cmd, len); 448 len = tpm_transmit(chip, (u8 *) cmd, len);
448 if (len < 0) 449 if (len < 0)
449 return len; 450 return len;
450 else if (len < TPM_HEADER_SIZE) 451 else if (len < TPM_HEADER_SIZE)
@@ -658,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
658 return rc; 659 return rc;
659} 660}
660 661
661ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, 662ssize_t tpm_show_enabled(struct device *dev, struct device_attribute *attr,
662 char *buf) 663 char *buf)
663{ 664{
664 cap_t cap; 665 cap_t cap;
@@ -674,7 +675,7 @@ ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
674} 675}
675EXPORT_SYMBOL_GPL(tpm_show_enabled); 676EXPORT_SYMBOL_GPL(tpm_show_enabled);
676 677
677ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, 678ssize_t tpm_show_active(struct device *dev, struct device_attribute *attr,
678 char *buf) 679 char *buf)
679{ 680{
680 cap_t cap; 681 cap_t cap;
@@ -690,7 +691,7 @@ ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
690} 691}
691EXPORT_SYMBOL_GPL(tpm_show_active); 692EXPORT_SYMBOL_GPL(tpm_show_active);
692 693
693ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, 694ssize_t tpm_show_owned(struct device *dev, struct device_attribute *attr,
694 char *buf) 695 char *buf)
695{ 696{
696 cap_t cap; 697 cap_t cap;
@@ -706,8 +707,8 @@ ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
706} 707}
707EXPORT_SYMBOL_GPL(tpm_show_owned); 708EXPORT_SYMBOL_GPL(tpm_show_owned);
708 709
709ssize_t tpm_show_temp_deactivated(struct device * dev, 710ssize_t tpm_show_temp_deactivated(struct device *dev,
710 struct device_attribute * attr, char *buf) 711 struct device_attribute *attr, char *buf)
711{ 712{
712 cap_t cap; 713 cap_t cap;
713 ssize_t rc; 714 ssize_t rc;
@@ -769,10 +770,10 @@ static int __tpm_pcr_read(struct tpm_chip *chip, int pcr_idx, u8 *res_buf)
769 770
770/** 771/**
771 * tpm_pcr_read - read a pcr value 772 * tpm_pcr_read - read a pcr value
772 * @chip_num: tpm idx # or ANY 773 * @chip_num: tpm idx # or ANY
773 * @pcr_idx: pcr idx to retrieve 774 * @pcr_idx: pcr idx to retrieve
774 * @res_buf: TPM_PCR value 775 * @res_buf: TPM_PCR value
775 * size of res_buf is 20 bytes (or NULL if you don't care) 776 * size of res_buf is 20 bytes (or NULL if you don't care)
776 * 777 *
777 * The TPM driver should be built-in, but for whatever reason it 778 * The TPM driver should be built-in, but for whatever reason it
778 * isn't, protect against the chip disappearing, by incrementing 779 * isn't, protect against the chip disappearing, by incrementing
@@ -794,9 +795,9 @@ EXPORT_SYMBOL_GPL(tpm_pcr_read);
794 795
795/** 796/**
796 * tpm_pcr_extend - extend pcr value with hash 797 * tpm_pcr_extend - extend pcr value with hash
797 * @chip_num: tpm idx # or AN& 798 * @chip_num: tpm idx # or AN&
798 * @pcr_idx: pcr idx to extend 799 * @pcr_idx: pcr idx to extend
799 * @hash: hash value used to extend pcr value 800 * @hash: hash value used to extend pcr value
800 * 801 *
801 * The TPM driver should be built-in, but for whatever reason it 802 * The TPM driver should be built-in, but for whatever reason it
802 * isn't, protect against the chip disappearing, by incrementing 803 * isn't, protect against the chip disappearing, by incrementing
@@ -847,8 +848,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
847 unsigned long duration; 848 unsigned long duration;
848 struct tpm_cmd_t cmd; 849 struct tpm_cmd_t cmd;
849 850
850 duration = tpm_calc_ordinal_duration(chip, 851 duration = tpm_calc_ordinal_duration(chip, TPM_ORD_CONTINUE_SELFTEST);
851 TPM_ORD_CONTINUE_SELFTEST);
852 852
853 loops = jiffies_to_msecs(duration) / delay_msec; 853 loops = jiffies_to_msecs(duration) / delay_msec;
854 854
@@ -965,12 +965,12 @@ ssize_t tpm_show_pubek(struct device *dev, struct device_attribute *attr,
965 if (err) 965 if (err)
966 goto out; 966 goto out;
967 967
968 /* 968 /*
969 ignore header 10 bytes 969 ignore header 10 bytes
970 algorithm 32 bits (1 == RSA ) 970 algorithm 32 bits (1 == RSA )
971 encscheme 16 bits 971 encscheme 16 bits
972 sigscheme 16 bits 972 sigscheme 16 bits
973 parameters (RSA 12->bytes: keybit, #primes, expbit) 973 parameters (RSA 12->bytes: keybit, #primes, expbit)
974 keylenbytes 32 bits 974 keylenbytes 32 bits
975 256 byte modulus 975 256 byte modulus
976 ignore checksum 20 bytes 976 ignore checksum 20 bytes
@@ -1092,8 +1092,8 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
1092} 1092}
1093EXPORT_SYMBOL_GPL(tpm_store_cancel); 1093EXPORT_SYMBOL_GPL(tpm_store_cancel);
1094 1094
1095static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask, bool check_cancel, 1095static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask,
1096 bool *canceled) 1096 bool check_cancel, bool *canceled)
1097{ 1097{
1098 u8 status = chip->vendor.status(chip); 1098 u8 status = chip->vendor.status(chip);
1099 1099
@@ -1463,7 +1463,7 @@ void tpm_dev_release(struct device *dev)
1463EXPORT_SYMBOL_GPL(tpm_dev_release); 1463EXPORT_SYMBOL_GPL(tpm_dev_release);
1464 1464
1465/* 1465/*
1466 * Called from tpm_<specific>.c probe function only for devices 1466 * Called from tpm_<specific>.c probe function only for devices
1467 * the driver has determined it should claim. Prior to calling 1467 * the driver has determined it should claim. Prior to calling
1468 * this function the specific probe function has called pci_enable_device 1468 * this function the specific probe function has called pci_enable_device
1469 * upon errant exit from this function specific probe function should call 1469 * upon errant exit from this function specific probe function should call