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: 10595335 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 4E120921 for ; Tue, 11 Sep 2018 09:02:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 3D27B29052 for ; Tue, 11 Sep 2018 09:02:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3187E290B3; Tue, 11 Sep 2018 09:02:29 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 6BADC29052 for ; Tue, 11 Sep 2018 09:02:28 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id 805522678C4; Tue, 11 Sep 2018 11:01:16 +0200 (CEST) X-Original-To: alsa-devel@alsa-project.org Delivered-To: alsa-devel@alsa-project.org Received: by alsa0.perex.cz (Postfix, from userid 1000) id C76092677BB; Tue, 11 Sep 2018 10:26:09 +0200 (CEST) Received: from mail-lf1-f67.google.com (mail-lf1-f67.google.com [209.85.167.67]) by alsa0.perex.cz (Postfix) with ESMTP id 5395E2676C6 for ; Tue, 11 Sep 2018 10:26:06 +0200 (CEST) Received: by mail-lf1-f67.google.com with SMTP id c29-v6so19691654lfj.1 for ; Tue, 11 Sep 2018 01:26:06 -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=PxocLXHEDnkQD4AG6t0fn8AuH4zBJ2msE0LFPgmrAj0YQPkpmf3yj7XcGxBSiVX/uT UBo7+2WhXIRBTFjkN+fRBvP8P4BnNigVX4fXoO1P6LeMzPusuXR9qZOOp+HUqj/VKMKh iDEwKkL8MhHvZ2uEj5DcJqaD0oytNLgl03zzQMDnaVbQSWqsU+9h8sqZZUjzLirr7IsE I6zkh/GNwEtgz8w2IyKBFFSyiJCQVOVnEekFLfgDILjmPJXSZJuKG1Ev2PaztQL9TxqH cL71ENcsOwlC5MAy2QBnckE62qMdwJseyLciKSi96DbwfV5rIQq7AJBF7FbAwUK1J/vH 8rsQ== X-Gm-Message-State: APzg51APQZvLk4KHbKmN9y7+WmES3p7Zui8sjd4tzEHqV6SclCQTNiFL i+lCc1mzHPyXDXfEsELi3mnEoA== X-Google-Smtp-Source: ANB0VdZ/E/lz3iOH2LtdoNBk8+GDUHWQpGLSND/ESB5kP0zRXLOnsySQS+FJ5zJa+7YFzSLqb3BlsQ== 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 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 X-Mailman-Approved-At: Tue, 11 Sep 2018 11:00:55 +0200 Cc: alsa-devel@alsa-project.org, Anders Roxell , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH] ALSA: hda: fix unused variable warning X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: alsa-devel-bounces@alsa-project.org X-Virus-Scanned: ClamAV using ClamSMTP 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(-) 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