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: <20241114125001.3hykb6dnzmt7bkti@DEN-DL-M70577>
Date: Thu, 14 Nov 2024 12:50:01 +0000
From: Daniel Machon <daniel.machon@...rochip.com>
To: Rosen Penev <rosenp@...il.com>
CC: <netdev@...r.kernel.org>, Chandrasekar Ramakrishnan <rcsekar@...sung.com>,
	Marc Kleine-Budde <mkl@...gutronix.de>, Vincent Mailhol
	<mailhol.vincent@...adoo.fr>, Andrew Lunn <andrew+netdev@...n.ch>, "David S.
 Miller" <davem@...emloft.net>, Eric Dumazet <edumazet@...gle.com>, "Jakub
 Kicinski" <kuba@...nel.org>, Paolo Abeni <pabeni@...hat.com>, Kurt Kanzenbach
	<kurt@...utronix.de>, Vladimir Oltean <olteanv@...il.com>, Chris Snook
	<chris.snook@...il.com>, Marcin Wojtas <marcin.s.wojtas@...il.com>, "Russell
 King" <linux@...linux.org.uk>, Horatiu Vultur <horatiu.vultur@...rochip.com>,
	"maintainer:MICROCHIP LAN966X ETHERNET DRIVER"
	<UNGLinuxDriver@...rochip.com>, Yoshihiro Shimoda
	<yoshihiro.shimoda.uh@...esas.com>, Niklas Söderlund
	<niklas.soderlund@...natech.se>, Doug Berger <opendmb@...il.com>, "Florian
 Fainelli" <florian.fainelli@...adcom.com>, "Broadcom internal kernel review
 list" <bcm-kernel-feedback-list@...adcom.com>, Heiner Kallweit
	<hkallweit1@...il.com>, Richard Cochran <richardcochran@...il.com>, "open
 list:MCAN MMIO DEVICE DRIVER" <linux-can@...r.kernel.org>, open list
	<linux-kernel@...r.kernel.org>, "open list:RENESAS ETHERNET SWITCH DRIVER"
	<linux-renesas-soc@...r.kernel.org>
Subject: Re: [PATCHv2 net-next] net: modernize ioremap in probe

Hi Rosen,

> diff --git a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> index 3234a960fcc3..375e9a68b9a9 100644
> --- a/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> +++ b/drivers/net/ethernet/microchip/lan966x/lan966x_main.c
> @@ -77,20 +77,12 @@ static int lan966x_create_targets(struct platform_device *pdev,
>          * this.
>          */
>         for (idx = 0; idx < IO_RANGES; idx++) {
> -               iores[idx] = platform_get_resource(pdev, IORESOURCE_MEM,
> -                                                  idx);
> -               if (!iores[idx]) {
> -                       dev_err(&pdev->dev, "Invalid resource\n");
> -                       return -EINVAL;
> -               }
> -
> -               begin[idx] = devm_ioremap(&pdev->dev,
> -                                         iores[idx]->start,
> -                                         resource_size(iores[idx]));
> -               if (!begin[idx]) {
> +               begin[idx] = devm_platform_get_and_ioremap_resource(
> +                       pdev, idx, &iores[idx]);

Seems like this causes some trouble in the lan969x (see Horatius
comment). While at it, maybe reformat this line - checkpatch is
complaining:

CHECK: Lines should not end with a '('
#314: FILE: drivers/net/ethernet/microchip/lan966x/lan966x_main.c:80:
+		begin[idx] = devm_platform_get_and_ioremap_resource(

/Daniel

> +               if (IS_ERR(begin[idx])) {
>                         dev_err(&pdev->dev, "Unable to get registers: %s\n",
>                                 iores[idx]->name);
> -                       return -ENOMEM;
> +                       return PTR_ERR(begin[idx]);
>                 }
>         }
> 


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ