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] [thread-next>] [day] [month] [year] [list]
Date: Wed, 24 Apr 2024 21:19:04 +0100
From: Conor Dooley <conor@...nel.org>
To: Stephen Boyd <sboyd@...nel.org>
Cc: linux-riscv@...ts.infradead.org,
	Conor Dooley <conor.dooley@...rochip.com>,
	Philipp Zabel <p.zabel@...gutronix.de>,
	Daire McNamara <daire.mcnamara@...rochip.com>,
	Michael Turquette <mturquette@...libre.com>,
	linux-clk@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH v2] clock, reset: microchip: move all mpfs reset code to
 the reset subsystem

On Wed, Apr 24, 2024 at 11:33:32AM -0700, Stephen Boyd wrote:
> Quoting Conor Dooley (2024-04-24 01:42:08)
> > diff --git a/drivers/reset/reset-mpfs.c b/drivers/reset/reset-mpfs.c
> > index 7f3fb2d472f4..710f9c1676f9 100644
> > --- a/drivers/reset/reset-mpfs.c
> > +++ b/drivers/reset/reset-mpfs.c
> > @@ -121,11 +135,15 @@ static int mpfs_reset_probe(struct auxiliary_device *adev,
> >  {
> >         struct device *dev = &adev->dev;
> >         struct reset_controller_dev *rcdev;
> > +       struct mpfs_reset *rst;
> >  
> > -       rcdev = devm_kzalloc(dev, sizeof(*rcdev), GFP_KERNEL);
> > -       if (!rcdev)
> > +       rst = devm_kzalloc(dev, sizeof(*rst), GFP_KERNEL);
> > +       if (!rst)
> >                 return -ENOMEM;
> >  
> > +       rst->base = (void __iomem *)adev->dev.platform_data;
> 
> Can use dev_get_platdata() here?
> 
> 	rst->base = (void __iomem *)dev_get_platdata(dev);
> 
> That's sad that a cast is necessary. Does it need __force as well? An
> alternative would be to make a container struct for auxiliary_device and
> put the pointer there.


Ye, I dunno if it was sparse that yelled at me, but either it or the
compiler didn't approve. I don't really like the casting in and out, but
the alternative I don't find elegant either, so I picked the one I deemed
simpler. I'm happy to go with whichever you prefer.

And re: __force, AFAIU that's only required while discarding the
__iomem, so the cast into the platform_data has one:
	adev->dev.platform_data = (__force void *)base;


Download attachment "signature.asc" of type "application/pgp-signature" (229 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ