diff mbox series

NFC: st95hf: clean up indentation, add in missing tab on return statement

Message ID 20181230133801.7237-1-colin.king@canonical.com (mailing list archive)
State Deferred
Delegated to: Samuel Ortiz
Headers show
Series NFC: st95hf: clean up indentation, add in missing tab on return statement | expand

Commit Message

Colin King Dec. 30, 2018, 1:38 p.m. UTC
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(-)

Comments

Joe Perches Dec. 31, 2018, 9:07 a.m. UTC | #1
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,
diff mbox series

Patch

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 */