mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Colin King <colin.king@canonical.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	Daniel Mack <daniel@zonque.org>,
	linux-wireless@vger.kernel.org
Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] NFC: st95hf: clean up indentation, add in missing tab on return statement
Date: Mon, 31 Dec 2018 01:07:24 -0800	[thread overview]
Message-ID: <9de7579ee09f4b1724201c7d7655c539e0a35868.camel@perches.com> (raw)
In-Reply-To: <20181230133801.7237-1-colin.king@canonical.com>

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,



      reply	other threads:[~2018-12-31  9:07 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-30 13:38 Colin King
2018-12-31  9:07 ` Joe Perches [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=9de7579ee09f4b1724201c7d7655c539e0a35868.camel@perches.com \
    --to=joe@perches.com \
    --cc=colin.king@canonical.com \
    --cc=daniel@zonque.org \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=sameo@linux.intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®