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: <20240830113206.5427-1-shenlichuan@vivo.com>
Date: Fri, 30 Aug 2024 19:32:06 +0800
From: Shen Lichuan <shenlichuan@...o.com>
To: rafal@...ecki.pl,
	florian.fainelli@...adcom.com,
	ulf.hansson@...aro.org
Cc: bcm-kernel-feedback-list@...adcom.com,
	linux-pm@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	opensource.kernel@...o.com,
	Shen Lichuan <shenlichuan@...o.com>
Subject: [PATCH v1] pmdomain: bcm: Convert to use dev_err_probe()

Use dev_err_probe() to simplify the error path and unify a message
template.

Using this helper is totally fine even if err is known to never
be -EPROBE_DEFER.

The benefit compared to a normal dev_err() is the standardized format
of the error code, it being emitted symbolically and the fact that
the error code is returned which allows more compact error paths.

Signed-off-by: Shen Lichuan <shenlichuan@...o.com>
---
 drivers/pmdomain/bcm/bcm-pmb.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/drivers/pmdomain/bcm/bcm-pmb.c b/drivers/pmdomain/bcm/bcm-pmb.c
index a72ba26ecf9d..ffd08f13d9ef 100644
--- a/drivers/pmdomain/bcm/bcm-pmb.c
+++ b/drivers/pmdomain/bcm/bcm-pmb.c
@@ -325,10 +325,8 @@ static int bcm_pmb_probe(struct platform_device *pdev)
 	}
 
 	err = of_genpd_add_provider_onecell(dev->of_node, &pmb->genpd_onecell_data);
-	if (err) {
-		dev_err(dev, "failed to add genpd provider: %d\n", err);
-		return err;
-	}
+	if (err)
+		return dev_err_probe(dev, err, "failed to add genpd provider\n");
 
 	return 0;
 }
-- 
2.17.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ