netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kelsey Skunberg <skunberg.kelsey@gmail.com>
To: bjorn@helgaas.com
Cc: iyappan@os.amperecomputing.com, keyur@os.amperecomputing.com,
	quan@os.amperecomputing.com, David Miller <davem@davemloft.net>,
	netdev@vger.kernel.org, linux-kernel@vger.kernel.org,
	Shuah Khan <skhan@linuxfoundation.org>,
	linux-kernel-mentees@lists.linuxfoundation.org
Subject: Re: [PATCH v2] drivers: net: xgene: Remove acpi_has_method() calls
Date: Tue, 23 Jul 2019 17:17:17 -0600	[thread overview]
Message-ID: <20190723231717.GA16776@JATN> (raw)
In-Reply-To: <CABhMZUVAcJwJpN8BKZTTU7jUW6881KdBtoYs_3kSn+tDtOVqNw@mail.gmail.com>

On Tue, Jul 23, 2019 at 05:56:04PM -0500, Bjorn Helgaas wrote:
> On Tue, Jul 23, 2019 at 1:59 PM Kelsey Skunberg
> <skunberg.kelsey@gmail.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.

Thank you very much for catching that. I did not know about
CONFIG_COMPILE_TEST yet and that will be very useful. It's clear why my
build test wasn't coming up with the same errors now. I know for future
patches now and will certainly get this one fixed.
Thank you again.

-Kelsey

  reply	other threads:[~2019-07-23 23:17 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-22  3:04 [PATCH] drivers: net: xgene: Remove acpi_has_method() calls Kelsey Skunberg
2019-07-22 11:05 ` kbuild test robot
2019-07-23  1:17 ` David Miller
2019-07-23 18:58 ` [PATCH v2] " Kelsey Skunberg
2019-07-23 21:06   ` David Miller
2019-07-23 21:07     ` David Miller
2019-07-24  5:56       ` Kelsey Skunberg
2019-07-23 22:56   ` Bjorn Helgaas
2019-07-23 23:17     ` Kelsey Skunberg [this message]
2019-07-24  6:06   ` [PATCH v3] " Kelsey Skunberg
2019-07-24 18:30     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190723231717.GA16776@JATN \
    --to=skunberg.kelsey@gmail.com \
    --cc=bjorn@helgaas.com \
    --cc=davem@davemloft.net \
    --cc=iyappan@os.amperecomputing.com \
    --cc=keyur@os.amperecomputing.com \
    --cc=linux-kernel-mentees@lists.linuxfoundation.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=quan@os.amperecomputing.com \
    --cc=skhan@linuxfoundation.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).