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-prev] [day] [month] [year] [list]
Message-ID: <819718d731bc1496a75ebd0a4076d88273b21229.camel@linaro.org>
Date: Mon, 07 Apr 2025 12:04:19 +0100
From: André Draszik <andre.draszik@...aro.org>
To: Krzysztof Kozlowski <krzk@...nel.org>, Lee Jones <lee@...nel.org>, Rob
 Herring <robh@...nel.org>, Conor Dooley <conor+dt@...nel.org>, Sylwester
 Nawrocki	 <s.nawrocki@...sung.com>, Chanwoo Choi <cw00.choi@...sung.com>,
 Alim Akhtar	 <alim.akhtar@...sung.com>, Michael Turquette
 <mturquette@...libre.com>,  Stephen Boyd <sboyd@...nel.org>, Russell King
 <linux@...linux.org.uk>, Catalin Marinas	 <catalin.marinas@....com>, Will
 Deacon <will@...nel.org>, Alexandre Belloni	 <alexandre.belloni@...tlin.com>
Cc: Peter Griffin <peter.griffin@...aro.org>, Tudor Ambarus
	 <tudor.ambarus@...aro.org>, Will McVicker <willmcvicker@...gle.com>, 
	kernel-team@...roid.com, linux-kernel@...r.kernel.org, 
	linux-samsung-soc@...r.kernel.org, devicetree@...r.kernel.org, 
	linux-clk@...r.kernel.org, linux-arm-kernel@...ts.infradead.org, 
	linux-rtc@...r.kernel.org
Subject: Re: [PATCH v3 25/32] rtc: s5m: cache value of
 platform_get_device_id() during probe

On Sun, 2025-04-06 at 20:29 +0200, Krzysztof Kozlowski wrote:
> On 03/04/2025 10:59, André Draszik wrote:
> > platform_get_device_id() is called mulitple times during probe. This
> > makes the code harder to read than necessary.
> > 
> > Just get the ID once, which also trims the lengths of the lines
> > involved.
> > 
> > Signed-off-by: André Draszik <andre.draszik@...aro.org>
> > ---
> >  drivers/rtc/rtc-s5m.c | 8 +++++---
> >  1 file changed, 5 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/rtc/rtc-s5m.c b/drivers/rtc/rtc-s5m.c
> > index db5c9b641277213aa1371776c63e2eda3f223465..53c76b0e4253a9ba225c3c723d35d9182d071607 100644
> > --- a/drivers/rtc/rtc-s5m.c
> > +++ b/drivers/rtc/rtc-s5m.c
> > @@ -637,6 +637,8 @@ static int s5m8767_rtc_init_reg(struct s5m_rtc_info *info)
> >  static int s5m_rtc_probe(struct platform_device *pdev)
> >  {
> >  	struct sec_pmic_dev *s5m87xx = dev_get_drvdata(pdev->dev.parent);
> > +	const struct platform_device_id	* const id =
> > +		platform_get_device_id(pdev);
> 
> 
> If doing this, why not storing here driver data, so the enum type?

Good point, thanks Krzysztof

Cheers,
André



Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ