The Linux Kernel Mailing List
 help / color / mirror / Atom feed
From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: linux-mtd@lists.infradead.org, linux-kernel@vger.kernel.org
Cc: Miquel Raynal <miquel.raynal@bootlin.com>,
	Richard Weinberger <richard@nod.at>,
	Vignesh Raghavendra <vigneshr@ti.com>,
	Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Subject: [PATCH v1 1/1] mtd: core: Align comment with an action in mtd_otp_nvmem_add()
Date: Mon, 25 Mar 2024 17:11:50 +0200	[thread overview]
Message-ID: <20240325151150.3368658-1-andriy.shevchenko@linux.intel.com> (raw)

The comment is related to the non-error case, make it more clear
by inverting the condition. It also makes code neater at the end.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 drivers/mtd/mtdcore.c | 7 +++----
 1 file changed, 3 insertions(+), 4 deletions(-)

diff --git a/drivers/mtd/mtdcore.c b/drivers/mtd/mtdcore.c
index 9e18422fdc77..d0c231600f84 100644
--- a/drivers/mtd/mtdcore.c
+++ b/drivers/mtd/mtdcore.c
@@ -1015,10 +1015,9 @@ static int mtd_otp_nvmem_add(struct mtd_info *mtd)
 err:
 	nvmem_unregister(mtd->otp_user_nvmem);
 	/* Don't report error if OTP is not supported. */
-	if (err != -EOPNOTSUPP)
-		return dev_err_probe(dev, err,
-				     "Failed to register OTP NVMEM device\n");
-	return 0;
+	if (err == -EOPNOTSUPP)
+		return 0;
+	return dev_err_probe(dev, err, "Failed to register OTP NVMEM device\n");
 }
 
 /**
-- 
2.43.0.rc1.1.gbec44491f096


             reply	other threads:[~2024-03-25 15:11 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-25 15:11 Andy Shevchenko [this message]
2024-03-25 15:28 ` [PATCH v1 1/1] mtd: core: Align comment with an action in mtd_otp_nvmem_add() Andy Shevchenko
2024-03-25 15:49   ` Miquel Raynal
2024-03-25 16:22 ` Pratyush Yadav
2024-04-09  6:40 ` Miquel Raynal

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=20240325151150.3368658-1-andriy.shevchenko@linux.intel.com \
    --to=andriy.shevchenko@linux.intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mtd@lists.infradead.org \
    --cc=miquel.raynal@bootlin.com \
    --cc=richard@nod.at \
    --cc=vigneshr@ti.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