Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1699251 > unrolled thread
| Started by | SZ Lin <sz.lin@moxa.com> |
|---|---|
| First post | 2017-07-29 09:30 +0200 |
| Last post | 2017-07-31 12:30 +0200 |
| Articles | 5 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH 0/5] tpm: tpm_ibmvtpm: - style fix SZ Lin <sz.lin@moxa.com> - 2017-07-29 09:30 +0200
[PATCH 3/5] Fix 'void function return statements are not generally useful' warning SZ Lin <sz.lin@moxa.com> - 2017-07-29 09:30 +0200
[PATCH 4/5] Remove unneccessary 'out of memory' message SZ Lin <sz.lin@moxa.com> - 2017-07-29 09:30 +0200
[PATCH 2/5] Fix "ERROR: code indent should use tabs where possible" SZ Lin <sz.lin@moxa.com> - 2017-07-29 09:30 +0200
Re: [PATCH 2/5] Fix "ERROR: code indent should use tabs where possible" Michael Ellerman <mpe@ellerman.id.au> - 2017-07-31 12:30 +0200
| From | SZ Lin <sz.lin@moxa.com> |
|---|---|
| Date | 2017-07-29 09:30 +0200 |
| Subject | [PATCH 0/5] tpm: tpm_ibmvtpm: - style fix |
| Message-ID | <u8ume-7n2-5@gated-at.bofh.it> |
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
[toc] | [next] | [standalone]
| From | SZ Lin <sz.lin@moxa.com> |
|---|---|
| Date | 2017-07-29 09:30 +0200 |
| Subject | [PATCH 3/5] Fix 'void function return statements are not generally useful' warning |
| Message-ID | <u8ume-7n2-11@gated-at.bofh.it> |
| In reply to | #1699251 |
WARNING: void function return statements are not generally useful + return; +} Signed-off-by: SZ Lin <sz.lin@moxa.com> --- drivers/char/tpm/tpm_ibmvtpm.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c index 23913fc86158..e53b9fb517d9 100644 --- a/drivers/char/tpm/tpm_ibmvtpm.c +++ b/drivers/char/tpm/tpm_ibmvtpm.c @@ -531,7 +531,6 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq, return; } } - return; } /** -- 2.13.3
[toc] | [prev] | [next] | [standalone]
| From | SZ Lin <sz.lin@moxa.com> |
|---|---|
| Date | 2017-07-29 09:30 +0200 |
| Subject | [PATCH 4/5] Remove unneccessary 'out of memory' message |
| Message-ID | <u8ume-7n2-17@gated-at.bofh.it> |
| In reply to | #1699251 |
WARNING: Possible unnecessary 'out of memory' message
+ if (!ibmvtpm->rtce_buf) {
+ dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
WARNING: Possible unnecessary 'out of memory' message
+ if (!ibmvtpm) {
+ dev_err(dev, "kzalloc for ibmvtpm failed\n");
Signed-off-by: SZ Lin <sz.lin@moxa.com>
---
drivers/char/tpm/tpm_ibmvtpm.c | 8 ++------
1 file changed, 2 insertions(+), 6 deletions(-)
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index e53b9fb517d9..e75a674b44ac 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -501,10 +501,8 @@ static void ibmvtpm_crq_process(struct ibmvtpm_crq *crq,
ibmvtpm->rtce_size = be16_to_cpu(crq->len);
ibmvtpm->rtce_buf = kmalloc(ibmvtpm->rtce_size,
GFP_ATOMIC);
- if (!ibmvtpm->rtce_buf) {
- dev_err(ibmvtpm->dev, "Failed to allocate memory for rtce buffer\n");
+ if (!ibmvtpm->rtce_buf)
return;
- }
ibmvtpm->rtce_dma_handle = dma_map_single(ibmvtpm->dev,
ibmvtpm->rtce_buf, ibmvtpm->rtce_size,
@@ -584,10 +582,8 @@ static int tpm_ibmvtpm_probe(struct vio_dev *vio_dev,
return PTR_ERR(chip);
ibmvtpm = kzalloc(sizeof(struct ibmvtpm_dev), GFP_KERNEL);
- if (!ibmvtpm) {
- dev_err(dev, "kzalloc for ibmvtpm failed\n");
+ if (!ibmvtpm)
goto cleanup;
- }
ibmvtpm->dev = dev;
ibmvtpm->vdev = vio_dev;
--
2.13.3
[toc] | [prev] | [next] | [standalone]
| From | SZ Lin <sz.lin@moxa.com> |
|---|---|
| Date | 2017-07-29 09:30 +0200 |
| Subject | [PATCH 2/5] Fix "ERROR: code indent should use tabs where possible" |
| Message-ID | <u8ume-7n2-19@gated-at.bofh.it> |
| In reply to | #1699251 |
ERROR: code indent should use tabs where possible
+^I^I "Need to wait for TPM to finish\n");$
Signed-off-by: SZ Lin <sz.lin@moxa.com>
---
drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
index f01d083eced2..23913fc86158 100644
--- a/drivers/char/tpm/tpm_ibmvtpm.c
+++ b/drivers/char/tpm/tpm_ibmvtpm.c
@@ -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)
--
2.13.3
[toc] | [prev] | [next] | [standalone]
| From | Michael Ellerman <mpe@ellerman.id.au> |
|---|---|
| Date | 2017-07-31 12:30 +0200 |
| Subject | Re: [PATCH 2/5] Fix "ERROR: code indent should use tabs where possible" |
| Message-ID | <u9g7w-54B-21@gated-at.bofh.it> |
| In reply to | #1699255 |
SZ Lin <sz.lin@moxa.com> writes:
> ERROR: code indent should use tabs where possible
> +^I^I "Need to wait for TPM to finish\n");$
>
> Signed-off-by: SZ Lin <sz.lin@moxa.com>
> ---
> drivers/char/tpm/tpm_ibmvtpm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/char/tpm/tpm_ibmvtpm.c b/drivers/char/tpm/tpm_ibmvtpm.c
> index f01d083eced2..23913fc86158 100644
> --- a/drivers/char/tpm/tpm_ibmvtpm.c
> +++ b/drivers/char/tpm/tpm_ibmvtpm.c
> @@ -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
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web