* [PATCH] NFC: st95hf: clean up indentation, add in missing tab on return statement
@ 2018-12-30 13:38 Colin King
2018-12-31 9:07 ` Joe Perches
0 siblings, 1 reply; 2+ messages in thread
From: Colin King @ 2018-12-30 13:38 UTC (permalink / raw)
To: Samuel Ortiz, Daniel Mack, linux-wireless; +Cc: kernel-janitors, linux-kernel
From: Colin Ian King <colin.king@canonical.com>
A return statement is not indented enough, fix this by adding the
missing tab.
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
drivers/nfc/st95hf/core.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index a50a95cfcfd8..76d0ed14d6af 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -672,7 +672,7 @@ static int st95hf_error_handling(struct st95hf_context *stcontext,
result = -ETIMEDOUT;
else
result = -EIO;
- return result;
+ return result;
}
/* Check for CRC err only if CRC is present in the tag response */
--
2.19.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] NFC: st95hf: clean up indentation, add in missing tab on return statement
2018-12-30 13:38 [PATCH] NFC: st95hf: clean up indentation, add in missing tab on return statement Colin King
@ 2018-12-31 9:07 ` Joe Perches
0 siblings, 0 replies; 2+ messages in thread
From: Joe Perches @ 2018-12-31 9:07 UTC (permalink / raw)
To: Colin King, Samuel Ortiz, Daniel Mack, linux-wireless
Cc: kernel-janitors, linux-kernel
On Sun, 2018-12-30 at 13:38 +0000, Colin King wrote:
> A return statement is not indented enough, fix this by adding the
> missing tab.
[]
> diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
[]
> @@ -672,7 +672,7 @@ static int st95hf_error_handling(struct st95hf_context *stcontext,
> result = -ETIMEDOUT;
> else
> result = -EIO;
> - return result;
> + return result;
> }
>
> /* Check for CRC err only if CRC is present in the tag response */
trivia: this might read better using direct returns
drivers/nfc/st95hf/core.c | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/drivers/nfc/st95hf/core.c b/drivers/nfc/st95hf/core.c
index 2b26f762fbc3..227b5f6dc26f 100644
--- a/drivers/nfc/st95hf/core.c
+++ b/drivers/nfc/st95hf/core.c
@@ -662,17 +662,15 @@ static int st95hf_error_handling(struct st95hf_context *stcontext,
struct sk_buff *skb_resp,
int res_len)
{
- int result = 0;
unsigned char error_byte;
struct device *dev = &stcontext->nfcdev->dev;
/* First check ST95HF specific error */
if (skb_resp->data[0] & ST95HF_ERR_MASK) {
if (skb_resp->data[0] == ST95HF_TIMEOUT_ERROR)
- result = -ETIMEDOUT;
+ return -ETIMEDOUT;
else
- result = -EIO;
- return result;
+ return -EIO;
}
/* Check for CRC err only if CRC is present in the tag response */
@@ -684,7 +682,7 @@ static int st95hf_error_handling(struct st95hf_context *stcontext,
/* CRC error occurred */
dev_err(dev, "CRC error, byte received = 0x%x\n",
error_byte);
- result = -EIO;
+ return -EIO;
}
}
break;
@@ -695,12 +693,12 @@ static int st95hf_error_handling(struct st95hf_context *stcontext,
/* CRC error occurred */
dev_err(dev, "CRC error, byte received = 0x%x\n",
error_byte);
- result = -EIO;
+ return -EIO;
}
break;
}
- return result;
+ return 0;
}
static int st95hf_response_handler(struct st95hf_context *stcontext,
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2018-12-31 9:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-12-30 13:38 [PATCH] NFC: st95hf: clean up indentation, add in missing tab on return statement Colin King
2018-12-31 9:07 ` Joe Perches
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).