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: <cd94a64536b687ee07f4e59be5bc6fed0df48404.camel@redhat.com>
Date: Wed, 27 Mar 2024 14:35:14 +0100
From: Philipp Stanner <pstanner@...hat.com>
To: Heiner Kallweit <hkallweit1@...il.com>, Bjorn Helgaas
 <bhelgaas@...gle.com>,  Realtek linux nic maintainers
 <nic_swsd@...ltek.com>, Paolo Abeni <pabeni@...hat.com>, Jakub Kicinski
 <kuba@...nel.org>, Eric Dumazet <edumazet@...gle.com>, David Miller
 <davem@...emloft.net>
Cc: "linux-pci@...r.kernel.org" <linux-pci@...r.kernel.org>, 
	"netdev@...r.kernel.org"
	 <netdev@...r.kernel.org>
Subject: Re: [PATCH 2/2] r8169: use new function pcim_iomap_region()

On Wed, 2024-03-27 at 12:54 +0100, Heiner Kallweit wrote:
> Use new function pcim_iomap_region() to simplify the code.
> 
> Signed-off-by: Heiner Kallweit <hkallweit1@...il.com>
> ---
>  drivers/net/ethernet/realtek/r8169_main.c | 8 +++-----
>  1 file changed, 3 insertions(+), 5 deletions(-)
> 
> diff --git a/drivers/net/ethernet/realtek/r8169_main.c
> b/drivers/net/ethernet/realtek/r8169_main.c
> index 5c879a5c8..7411cf1a1 100644
> --- a/drivers/net/ethernet/realtek/r8169_main.c
> +++ b/drivers/net/ethernet/realtek/r8169_main.c
> @@ -5333,11 +5333,9 @@ static int rtl_init_one(struct pci_dev *pdev,
> const struct pci_device_id *ent)
>         if (region < 0)
>                 return dev_err_probe(&pdev->dev, -ENODEV, "no MMIO
> resource found\n");
>  
> -       rc = pcim_iomap_regions(pdev, BIT(region), KBUILD_MODNAME);
> -       if (rc < 0)
> -               return dev_err_probe(&pdev->dev, rc, "cannot remap
> MMIO, aborting\n");
> -
> -       tp->mmio_addr = pcim_iomap_table(pdev)[region];
> +       tp->mmio_addr = pcim_iomap_region(pdev, region,
> KBUILD_MODNAME);
> +       if (!tp->mmio_addr)
> +               return dev_err_probe(&pdev->dev, -ENOMEM, "cannot
> remap MMIO, aborting\n");
>  
>         txconfig = RTL_R32(tp, TxConfig);
>         if (txconfig == ~0U)

You could use this patch then on top of my series; the only little
change necessary would be that you have to check for an ERR_PTR:

if (IS_ERR(tp->mmio_addr))
   ...


Looks very good otherwise.

P.


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ