From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-10.1 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0FD31C33CB3 for ; Thu, 16 Jan 2020 17:17:31 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id D109D2464B for ; Thu, 16 Jan 2020 17:17:30 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579195050; bh=/AMNoWp4t08t2W0p2s4AAZai3FYHJpG3gzo7Kc+7B0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=miP7iBQT4W9lM0vGQCC0ZfkbNB8cMelk6hkHNwBFXd/NKtMbRtQ/vFV870kWP2EFS lQ0D8ygZe2E02i5KIxIfv2sNtyKk9igMM+Q8QEwHjsBvDfGPsS3bsqMvEgqv0PCAr0 CwVFKc5J/0hDLyMrhXUzxzqTgGZrFFVoE659TV3A= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391214AbgAPRR3 (ORCPT ); Thu, 16 Jan 2020 12:17:29 -0500 Received: from mail.kernel.org ([198.145.29.99]:42376 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2390838AbgAPRRY (ORCPT ); Thu, 16 Jan 2020 12:17:24 -0500 Received: from sasha-vm.mshome.net (c-73-47-72-35.hsd1.nh.comcast.net [73.47.72.35]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 41AA42075B; Thu, 16 Jan 2020 17:17:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1579195044; bh=/AMNoWp4t08t2W0p2s4AAZai3FYHJpG3gzo7Kc+7B0w=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=BRW9x8Ye7ILxJ0njxupa4SjUi0IY3sK+lCJSwP2R7gJRS9Ejy5uGoleBN6A+lR3YT xMY0mTdwT/EjsPuN4CUmxTaq41I+xyV2tuoMENDnITrufSjcsHIwG+Xk8zG/uIKVA2 GGgBqgR6uV9JzWWomS4hfhgdMqR2tLhMvnZf2ifM= From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Anders Roxell , Takashi Iwai , Sasha Levin , alsa-devel@alsa-project.org Subject: [PATCH AUTOSEL 4.14 003/371] ALSA: hda: fix unused variable warning Date: Thu, 16 Jan 2020 12:11:11 -0500 Message-Id: <20200116171719.16965-3-sashal@kernel.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200116171719.16965-1-sashal@kernel.org> References: <20200116171719.16965-1-sashal@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anders Roxell [ Upstream commit 5b03006d5c58ddd31caf542eef4d0269bcf265b3 ] 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 Signed-off-by: Takashi Iwai Signed-off-by: Sasha Levin --- 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 8a9dd4767b1e..63cc10604afc 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -176,11 +176,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 -- 2.20.1