Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp4125623imm; Tue, 11 Sep 2018 07:20:55 -0700 (PDT) X-Google-Smtp-Source: ANB0VdZV1tDT/ALbi0TTmjsfJnR3zzkAhBDFrNVPPqLIkPuPjEPqCVr2hPDdN+dCpiv70aRGFud5 X-Received: by 2002:a65:608b:: with SMTP id t11-v6mr29065374pgu.259.1536675655939; Tue, 11 Sep 2018 07:20:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536675655; cv=none; d=google.com; s=arc-20160816; b=TxYx7xgycjrhURlCkFrephsjb8qJO6RylkP0ue5Kps34UukzY+UzqQcs+RXiJ654Co teQWldG536c8QR5o0bTCZtvjdH7kJ0xZvJr1qM+jGWUqB6jAMHyJmObNHI1UtvwPeA/K p+W+EmgmvHTUYPlivD2B/WrZGdLNdmfdHExir05DsZ29Ko8uHAKIbtm6PxQWogBw2P4i Nds7jzYuqQlrKRxikQB8s0VK8WN94V8F915zc5FVX1JxOWuRSk+mg1jDyXLur5Bx7UjA YzaqxbAWgpHWJQtHQ/hOk3bB8xMp+GpIEcz0x2KknNTggXPcZwjd3oLMoWcBcTrnomcL o/QA== 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:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=WkGRCR/i4oZwHNHqCrejEMImsEUXo0k+2hMIVZOFlko=; b=I9tDKaJtcO4bZPhxOOrBZueUPvIr71yEl2tamUkW9S+UrInmy87qzOk6KJHkesW8yx WpcLMr8Gd9OIBzNgQQWXCHxOGa0n2GLHAJIUteBOKZy895QIWBcvPzT0MzEMVDTSZB8t bsgui/gzqMBhW4LeLqjmR/mocaTqvSM5u9awLARWBTPvWlgQOj2uqvSOj+7V/chwDMPb xhI8mdR+mwcS+oTl/ilBatbxFf3gnygFbXrpdLlooMSoYu5f2O3FidCjtMRccvXk1S/I p40j1XtFTD+esQhjvpIB8rI8ryNsYMDL5MeryJiqL2Bnp26dIBuczqEFG6TEXqDCu6l4 w4YQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=TQFOODGW; 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=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r16-v6si20871878pgg.254.2018.09.11.07.20.40; Tue, 11 Sep 2018 07:20:55 -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=@linaro.org header.s=google header.b=TQFOODGW; 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=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727764AbeIKTRr (ORCPT + 99 others); Tue, 11 Sep 2018 15:17:47 -0400 Received: from mail-yb1-f196.google.com ([209.85.219.196]:37384 "EHLO mail-yb1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726622AbeIKTRq (ORCPT ); Tue, 11 Sep 2018 15:17:46 -0400 Received: by mail-yb1-f196.google.com with SMTP id f145-v6so9382733ybg.4 for ; Tue, 11 Sep 2018 07:18:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc:content-transfer-encoding; bh=WkGRCR/i4oZwHNHqCrejEMImsEUXo0k+2hMIVZOFlko=; b=TQFOODGW2+IkhzQhjlO6ISqn2cT4ctbkrhfl4lraZ+A0gZ8fKrV5zUAFkzJoJaXKjr Vv3xfmNLoPelorZCkyaqaLXIqZLJH0TmtEF/JOP4Av/XLnl0aO+247Hp2+Fiw6N03BbN IneN+QzpUMGzU/6pObKBpAPL7tFvG+HMljfM4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc:content-transfer-encoding; bh=WkGRCR/i4oZwHNHqCrejEMImsEUXo0k+2hMIVZOFlko=; b=cOqqqJzkpRdnc+2awU3pK5q2MPdmH6J4zgBamUGg1hX0zXYHP3D8lw2GxnbWeWKjTB 6obftyfjvJ0XNKr2C1p+uhijxd2H/tROI0QxelbHH1fU1fCu29xnmzWAk7zfsZPZyti1 B0cJf7/3fYXFSQGhLUWzK6sEBaq2NKi8uK9yp3OpsFufHsL8COXl+efntKgp6/Jow5CB G/PCo7rPr+HbATLIOxDltYI6evOjDYSprv0j6XvfI3P2rLO+BnDvDE+OZbtjDrPdVMQv ymofSCtnjbc3O8010SigK6WbfY6b0xTVTbssT6xRrKtyEPA9IQwLSBfplAe6fslX+Ru+ 1icQ== X-Gm-Message-State: APzg51DBAAFWaUvPPUQwrpQErjdDA+sz8Qhrv60NRtJaEoEvbulkH0L0 DKtX7V1q2vbaGoWqJSf78mYWGwho4YXohjc/gA9WRA== X-Received: by 2002:a25:858f:: with SMTP id x15-v6mr9145057ybk.270.1536675494837; Tue, 11 Sep 2018 07:18:14 -0700 (PDT) MIME-Version: 1.0 References: <20180911082559.24214-1-anders.roxell@linaro.org> In-Reply-To: From: Anders Roxell Date: Tue, 11 Sep 2018 16:18:03 +0200 Message-ID: Subject: Re: [PATCH] ALSA: hda: fix unused variable warning To: tiwai@suse.de Cc: perex@perex.cz, alsa-devel@alsa-project.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 11 Sep 2018 at 10:38, Takashi Iwai wrote: > > On Tue, 11 Sep 2018 10:25:59 +0200, > Anders Roxell wrote: > > > > When CONFIG_X86=3Dn function azx_snoop doesn't use the variable chip it > > only returns true. > > > > sound/pci/hda/hda_intel.c: In function =E2=80=98dma_alloc_pages=E2=80= =99: > > sound/pci/hda/hda_intel.c:2002:14: warning: unused variable =E2=80=98ch= ip=E2=80=99 [-Wunused-variable] > > struct azx *chip =3D 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_control= ler.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() :) oops, right. > > Also, please remove the parentheses around chip->snoop. OK. Sending v2 shortly. Cheers, Anders