Fix styling WARNINGs and Errors of tpm_ibmvtpm.c driver by using checkpatch.pl
SZ Lin (5):
Fix packed and aligned attribute warnings.
Fix "ERROR: code indent should use tabs where possible"
Fix 'void function return statements are not generally useful' warning
Remove unneccessary 'out of memory' message
Use __func__ instead of function name
drivers/char/tpm/tpm_ibmvtpm.c | 23 +++++++++--------------
drivers/char/tpm/tpm_ibmvtpm.h | 2 +-
2 files changed, 10 insertions(+), 15 deletions(-)
--
2.13.3
ERROR: code indent should use tabs where possible
+^I^I "Need to wait for TPM to finish\n");$
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -127,7 +127,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)if(ibmvtpm->tpm_processing_cmd){dev_info(ibmvtpm->dev,-"Need to wait for TPM to finish\n");+"Need to wait for TPM to finish\n");/* wait for previous command to finish */sig=wait_event_interruptible(ibmvtpm->wq,!ibmvtpm->tpm_processing_cmd);if(sig)
Fix following checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
the function's name, in a string
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2017-07-31 10:25:06
SZ Lin [off-list ref] writes:
quoted hunk
ERROR: code indent should use tabs where possible
+^I^I "Need to wait for TPM to finish\n");$
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
@@ -127,7 +127,7 @@ static int tpm_ibmvtpm_send(struct tpm_chip *chip, u8 *buf, size_t count)if(ibmvtpm->tpm_processing_cmd){dev_info(ibmvtpm->dev,-"Need to wait for TPM to finish\n");+"Need to wait for TPM to finish\n");
There's no reason for that to be on a separate line at all. Just make it
a single line dev_info( ... );
cheers
You can't need __packed and __aligned(8) on that structure.
There are no gaps and you are saying it is always aligned.
So just remove the pointless attributes.
David
From: Jarkko Sakkinen <hidden> Date: 2017-08-02 12:36:25
On Sat, Jul 29, 2017 at 03:24:28PM +0800, SZ Lin wrote:
Fix styling WARNINGs and Errors of tpm_ibmvtpm.c driver by using checkpatch.pl
Changes are great but you should revise the patch series so that you
expain in each commit what goes wrong instead of copy paste of the
checkpatch output and why your changes fixes the problem.
SZ Lin (5):
Fix packed and aligned attribute warnings.
Fix "ERROR: code indent should use tabs where possible"
Fix 'void function return statements are not generally useful' warning
Remove unneccessary 'out of memory' message
Use __func__ instead of function name
drivers/char/tpm/tpm_ibmvtpm.c | 23 +++++++++--------------
drivers/char/tpm/tpm_ibmvtpm.h | 2 +-
2 files changed, 10 insertions(+), 15 deletions(-)
--
2.13.3
From: Michal Suchánek <hidden> Date: 2017-08-18 08:03:32
On 2017-07-29 09:24, SZ Lin wrote:
quoted hunk
Fix following checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
the function's name, in a string
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c
b/drivers/char/tpm/tpm_ibmvtpm.c
index e75a674b44ac..2d33acc43e25 100644
Can function name contain a %?
I would prefer dev_err(ibmvtpm->dev, __func__ " failed rc=%d\n", rc);
It's not what checkpatch advises in the above message, though.
Presumably with many messages from the same function using %s would
save space but that is not the usual case.
Thanks
Michal
From: Michael Ellerman <mpe@ellerman.id.au> Date: 2017-08-18 11:25:43
Michal Such=C3=A1nek [off-list ref] writes:
On 2017-07-29 09:24, SZ Lin wrote:
quoted
Fix following checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
the function's name, in a string
=20
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
=20
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c=20
b/drivers/char/tpm/tpm_ibmvtpm.c
index e75a674b44ac..2d33acc43e25 100644
Fix following checkpatch.pl warning:
WARNING: Prefer using '"%s...", __func__' to using
the function's name, in a string
Signed-off-by: SZ Lin <redacted>
---
drivers/char/tpm/tpm_ibmvtpm.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)