lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240325151150.3368658-1-andriy.shevchenko@linux.intel.com>
Date: Mon, 25 Mar 2024 17:11:50 +0200
From: Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
To: linux-mtd@...ts.infradead.org,
	linux-kernel@...r.kernel.org
Cc: Miquel Raynal <miquel.raynal@...tlin.com>,
	Richard Weinberger <richard@....at>,
	Vignesh Raghavendra <vigneshr@...com>,
	Andy Shevchenko <andriy.shevchenko@...ux.intel.com>
Subject: [PATCH v1 1/1] mtd: core: Align comment with an action in mtd_otp_nvmem_add()

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@...ux.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


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ