Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1562615

Re: [PATCH] drm: tegra: shut up harmless warning on NOMMU

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Thierry Reding <thierry.reding@gmail.com>
Newsgroups linux.kernel
Subject Re: [PATCH] drm: tegra: shut up harmless warning on NOMMU
Date Thu, 19 Jan 2017 12:10:02 +0100
Message-ID <t1iLo-MP-17@gated-at.bofh.it> (permalink)
References <sYLAd-3jp-11@gated-at.bofh.it>
X-Original-To Arnd Bergmann <arnd@arndb.de>
Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=f3scY0eyvHqSqWHdZlUoC3j4RYacX18LxJtdNCpSb9E=; b=sA6f80I2yrkWUnU8lok4XBKwu3nTnooHStPms9A0e44MmOapJYaOHLFE/m8/l9Q61N hGMy9vGeUN/fcIwQ1sJZjix0x3iEsCqweFCxnBFfozOZ/qFoA9cEl9setZ116izMqlbS wt3Wu4fMXis4WZXbO9WbPfoB+m6JzKInqpUd6+I6AeUWl6kRTojC5466CmWCI0ETqIbC Vh/soJp3AUfFfO34pDtUHRaUpOEer2EKuHbZJcvnr5DQ+0ArlvyULWbw45XJ6Chjj9HL t+3R4MLG6zOIoAcT0wluM+jpGxkxtIo3bREDaINcOiQLDzZ7Lb0gs28V7ATTlWFCxT1+ Grcg==
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=f3scY0eyvHqSqWHdZlUoC3j4RYacX18LxJtdNCpSb9E=; b=h4FTWSgIDCO8tmkmyNSUFL+CHN0hAoqtVNWyFUXhknKoDtil/WEPiwg86inkXzGvlv ZmgsjKUV9tfMFiFYXIeaFZ+i+xfiX1nnFq62GUsnZ98n1lcdRi3GJ9xqZ71pqnbQIc6m FWsCoJz+GNTmKajhBGkb33hKLWsHZ4WmGb7RR7xbw07HJF9gCU+BIrJ7tFOalzq7fuLS EaKQBIGxYS60nOksyRVXtIotUV0+bCPnSLSVsJ87td5ir/3jJDi4pZoAK5cNjs+AD/mz 5C5m5EHCUw+K68pjuycgShaEdHqn0LaRwNiFZ7WOplxyYzKwESdo2kbMC2eMgQvMBiXD qFkA==
X-Gm-Message-State AIkVDXKPKue7kbYzuoVHs4cGEsbkdh19gl8VlLcTCHE6vS9wQRE4g3mx0L8UCVTgZHdc7w==
X-Received by 10.223.138.9 with SMTP id w9mr6949235wrw.50.1484823661011; Thu, 19 Jan 2017 03:01:01 -0800 (PST)
MIME-Version 1.0
Content-Type multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="sXc4Kmr5FA7axrvy"
Content-Disposition inline
User-Agent Mutt/1.7.2 (2016-11-26)
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 69
Organization linux.* mail to news gateway
X-Original-Cc David Airlie <airlied@linux.ie>, Stephen Warren <swarren@wwwdotorg.org>, Alexandre Courbot <gnurou@gmail.com>, Mikko Perttunen <mperttunen@nvidia.com>, Daniel Vetter <daniel.vetter@ffwll.ch>, dri-devel@lists.freedesktop.org, linux-tegra@vger.kernel.org, linux-kernel@vger.kernel.org
X-Original-Date Thu, 19 Jan 2017 12:00:58 +0100
X-Original-Message-ID <20170119110058.GD30182@ulmo.ba.sec>
X-Original-References <20170112111425.3228358-1-arnd@arndb.de>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1562615

Show key headers only | View raw


[Multipart message — attachments visible in raw view] - view raw

On Thu, Jan 12, 2017 at 12:13:51PM +0100, Arnd Bergmann wrote:
> The tegra DRM driver is almost ok without an MMU, but there
> is one small warning that I get:
> 
> drivers/gpu/drm/tegra/gem.c: In function 'tegra_drm_mmap':
> drivers/gpu/drm/tegra/gem.c:508:12: unused variable 'prot'
> 
> This marks the variable as __maybe_unused instead.
> 
> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
> ---
>  drivers/gpu/drm/tegra/gem.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/gpu/drm/tegra/gem.c b/drivers/gpu/drm/tegra/gem.c
> index 7d853e6b5ff0..63f14b7a59a0 100644
> --- a/drivers/gpu/drm/tegra/gem.c
> +++ b/drivers/gpu/drm/tegra/gem.c
> @@ -505,7 +505,7 @@ int tegra_drm_mmap(struct file *file, struct vm_area_struct *vma)
>  
>  		vma->vm_pgoff = vm_pgoff;
>  	} else {
> -		pgprot_t prot = vm_get_page_prot(vma->vm_flags);
> +		pgprot_t prot __maybe_unused = vm_get_page_prot(vma->vm_flags);

This seems to me like a suboptimal solution. The reason why this fails
is because pgprot_writecombine(prot) for NOMMU translates to __pgprot(0)
via a macro. This also means that we need to potentially add a
__maybe_unused annotation to every local variable that stores a value
that gets passed to pgprot_writecombine().

There fortunately aren't very many of those cases, but I still think
that a better solution would be to turn pgprot_writecombine() into a
static inline function, so that the parameter would get silently
ignored. Or perhaps if it must remain a macro, then doing the following
should still avoid the need to modify every call site:

	#define pgprot_writecombine(prot) ({ (void)prot; __pgprot(0); })

Thierry

Back to linux.kernel | Previous | NextNext in thread | Find similar | Unroll thread


Thread

Re: [PATCH] drm: tegra: shut up harmless warning on NOMMU Thierry Reding <thierry.reding@gmail.com> - 2017-01-19 12:10 +0100
  Re: [PATCH] drm: tegra: shut up harmless warning on NOMMU Arnd Bergmann <arnd@arndb.de> - 2017-01-19 16:20 +0100
    Re: [PATCH] drm: tegra: shut up harmless warning on NOMMU Thierry Reding <thierry.reding@gmail.com> - 2017-01-25 08:00 +0100

csiph-web