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]
Message-ID: <CAKxU2N-b-qJNqdF94Q_cjFv9NU3r0KDNXtdzOTPenJYRyKqaGA@mail.gmail.com>
Date: Sun, 25 May 2025 21:59:57 -0700
From: Rosen Penev <rosenp@...il.com>
To: Krzysztof Kozlowski <krzk@...nel.org>
Cc: linux-wireless@...r.kernel.org, Toke Høiland-Jørgensen <toke@...e.dk>, 
	nbd@....name, Johannes Berg <johannes@...solutions.net>, Rob Herring <robh@...nel.org>, 
	Krzysztof Kozlowski <krzk+dt@...nel.org>, Conor Dooley <conor+dt@...nel.org>, 
	Thomas Bogendoerfer <tsbogend@...ha.franken.de>, 
	"open list:OPEN FIRMWARE AND FLATTENED DEVICE TREE BINDINGS" <devicetree@...r.kernel.org>, open list <linux-kernel@...r.kernel.org>, 
	"open list:MIPS" <linux-mips@...r.kernel.org>
Subject: Re: [PATCHv4 4/5] wifi: ath9k: ahb: replace id_table with of

On Sun, May 25, 2025 at 9:30 PM Krzysztof Kozlowski <krzk@...nel.org> wrote:
>
> On 25/05/2025 23:42, Rosen Penev wrote:
> > @@ -72,20 +55,15 @@ static const struct ath_bus_ops ath_ahb_bus_ops  = {
> >
> >  static int ath_ahb_probe(struct platform_device *pdev)
> >  {
> > -     const struct platform_device_id *id = platform_get_device_id(pdev);
> >       struct ieee80211_hw *hw;
> >       struct ath_softc *sc;
> >       struct ath_hw *ah;
> >       void __iomem *mem;
> >       char hw_name[64];
> > +     u16 dev_id;
>
> I don't think these are u16 in the headers, but unsigned int.
Sure. I can change to int or kernel_ulong_t. It doesn't matter much.
The function that uses this has an int parameter, so might make sense
to use that.
>
> >       int irq;
> >       int ret;
> >
> > -     if (!dev_get_platdata(&pdev->dev)) {
> > -             dev_err(&pdev->dev, "no platform data specified\n");
> > -             return -EINVAL;
> > -     }
> > -
> >       mem = devm_platform_ioremap_resource(pdev, 0);
> >       if (IS_ERR(mem)) {
> >               dev_err(&pdev->dev, "ioremap failed\n");
> > @@ -118,7 +96,8 @@ static int ath_ahb_probe(struct platform_device *pdev)
> >               goto err_free_hw;
> >       }
> >
> > -     ret = ath9k_init_device(id->driver_data, sc, &ath_ahb_bus_ops);
> > +     dev_id = (u16)(kernel_ulong_t)of_device_get_match_data(&pdev->dev);
>
> u16 cast looks not needed.
Correct. It's placed for extra clarity, although probably not needed.
>
>
> > +     ret = ath9k_init_device(dev_id, sc, &ath_ahb_bus_ops);
> >       if (ret) {
> >               dev_err(&pdev->dev, "failed to initialize device\n");
> >               goto err_irq;
> Best regards,
> Krzysztof

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ