Received: by 2002:a25:ad19:0:0:0:0:0 with SMTP id y25csp8990538ybi; Tue, 23 Jul 2019 19:35:22 -0700 (PDT) X-Google-Smtp-Source: APXvYqzluiiiqAV4+vx9BHyEjZTK6xUG0rwif3kl0x37L9EBQrwpLM9/TLDIqz+O66jTHBiwjGtz X-Received: by 2002:a62:63c7:: with SMTP id x190mr8511151pfb.181.1563935722131; Tue, 23 Jul 2019 19:35:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1563935722; cv=none; d=google.com; s=arc-20160816; b=u4HzirjK3xf0n9EaB2SxdMOl+K7P3uZadaldhs1qDyE5G5K0sWv5jG3SP110RuUZ26 itCAKkiOAe7Z0cDWQEpdjFYzkKXMd1qjLonVA4nLGCUyoKjlbs6Tk9WlE+2eNVVdfo0t D+alky8DQZvc/0pqpx7MpPzHtoE6uYmRGem3f5/G47a3jr5u71epvJNiWIi/gJGmUgrY arS+Z+fLN/AzNcOs1wlNswBX3G7MS3McWKj/40frtoCbj0W0S8DU62B5f+1eEwZQy+yM mixH8Nnl1Uc0lmODlsVRGf3USJguzuy1C3MygGZAAHE9Ht4X4Jf8ObD4Bu5EydNV+iOd Inkw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=EREJRt7jj49C0rCcr5qS3pbZo7kgePF2Gv4OWisb4Ck=; b=B53mCHpETLXmXaNMUtRDAdCU6F2ZD6DAB2HTeygSjfkSyegtwwUv53sEq4aL9WsY4N geW6enSxsecTB4yhIoLMyAGZi0AR5r0tIsvDGFuuQ5tTOb+3LPhj6nBRHml3r/Lk/ZQj cz48RqftAC8f1hNXnB/FtOmk9xRWlJG1pER+ERT4cV1ZSXvEfH51NJo9i7A5XdO14chK ZPil4zVyzWF5vBsISWiMPvWz97lkf0+QNXD+3XzUNzkDlpOJR65KEWLA9wMR8Q5qWh+Q f9Y+8vsTr5HZoFe2wW7jTiZ34lmpOqNYz5ZKUXZyXcj3tRYwCgKj//svFso1HQiw7bCC zb/A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEawseaK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id f7si14403079pgv.135.2019.07.23.19.35.07; Tue, 23 Jul 2019 19:35:22 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=hEawseaK; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726595AbfGWXRU (ORCPT + 99 others); Tue, 23 Jul 2019 19:17:20 -0400 Received: from mail-io1-f68.google.com ([209.85.166.68]:42566 "EHLO mail-io1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725730AbfGWXRU (ORCPT ); Tue, 23 Jul 2019 19:17:20 -0400 Received: by mail-io1-f68.google.com with SMTP id e20so55162477iob.9; Tue, 23 Jul 2019 16:17:20 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=EREJRt7jj49C0rCcr5qS3pbZo7kgePF2Gv4OWisb4Ck=; b=hEawseaKHXb8tX1P7iXvi+EekI5fvqzo9CjFSlo+KONp03bCmEzukex+gesX7PBkX+ DtaSmMdIjbxj93e6Rr8OSwFHOSH6xByvnphjQSNP5G9SHdFgky+0pCPymTa8Xx83JuaS XjcpcjqUpabkua+14OxhBg12CugEP0Cn4gS65nnyJ/4GGuZtTKHGGrp3ZzfvlRH84084 eiB31zYb/uhxLg6lWJgyPTQyR5o+PtgEbD1HHJ6ZKb1JCGfa2ZYBFg2lfV4VYR4s2kCs FF0OmK8hOU9oyrzmM5Y5zngF+sVBdtyJ79KKQOwxC1rA/PcqcEk/2bhxAKyyjv+s3nUI vgAQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=EREJRt7jj49C0rCcr5qS3pbZo7kgePF2Gv4OWisb4Ck=; b=qrarTHdfk05MF5OumVkxX1CCe77RD4qELZ1wayz/1HdxLQO2+L6K6MlqcnoVCeLzHN nG7YKeE8tPtFi1qvxELXM2SshSKW2d4+xlsiuHmQvXh1f+Cwd499W0+4vmaZVMFZX+FO lzxwh4qZ8ZW67UfiAaHljdTKwmtl8fSkRl6stE/6WMQHOSp6d80d2+q3xOYK9jXoJPoN dFYiDflxQGZbkCmURWYNp/v3Xao2+izvtqaw4lbulyr9sZbXOFIRHaj7MdL579lByfGr 6oMyXEPyXSKnPYd1dppyAHCzH0rkdsIbEgfZtx+WIeGVATK37R6rK12PYjzV3lU9U6vh WStQ== X-Gm-Message-State: APjAAAVSCaRaI4UpvOAsd4QQQ+LkVJynbLHxCZ0pP8bmf/k1ksIoCxgK UDi6gZYffvl99qgq4p+H0iU= X-Received: by 2002:a6b:da01:: with SMTP id x1mr48189572iob.216.1563923839654; Tue, 23 Jul 2019 16:17:19 -0700 (PDT) Received: from JATN (c-73-243-191-173.hsd1.co.comcast.net. [73.243.191.173]) by smtp.gmail.com with ESMTPSA id y5sm46436289ioc.86.2019.07.23.16.17.17 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Tue, 23 Jul 2019 16:17:18 -0700 (PDT) Date: Tue, 23 Jul 2019 17:17:17 -0600 From: Kelsey Skunberg To: bjorn@helgaas.com Cc: iyappan@os.amperecomputing.com, keyur@os.amperecomputing.com, quan@os.amperecomputing.com, David Miller , netdev@vger.kernel.org, linux-kernel@vger.kernel.org, Shuah Khan , linux-kernel-mentees@lists.linuxfoundation.org Subject: Re: [PATCH v2] drivers: net: xgene: Remove acpi_has_method() calls Message-ID: <20190723231717.GA16776@JATN> References: <20190722030401.69563-1-skunberg.kelsey@gmail.com> <20190723185811.8548-1-skunberg.kelsey@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jul 23, 2019 at 05:56:04PM -0500, Bjorn Helgaas wrote: > On Tue, Jul 23, 2019 at 1:59 PM Kelsey Skunberg > 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