From patchwork Thu Oct 12 09:46:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Arnd Bergmann X-Patchwork-Id: 115597 Delivered-To: patch@linaro.org Received: by 10.140.22.163 with SMTP id 32csp1737273qgn; Thu, 12 Oct 2017 02:47:14 -0700 (PDT) X-Google-Smtp-Source: AOwi7QCjilQUI7l0g4Fjqk4Evbhv6YZcj3s9a6XxVvp7AF2fZoI2o0lZINd5/H5/1n9gtd2BHI9u X-Received: by 10.98.194.215 with SMTP id w84mr1662860pfk.255.1507801634259; Thu, 12 Oct 2017 02:47:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1507801634; cv=none; d=google.com; s=arc-20160816; b=fOwBkAhxKaXnfqYiWx08pljSfiAidpnE+jcQ944/3z3hKgLpiS80YQWwIkTE1AuxUr fTyH5ET+YPBZ5avf3ev3EhU7xJ410be4revPIlbJLl91j2rT/H010U8vfhB3fAeIQuMl uDsQpVwzXxZe4OUPgEGBPlogfAvAPSExOHiYa8v6kSftNdPH0cWEfLDbsGlJ5Ax2m33a JMa6I7XI/bxny2xEhPn+aEiKXiH1KdLDeCz4uCINRQoqQbiNPPzAJUTqsfT1sP1DhaTz J66cy3KLwciT1I6XOCg67tzwyb6U0NMiqUm54tQG2M9qW5i/X3s5ZjhUwyzCxUA/ZlBF CVuA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :arc-authentication-results; bh=AjTiAqFX21HFlGrrtbvdMhcjGvsUI0GpW09Fzr5a2hQ=; b=m7Fp1c0uqsksbMlwOn0TL2pGmz9zJyiWT6MwSm5I6BpNm90WKiRE4xQW2wtj4DKm5Z 6/u1CTsdBKyHkE1ZXKLcxHOUBrHNz4oHeUvHn6i7a2L6ZbK7kpiAOb4spOvnmBilIbdw EMnKE/W1BEY1BIVelaLC0s5f7sotp1JC+s2HI35RBblp6mB2MbYL3UhYEJwlbiAsTf47 vrdINZ9KHOWlRQxB6BirRxODwrUXnagSPQY8Ma6mF2RblmlC55smHuVcQ9trA6yka103 dr6+u6ga09PTj9KYsauVd6Bo6g05++ctqkfSox/2IBzzrulEeXAIAhq8F7bEErz3jH4N 731g== 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 d26si12985203plj.369.2017.10.12.02.47.13; Thu, 12 Oct 2017 02:47:14 -0700 (PDT) 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 S1751900AbdJLJrM (ORCPT + 27 others); Thu, 12 Oct 2017 05:47:12 -0400 Received: from mout.kundenserver.de ([217.72.192.73]:63673 "EHLO mout.kundenserver.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750722AbdJLJrK (ORCPT ); Thu, 12 Oct 2017 05:47:10 -0400 Received: from wuerfel.lan ([46.223.139.202]) by mrelayeu.kundenserver.de (mreue101 [212.227.15.145]) with ESMTPA (Nemesis) id 0LjJmB-1dPOJL48VD-00dWFE; Thu, 12 Oct 2017 11:47:05 +0200 From: Arnd Bergmann To: Nicolas Pitre , Alexander Viro Cc: Arnd Bergmann , Ingo Molnar , Frederic Weisbecker , Nicolas Pitre , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org Subject: [PATCH] elf_fdpic: fix unused variable warning Date: Thu, 12 Oct 2017 11:46:22 +0200 Message-Id: <20171012094703.3123730-1-arnd@arndb.de> X-Mailer: git-send-email 2.9.0 X-Provags-ID: V03:K0:MP9aYa/CKob7dH9xVooNkX8qOdhN5W6tHKYQFuiloD05AjAQ6Ya 3Ep8z35nWoqFHRIGuetGhJ17d0YpgfFuzhGlYNKWmNPko9DWwPXjjhx85sF12ekB/3SK8il JP3TR+HraiUszAr97PPDRWY0P4ILiyKVoz16Z2JdDkGGttAcXAqJzMMLVzltcJcbqqmDl/F BGTlxd7MXCiXJkCIqUy8g== X-UI-Out-Filterresults: notjunk:1; V01:K0:CASv11I1Pe0=:lZJHsOSo15SXC8ToP2jP0K z7TKcBmOtjTRob/9P7h+5zomltZCeHRvSYEirQBPq72lVqvsLpZTgZi4w5P1lwKeqdd8ZW2AM qkb4bMXoE8tC/1E7I1Mu7HkZ6vsRD4lghx1LRMTEQYKKUDNYZRWt0TrSuz/mMRpt/Y9NbZNES mZ4ojx96u2pECAJVoAugRhVYy5BTdPFnHeqQwjE8jYlInZcA53F4Z8TaKhWh6T5y1owtU5IBr C8HFE7reXsu5SkxvzA/J0vpF5O6swgeTXe9h7J31o9sFhC8RXsqCMFNVP/x6CM5Nc2EoHJqRS HYEqh6nKhPZZOvt3W164gvJufY7ygyAXUW6bax2IHsOUv5O02gL8d2gQNZFzSbQ+ahEFZxrOC tOmf7ddJjXj581PutGYewMzbSfxQsIzMBy+ocU4dpepx0SnKGEZum3lb+17GfvQqo/C3EwSxK nMHGQw1j1r1QMDTNROTEc6/W3EIb/R0RU4IfewtZgzO9bhTtfm+BGdOCpLoMaR9YEvsiYH5m3 m8GUE04V66VYAUm9jbRrQZPqjkMMpxJdbKwS/f/G0r/8DjcIAZ44XKhf2Ns0ixid1/aJ8XXAW IuJpK+UZr5Cb+FqCCsaoSSWrvwStBsKPqOYiSoBBWW41p14zzdB9FLIOpVbFI4eZyujEGegdx WAbiv1wzritjsSa/Uh9Xe27UnAS2mm1IBipP0otReSwr6UkyJWFL11TdkhWM9mk8TvGW2s1HB PlCZb0n3qEJsYJn/E4lYLljoJdFMY2xBBoazuw== Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The elf_fdpic code shows a harmless warning when built with MMU enabled, I ran into this now that the configuration is possible on ARM randconfig builds: fs/binfmt_elf_fdpic.c: In function 'elf_fdpic_dump_segments': fs/binfmt_elf_fdpic.c:1501:17: error: unused variable 'addr' [-Werror=unused-variable] This adds another #ifdef around the variable declaration to shut up the warning. Fixes: 382e67aec6a7 ("ARM: enable elf_fdpic on systems with an MMU") Fixes: e6c1baa9b562 ("convert the rest of binfmt_elf_fdpic to dump_emit()") Signed-off-by: Arnd Bergmann --- Who should pick this up? I guess it could go through either the ARM tree that introduced the warning for ARM and contains a number of fdpic patches, or it could go through the VFS tree. --- fs/binfmt_elf_fdpic.c | 2 ++ 1 file changed, 2 insertions(+) -- 2.9.0 Acked-by: Nicolas Pitre diff --git a/fs/binfmt_elf_fdpic.c b/fs/binfmt_elf_fdpic.c index 5429b035e249..429326b6e2e7 100644 --- a/fs/binfmt_elf_fdpic.c +++ b/fs/binfmt_elf_fdpic.c @@ -1498,7 +1498,9 @@ static bool elf_fdpic_dump_segments(struct coredump_params *cprm) struct vm_area_struct *vma; for (vma = current->mm->mmap; vma; vma = vma->vm_next) { +#ifdef CONFIG_MMU unsigned long addr; +#endif if (!maydump(vma, cprm->mm_flags)) continue;