Commit 0a418269 authored by Peter Huewe's avatar Peter Huewe

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: default avatarPeter Huewe <peterhuewe@gmx.de>
parent e907481b
...@@ -371,13 +371,14 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf, ...@@ -371,13 +371,14 @@ static ssize_t tpm_transmit(struct tpm_chip *chip, const char *buf,
return -ENODATA; return -ENODATA;
if (count > bufsiz) { if (count > bufsiz) {
dev_err(chip->dev, dev_err(chip->dev,
"invalid count value %x %zx \n", count, bufsiz); "invalid count value %x %zx\n", count, bufsiz);
return -E2BIG; return -E2BIG;
} }
mutex_lock(&chip->tpm_mutex); mutex_lock(&chip->tpm_mutex);
if ((rc = chip->vendor.send(chip, (u8 *) buf, count)) < 0) { rc = chip->vendor.send(chip, (u8 *) buf, count);
if (rc < 0) {
dev_err(chip->dev, dev_err(chip->dev,
"tpm_transmit: tpm_send: error %zd\n", rc); "tpm_transmit: tpm_send: error %zd\n", rc);
goto out; goto out;
...@@ -444,7 +445,7 @@ static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd, ...@@ -444,7 +445,7 @@ static ssize_t transmit_cmd(struct tpm_chip *chip, struct tpm_cmd_t *cmd,
{ {
int err; int err;
len = tpm_transmit(chip,(u8 *) cmd, len); len = tpm_transmit(chip, (u8 *) cmd, len);
if (len < 0) if (len < 0)
return len; return len;
else if (len < TPM_HEADER_SIZE) else if (len < TPM_HEADER_SIZE)
...@@ -658,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip) ...@@ -658,7 +659,7 @@ static int tpm_continue_selftest(struct tpm_chip *chip)
return rc; return rc;
} }
ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, ssize_t tpm_show_enabled(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
cap_t cap; cap_t cap;
...@@ -674,7 +675,7 @@ ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr, ...@@ -674,7 +675,7 @@ ssize_t tpm_show_enabled(struct device * dev, struct device_attribute * attr,
} }
EXPORT_SYMBOL_GPL(tpm_show_enabled); EXPORT_SYMBOL_GPL(tpm_show_enabled);
ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, ssize_t tpm_show_active(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
cap_t cap; cap_t cap;
...@@ -690,7 +691,7 @@ ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr, ...@@ -690,7 +691,7 @@ ssize_t tpm_show_active(struct device * dev, struct device_attribute * attr,
} }
EXPORT_SYMBOL_GPL(tpm_show_active); EXPORT_SYMBOL_GPL(tpm_show_active);
ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, ssize_t tpm_show_owned(struct device *dev, struct device_attribute *attr,
char *buf) char *buf)
{ {
cap_t cap; cap_t cap;
...@@ -706,8 +707,8 @@ ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr, ...@@ -706,8 +707,8 @@ ssize_t tpm_show_owned(struct device * dev, struct device_attribute * attr,
} }
EXPORT_SYMBOL_GPL(tpm_show_owned); EXPORT_SYMBOL_GPL(tpm_show_owned);
ssize_t tpm_show_temp_deactivated(struct device * dev, ssize_t tpm_show_temp_deactivated(struct device *dev,
struct device_attribute * attr, char *buf) struct device_attribute *attr, char *buf)
{ {
cap_t cap; cap_t cap;
ssize_t rc; ssize_t rc;
...@@ -847,8 +848,7 @@ int tpm_do_selftest(struct tpm_chip *chip) ...@@ -847,8 +848,7 @@ int tpm_do_selftest(struct tpm_chip *chip)
unsigned long duration; unsigned long duration;
struct tpm_cmd_t cmd; struct tpm_cmd_t cmd;
duration = tpm_calc_ordinal_duration(chip, duration = tpm_calc_ordinal_duration(chip, TPM_ORD_CONTINUE_SELFTEST);
TPM_ORD_CONTINUE_SELFTEST);
loops = jiffies_to_msecs(duration) / delay_msec; loops = jiffies_to_msecs(duration) / delay_msec;
...@@ -1092,8 +1092,8 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr, ...@@ -1092,8 +1092,8 @@ ssize_t tpm_store_cancel(struct device *dev, struct device_attribute *attr,
} }
EXPORT_SYMBOL_GPL(tpm_store_cancel); EXPORT_SYMBOL_GPL(tpm_store_cancel);
static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask, bool check_cancel, static bool wait_for_tpm_stat_cond(struct tpm_chip *chip, u8 mask,
bool *canceled) bool check_cancel, bool *canceled)
{ {
u8 status = chip->vendor.status(chip); u8 status = chip->vendor.status(chip);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment