Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp3770582imm; Tue, 11 Sep 2018 01:38:26 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZH5KIqSu1ah+dWD2euwFhSyeBiFjUDHxPgBkp8h8W+sI4PIJb2MN+6UF020CmDHS29kGQ0 X-Received: by 2002:a17:902:598d:: with SMTP id p13-v6mr25521937pli.171.1536655106928; Tue, 11 Sep 2018 01:38:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536655106; cv=none; d=google.com; s=arc-20160816; b=qo5FP2DGopFufLx6XBwyoxcjPzBVR8aQJJMx0pDjnuXN2iI9STjS782if6ktuYU4rB SwN3oS0lrjffrHH4oc2GDd+AxxekwSwAH/BgOTPPwsPV1Oo1FvfT8LZdXI12DQsqam77 6+dLgah9OQDaCb+gvG6b8xR2qE1h4ECCUR3B8KnVHpm4rzSG9JJeI0yBZz+5HOKnsqrO KIGvNoXj26kQ3rq5HvbczLjQQmvE0P35hfEbct6yJRzvizlecw5q/jo4KPLRhm3x+ohf ohFFzD7KLEIMk4yVbTfe43MCU0yv4lAFrh9EHpLb2lVTMHVfPNvPenbm/Jk3RXuJiLx9 gQ6Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:subject:cc:to:from:message-id :date; bh=/6iqYHJiFL5gv4vmX0pQrqfTxQMJbGZW+/52VZYp3WU=; b=1KMyPFrmxIKELF9T07tmuAV8Wt+7Lb7CtNYbrg8JF95pL8htOoSRIgLLfOfQEsd5f/ q6lTmWWm7S/lrv1XcxPC6qtdS9/9Bta63HVTopH1dJIIuVJVHYhLTpCLN9t0gkixk3Mk Pa3J7hDzuQxd5Awz/mvgn9ziZADmS13jdomdFpc7/RXZFB9yV6im6h/9SgexdRgCKjpt T9ot5iY/p39HEtP08rnHe3eJC2DT2sK1r+kb6P3TufYBwC/NvMOiEnDWcBDIqdxf2VMS TmRnQ7WUYvPeUBr5hWPW8HxDhih4zia7uuK/0oUf1GYxvucuEfgwx6zWae3IXX+/AtlV qHAg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o18-v6si20507073pfa.15.2018.09.11.01.38.11; Tue, 11 Sep 2018 01:38:26 -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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726722AbeIKNgP (ORCPT + 99 others); Tue, 11 Sep 2018 09:36:15 -0400 Received: from mx2.suse.de ([195.135.220.15]:53984 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726387AbeIKNgP (ORCPT ); Tue, 11 Sep 2018 09:36:15 -0400 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 6D8F8ACD9; Tue, 11 Sep 2018 08:37:59 +0000 (UTC) Date: Tue, 11 Sep 2018 10:37:59 +0200 Message-ID: From: Takashi Iwai To: "Anders Roxell" Cc: , , Subject: Re: [PATCH] ALSA: hda: fix unused variable warning In-Reply-To: <20180911082559.24214-1-anders.roxell@linaro.org> References: <20180911082559.24214-1-anders.roxell@linaro.org> User-Agent: Wanderlust/2.15.9 (Almost Unreal) SEMI/1.14.6 (Maruoka) FLIM/1.14.9 (=?UTF-8?B?R29qxY0=?=) APEL/10.8 Emacs/26 (x86_64-suse-linux-gnu) MULE/6.0 (HANACHIRUSATO) MIME-Version: 1.0 (generated by SEMI 1.14.6 - "Maruoka") Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Sep 2018 10:25:59 +0200, Anders Roxell wrote: > > When CONFIG_X86=n function azx_snoop doesn't use the variable chip it > only returns true. > > sound/pci/hda/hda_intel.c: In function ‘dma_alloc_pages’: > sound/pci/hda/hda_intel.c:2002:14: warning: unused variable ‘chip’ [-Wunused-variable] > struct azx *chip = bus_to_azx(bus); > ^~~~ > > Create a inline function of azx_snoop. > > Fixes: a41d122449be ("ALSA: hda - Embed bus into controller object") > Signed-off-by: Anders Roxell > --- > sound/pci/hda/hda_controller.h | 9 ++++----- > 1 file changed, 4 insertions(+), 5 deletions(-) > > diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h > index 0053b704ddc4..aa20048742d0 100644 > --- a/sound/pci/hda/hda_controller.h > +++ b/sound/pci/hda/hda_controller.h > @@ -170,11 +170,10 @@ struct azx { > #define azx_bus(chip) (&(chip)->bus.core) > #define bus_to_azx(_bus) container_of(_bus, struct azx, bus.core) > > -#ifdef CONFIG_X86 > -#define azx_snoop(chip) ((chip)->snoop) > -#else > -#define azx_snoop(chip) true > -#endif > +static inline bool azx_snoop(struct azx *chip) > +{ > + return IS_ENABLED(CONFIG_X86) || (chip->snoop); > +} The idea is good, but the patch is obviously wrong; it should be !IS_ENABLED() :) Also, please remove the parentheses around chip->snoop. thanks, Takashi