Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp21744956ybl; Mon, 6 Jan 2020 10:20:33 -0800 (PST) X-Google-Smtp-Source: APXvYqyAmuhs+t+OtMpcbQn4Vxd2o8lzHHwdU1FJ2pr/f+wuQT+jf6knMV1wvWAzIfNVWWIMEDLH X-Received: by 2002:a05:6830:2053:: with SMTP id f19mr6373401otp.193.1578334832932; Mon, 06 Jan 2020 10:20:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1578334832; cv=none; d=google.com; s=arc-20160816; b=mY5SCnoHCd/pvcbxOkuEoO+UPt8fxHc/+Epv2onFxkcHYgEMlZwNN4KvGikV+3wlJM 6lM+2pDuKlxQ1c4Wk6MiLUxvkLs8x5sNvPbzsDOQtECdAtra5TbRAGaiEFEvKnR1jIcA PYzbFcymirnCtlWZPF1LXzpyD3xG2eFq3/HO8iQ9XFxYiJisy9uOSv4avKikeko81eeK mRnb01t0HqMi0zfIqWdmPUIiMwVn7JIheutpxZ4Vg4gig15+mHCgkFYriKDjiVa8K/Fo bhSRF0v25ZQYQQMmHwVmokV2/icSNvWflS82d3H5pk2V4OtJrpltCZJCdH8sPC9jIpKT 05eA== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=nXScf2fV8VApMCclCspG0/NU3rRPCV7iuw0tqqNpOPs=; b=XtyFnKUZ+/rOcysZgmoukbx3lM6W4xu+Yftn9BLrOv8ELl8yZpNmK1z35q0znrJ981 SzTjrNHnKSbAheIVxKorw/6KmXGezA37jMSogDITJdfszJD94Afbbo9jDtZywdQKvRUt 87kuEXdNxV2kKqzVmRSDuxTie8/YQ9kAfrbctdMm1hxWck8+ckzYmeKowtG0NCfBe+1K ++13LPEYCIuCiJSPhVKXoWOABdpP2b8r+axtwgJFgCmnUF6p6sqh3scKdCkxUbVVtaqq bdjPbBugczv+4Jcs4pPhS63aVtoDYXqKlxC5FLit9Vy/PWBwekwiW2useQ70d4FsCCWi ZbAw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id r14si30301536oic.12.2020.01.06.10.20.20; Mon, 06 Jan 2020 10:20:32 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726657AbgAFSTh (ORCPT + 99 others); Mon, 6 Jan 2020 13:19:37 -0500 Received: from foss.arm.com ([217.140.110.172]:46932 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726569AbgAFSTg (ORCPT ); Mon, 6 Jan 2020 13:19:36 -0500 Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 0FBE9328; Mon, 6 Jan 2020 10:19:36 -0800 (PST) Received: from [10.1.196.37] (e121345-lin.cambridge.arm.com [10.1.196.37]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 6D2B43F534; Mon, 6 Jan 2020 10:19:35 -0800 (PST) Subject: Re: [PATCH] iommu/dma: fix variable 'cookie' set but not used To: Qian Cai , jroedel@suse.de Cc: iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org References: <20200106152727.1589-1-cai@lca.pw> From: Robin Murphy Message-ID: <418dcce0-f048-a4cc-3360-d4b9c7926a6d@arm.com> Date: Mon, 6 Jan 2020 18:19:34 +0000 User-Agent: Mozilla/5.0 (X11; Linux aarch64; rv:60.0) Gecko/20100101 Thunderbird/60.9.0 MIME-Version: 1.0 In-Reply-To: <20200106152727.1589-1-cai@lca.pw> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-GB Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 06/01/2020 3:27 pm, Qian Cai wrote: > The commit c18647900ec8 ("iommu/dma: Relax locking in > iommu_dma_prepare_msi()") introduced a compliation warning, > > drivers/iommu/dma-iommu.c: In function 'iommu_dma_prepare_msi': > drivers/iommu/dma-iommu.c:1206:27: warning: variable 'cookie' set but > not used [-Wunused-but-set-variable] > struct iommu_dma_cookie *cookie; > ^~~~~~ Fair enough... I guess this is a W=1 thing? Either way there's certainly no harm in cleaning up. Acked-by: Robin Murphy > Fixes: c18647900ec8 ("iommu/dma: Relax locking in iommu_dma_prepare_msi()") > Signed-off-by: Qian Cai > --- > drivers/iommu/dma-iommu.c | 3 --- > 1 file changed, 3 deletions(-) > > diff --git a/drivers/iommu/dma-iommu.c b/drivers/iommu/dma-iommu.c > index c363294b3bb9..a2e96a5fd9a7 100644 > --- a/drivers/iommu/dma-iommu.c > +++ b/drivers/iommu/dma-iommu.c > @@ -1203,7 +1203,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr) > { > struct device *dev = msi_desc_to_dev(desc); > struct iommu_domain *domain = iommu_get_domain_for_dev(dev); > - struct iommu_dma_cookie *cookie; > struct iommu_dma_msi_page *msi_page; > static DEFINE_MUTEX(msi_prepare_lock); /* see below */ > > @@ -1212,8 +1211,6 @@ int iommu_dma_prepare_msi(struct msi_desc *desc, phys_addr_t msi_addr) > return 0; > } > > - cookie = domain->iova_cookie; > - > /* > * In fact the whole prepare operation should already be serialised by > * irq_domain_mutex further up the callchain, but that's pretty subtle >