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=-9.8 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI, SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham 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 8DBFFC2D0DB for ; Tue, 28 Jan 2020 14:46:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5AD732173E for ; Tue, 28 Jan 2020 14:46:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580222818; bh=qXFHyagZQJJ02Cz9JquvBpRRwE6uzT1EcKIHtHk7zMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=1hrtAVOuTSAHhGvp+mnLnlb1VljSaXNyhHPs9eyqo6FuSEEJynvP5xWp5iS7t4hLI fKoI4l4gJ8kIlqbQA4rioWE5wuAfp7qicstgq1UbsQHqQJ+Lo/9QC3QiHRNFQ9XRii gqzNsb/a1ZCpJzu7QWRyxxAWM9t0+XDsZyRZz9fU= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728494AbgA1OI2 (ORCPT ); Tue, 28 Jan 2020 09:08:28 -0500 Received: from mail.kernel.org ([198.145.29.99]:56468 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727215AbgA1OIY (ORCPT ); Tue, 28 Jan 2020 09:08:24 -0500 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C840522522; Tue, 28 Jan 2020 14:08:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1580220504; bh=qXFHyagZQJJ02Cz9JquvBpRRwE6uzT1EcKIHtHk7zMY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=xhz3cCJXF12P9pJhh0/kO9CG5KZDURq0u/2bhpSl3w3BEX0ThmL6MfwnAeEOwyd7F pMDXB+egHs1GGfg91l2Ba621oJ4Awyx68XtMELF+sj3J6jt2e62RC2lwyV1NO5tyPB V6Q8NBcD8E0UUVBxUwP3xL8V/OOB5wAYmUKC0AcA= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Anders Roxell , Takashi Iwai , Sasha Levin Subject: [PATCH 4.4 005/183] ALSA: hda: fix unused variable warning Date: Tue, 28 Jan 2020 15:03:44 +0100 Message-Id: <20200128135830.096429661@linuxfoundation.org> X-Mailer: git-send-email 2.25.0 In-Reply-To: <20200128135829.486060649@linuxfoundation.org> References: <20200128135829.486060649@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 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 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 55ec4470f6b69..499873d29cc18 100644 --- a/sound/pci/hda/hda_controller.h +++ b/sound/pci/hda/hda_controller.h @@ -164,11 +164,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