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: 10595743 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 ED05614BD for ; Tue, 11 Sep 2018 14:19:44 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id DCF0F29672 for ; Tue, 11 Sep 2018 14:19:44 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id D11882967D; Tue, 11 Sep 2018 14:19:44 +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 17EDB29672 for ; Tue, 11 Sep 2018 14:19:44 +0000 (UTC) Received: from alsa0.perex.cz (localhost [127.0.0.1]) by alsa0.perex.cz (Postfix) with ESMTP id F3725267803; Tue, 11 Sep 2018 16:19:42 +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 80087267806; Tue, 11 Sep 2018 16:19:40 +0200 (CEST) Received: from mail-lf1-f66.google.com (mail-lf1-f66.google.com [209.85.167.66]) by alsa0.perex.cz (Postfix) with ESMTP id 9604926779D for ; Tue, 11 Sep 2018 16:19:38 +0200 (CEST) Received: by mail-lf1-f66.google.com with SMTP id r4-v6so20433644lff.12 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=a9MMJp9vxf4tSMsW5EMNwDicS+h1ZcMu/0waop8/EhFhptaR2d2aGW+NypQISWFH4H 5xXr7kOrLhYfkfO3rQPFTPENZad5rjxZ7vvI8qesHuvGl92nT1RsV7Dc3+2TWReloGpn ooxbcAuayIFerLIumkN9G6pgxtiX/qI4F+oHls1YEG1h3z1ebnydWH5i4WdMZ9BikvKo FxPxKSYmhFKkO3sXRBXfeqEfkdCou5qRPktjEDvxlQhzL6Hj1nN6ErfyBI2mCh1xYW50 2z1E3LDT6Pw1d5Oxn+8Ivg4+nTJtTH+NDgAVbsSsBwMoPn2xq/JWHE/zpmVtGk6lgt5L Fwug== X-Gm-Message-State: APzg51Davfslho2H89X/njMgNVJWVwsPocNdkW31Ou2nHJ7wCRrjDLTC KJt+6M7+MpqV+LxLQcFF5IGRUQ== X-Google-Smtp-Source: ANB0VdbDrsl4ptpDWhGGT68nIJWXLeY33tqOW4O2/FUKoRcRugOy39jRk9wwmt1JqImCUQsNFPb4Cw== 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 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 Cc: alsa-devel@alsa-project.org, Anders Roxell , linux-kernel@vger.kernel.org Subject: [alsa-devel] [PATCH v2] 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..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