From patchwork Tue Sep 11 08:25:59 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Anders Roxell X-Patchwork-Id: 146425 Delivered-To: patch@linaro.org Received: by 2002:a2e:1648:0:0:0:0:0 with SMTP id 8-v6csp3378532ljw; Tue, 11 Sep 2018 01:26:10 -0700 (PDT) X-Google-Smtp-Source: ANB0VdbTK71bh8JeF0vl5A0hIYNzUwSkOBaFOyKyUtWJfyRU9Nk6Z9KfBnCfcmLkN0gKjZHUwer9 X-Received: by 2002:a62:64ca:: with SMTP id y193-v6mr27710163pfb.250.1536654370199; Tue, 11 Sep 2018 01:26:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536654370; cv=none; d=google.com; s=arc-20160816; b=Dq/b0f1+qAITWaE3OunlOe4m6mmPY27T9dl2Z7pGZ8hrs/09tVu6q5dfj2BfC/rN3Y tMTvdzREqjy/7eYmeJ7TEkAzMcYMwXt1f//hZdOdnNmp8cMV/ZIlae3y2O7XayNHX5s3 RY76HoQsg8yl3f6ZyeyQamMT5uG+TQN4NzUH8jFKBKJ1LUyYis8G9QZLWCqtZOtIUKzK /yQSsJNKbk17ODLPsyZFarlSKEhuElO/5deuxS7aV8kr3iRWr5phxzuPMiZQmxtdxo+f lAkwaeeg9mZeY5n+cRcCm+TF2W0S+greJm6UxowfXVZtgKU8+BsNyLdfsi7fuQn+CKpa +qKQ== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=yw2PXv8XW2/jt3VCOUj66tZpQdzgkBwNMASMb2v4joM=; b=TKTeSSslCac5Jdn0lUVQ0nloxAmYd8NYwFNRfpCTISpjcayegjLN0RMuG3xR0ZE8Rg HbgSl+O/LIr5ZVmP4WUGWfLWzVl7lG5ZRJFGNX9r7BB2iXA3bxEbg4zojOfBBr/MJQu4 T0PyHQDaT6WOb6XD4J8gn7GvVJECzg6maTMcBtrvEyZxwSI0EDaIi9b/l0T8xiP5KQzy otxUWBmyBqERiGvs0Si5YYvYW40SaR95IoYW/bxYpfpRRlQo9BwS1tWy19vntvKwzW9+ Y7gSGYvjfGsUILOfjAr9ZwzEAyjcA0WohyEDBdWtpDpPKHw3g8UHDs+0C4UZXYZ7aQXN BHPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=X3T2ZUwI; 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 a15-v6si21942357pln.137.2018.09.11.01.26.09; Tue, 11 Sep 2018 01:26:10 -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=X3T2ZUwI; 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 S1726730AbeIKNYT (ORCPT + 32 others); Tue, 11 Sep 2018 09:24:19 -0400 Received: from mail-lf1-f65.google.com ([209.85.167.65]:43953 "EHLO mail-lf1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726408AbeIKNYT (ORCPT ); Tue, 11 Sep 2018 09:24:19 -0400 Received: by mail-lf1-f65.google.com with SMTP id h64-v6so19644790lfi.10 for ; Tue, 11 Sep 2018 01:26:07 -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:mime-version :content-transfer-encoding; bh=yw2PXv8XW2/jt3VCOUj66tZpQdzgkBwNMASMb2v4joM=; b=X3T2ZUwI+Tx6KNInQC46ioaCZVZBoR3oYchaiTBhM3MisuLWEgeaE4NVY/UJhF1Vlw dM3zEn86dz37hau5wLZm2AWoyoU+Hb7bAxUx7hZl8hVNL2zSNCWiMsGxPs/Cm3lcswUA Jb0KUT0S/w8keNPzQzMCleSIZA6G+m4THKDLc= 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:mime-version :content-transfer-encoding; bh=yw2PXv8XW2/jt3VCOUj66tZpQdzgkBwNMASMb2v4joM=; b=ahl3edPSbC9LHGlsx1D8AwGE60urKiPfzh5mcTCaQg5xPi+DTWV7GaEWfuJaILcqGS hYQxbyuOZCeYzEHqoIgZsbjVDH7OALWa5dUAB1C4aWiT/IVG+ogiJ21C8hRVtXW8OxX5 6IV6k0H7mRwoj5YxtWUQet9PWg5jqgNgcnf+HNhLCs0PqyzITvRB0L+x+QY0G7cPWa8M uQAgfNkXxeYyxHVetxkWexZ2c+0t4mTd31G+a+pe3XkOnwyXWB5OADr6A71xYg3mOaxU OWakcnn94jzk5EVvuqyvFqk1qKrT09M7TpiKRh/r2EQ7PQDTryRSr2yzwZ2On8pknVaJ Pjsw== X-Gm-Message-State: APzg51DQoOa5bSxNAbSe5cC+0lUHruVdVscT3xSr3Q/flWuDHJX4bxHj JjXsqr1Tk1+u23V7uoRKYZcS5Q== X-Received: by 2002:ac2:50c7:: with SMTP id h7-v6mr14412231lfm.47.1536654366009; Tue, 11 Sep 2018 01:26:06 -0700 (PDT) Received: from localhost (c-732171d5.07-21-73746f28.bbcust.telenor.se. [213.113.33.115]) by smtp.gmail.com with ESMTPSA id m22-v6sm3116994lfc.44.2018.09.11.01.26.05 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 11 Sep 2018 01:26:05 -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] ALSA: hda: fix unused variable warning Date: Tue, 11 Sep 2018 10:25:59 +0200 Message-Id: <20180911082559.24214-1-anders.roxell@linaro.org> X-Mailer: git-send-email 2.18.0 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..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); +} /* * macros for easy use