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: <CABhMZUVAcJwJpN8BKZTTU7jUW6881KdBtoYs_3kSn+tDtOVqNw@mail.gmail.com>
Date:   Tue, 23 Jul 2019 17:56:04 -0500
From:   Bjorn Helgaas <bjorn.helgaas@...il.com>
To:     Kelsey Skunberg <skunberg.kelsey@...il.com>
Cc:     iyappan@...amperecomputing.com, keyur@...amperecomputing.com,
        quan@...amperecomputing.com, David Miller <davem@...emloft.net>,
        netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
        Bjorn Helgaas <bjorn@...gaas.com>,
        Shuah Khan <skhan@...uxfoundation.org>,
        linux-kernel-mentees@...ts.linuxfoundation.org
Subject: Re: [PATCH v2] drivers: net: xgene: Remove acpi_has_method() calls

On Tue, Jul 23, 2019 at 1:59 PM Kelsey Skunberg
<skunberg.kelsey@...il.com> wrote:
>
> acpi_evaluate_object will already return an error if the needed method
> does not exist. Remove unnecessary acpi_has_method() calls and check the
> returned acpi_status for failure instead.

> diff --git a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
> index 6453fc2ebb1f..5d637b46b2bf 100644
> --- a/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
> +++ b/drivers/net/ethernet/apm/xgene/xgene_enet_sgmac.c
> @@ -437,6 +437,7 @@ static void xgene_sgmac_tx_disable(struct xgene_enet_pdata *p)
>  static int xgene_enet_reset(struct xgene_enet_pdata *p)
>  {
>         struct device *dev = &p->pdev->dev;
> +       acpi_status status;
>
>         if (!xgene_ring_mgr_init(p))
>                 return -ENODEV;
> @@ -460,14 +461,13 @@ static int xgene_enet_reset(struct xgene_enet_pdata *p)
>                 }
>         } else {
>  #ifdef CONFIG_ACPI
> -               if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_RST"))
> -                       acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
> -                                            "_RST", NULL, NULL);
> -               else if (acpi_has_method(ACPI_HANDLE(&p->pdev->dev), "_INI"))
> +               status = acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
> +                                             "_RST", NULL, NULL);
> +               if (ACPI_FAILURE(status)) {
>                         acpi_evaluate_object(ACPI_HANDLE(&p->pdev->dev),
>                                              "_INI", NULL, NULL);
> +               }
>  #endif
> -       }

Oops, I don't think you intended to remove that brace.

If you haven't found it already, CONFIG_COMPILE_TEST is useful for
building things that wouldn't normally be buildable on your arch.

>         if (!p->port_id) {
>                 xgene_enet_ecc_init(p);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ