From patchwork Tue Sep 11 14:18:36 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 146466 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3696027ljw; Tue, 11 Sep 2018 07:19:43 -0700 (PDT) X-Google-Smtp-Source: ANB0Vdars/BlOefDXfkSdPcHHl15aB8LNkJCmEx3oZdQnOGbsuKxt2gwFsuXiKF8/N5hI/6iiC+G X-Received: by 2002:a65:654d:: with SMTP id a13-v6mr26663962pgw.35.1536675583270; Tue, 11 Sep 2018 07:19:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536675583; cv=none; d=google.com; s=arc-20160816; b=M5RdcAv7fnJsfK0d3T7JeZzUC3aM5zr3dk+giGLKGpmP+AUcTEYPfR9ZCOdcLd6fCD EMzCb0iLltCKYnKtGER6zHu/71U9+IA94Teln14m5c1tws4psUbbTTdOULtdCEsXYeu+ v8J1RMBkdlkCEvIP8wZj7UWpgCdx8pm78Vhj7LHjDMLyspN3R3GqQdvFaC/t8Fxov+u8 vl4FOHmjQvYAWWqFhHY8o94ej6WRAOt2jRBj9HWVveOWp9yoqwRdr15l5cQDCiL/1wjL PD2rbJry2vwaGUbAYbSLjCm3eMKQr6ZXXgwYloPGGYK3OyAwgj8RjbyX62JJm1HAaRme Q5UQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=vlBGOu5rXqpxMvrqpxnpBIui/uTQDzX5bcXlv33LhAE=; b=GGmf+tyYSjQTTLxxSbez4RZoLiwqMEQupNpNpWS8rMpNugbj6XbhJeBA4NbLKJKdfp 11nhx1JiomJ8DEECUrKU5YzxA5jVGq3VaSguQ0M4gN3KPa8nWznS5QsaOQUvNQtQAala ZCT2ZN7ciVT30dBCEqOgua6AZHgukX2AoHyDSHlYxU45D8Xp7BJEd0VJ3HnOHHACDtLq nKhAEoCB1nESYJHSS/6ZCffuljY+CDPvgqCxdUJEGIlONO+rjD8oCtrnaBV0alCsAHnt GdQ3Iasv3tm/4I4Q95bdOAoTcOwRmGgubPMF/5DvsoYrmQvCtgNT+KkUXtKTisBI1Go3 q9Bg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b="N7zarI/R"; 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 e37-v6si20842550plb.313.2018.09.11.07.19.42; Tue, 11 Sep 2018 07:19:43 -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="N7zarI/R"; 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 S1727853AbeIKTTL (ORCPT + 32 others); Tue, 11 Sep 2018 15:19:11 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43993 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726949AbeIKTTL (ORCPT ); Tue, 11 Sep 2018 15:19:11 -0400 Received: by mail-lf1-f65.google.com with SMTP id h64-v6so20471911lfi.10 for ; Tue, 11 Sep 2018 07:19:38 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=vlBGOu5rXqpxMvrqpxnpBIui/uTQDzX5bcXlv33LhAE=; b=N7zarI/RlHiF2iuxiXbfBaFXSehsxHfe6aSnFQsWX0b0d2YpRhNi14KFBkKxWtypEM deQzTcUAwe60apsYJZmAdIQVWjztZmJ2vTxl9MZQsFPIQv4KcgPUquwvLS6FUolDmtqs uxJFq22a9+7554Epm9BgYJlrbB/LRLbwLU4lE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=vlBGOu5rXqpxMvrqpxnpBIui/uTQDzX5bcXlv33LhAE=; b=jcLFBDAezDZRtjcL1UCp97nSgI0UFKsRBfirWTXkRAIs5eYdWmuGJlUTvoeV505GGo IGXTUXMJIhgmUD6q8FVQhuuFCe2ePcuiIuoM3MUBil17+msiwZSnm4SX7Yk2HDyGckSA ty6U5aj2LL5hMukjAh+/Xz7LsaYB9oGAoRuGl8TbQQ2coc3tCnBdWOTFmkSOaSrGk5XK hFByob1ZunIemLZF2+Qerod/aBguViHLkKqtnTHaWfpj4gAoE33JUTD6SdYZTN/BPg/n tS4dSXoTPgpPxipTrLYEFVlszz6YsAeL+k5Rcx+bYo6cdsKZLQe7IRNzE9LGmVVMAFkQ Vsqw== X-Gm-Message-State: APzg51CuB02lr719mDB01ZuC7+aOBWvFTVmTdl9oKv4g9HLSG9JfWSq6 4wOXJ08Q+5Txcx8OTBZepFXsNRlDCZwcag== X-Received: by 2002:a19:7706:: with SMTP id s6-v6mr3946659lfc.84.1536675577624; Tue, 11 Sep 2018 07:19:37 -0700 (PDT) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id g10-v6sm3308543lfl.11.2018.09.11.07.19.36 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Sep 2018 07:19:37 -0700 (PDT) From: Anders Roxell To: perex@perex.cz, tiwai@suse.com Cc: alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, Anders Roxell Subject: [PATCH v2] ALSA: hda: fix unused variable warning Date: Tue, 11 Sep 2018 16:18:36 +0200 Message-Id: <20180911141836.14463-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.18.0 In-Reply-To: References: MIME-Version: 1.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(-) -- 2.18.0 diff --git a/sound/pci/hda/hda_controller.h b/sound/pci/hda/hda_controller.h index 0053b704ddc4..c95097bb5a0c 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; +} /* * macros for easy use