Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp7076395ybi; Thu, 13 Jun 2019 09:10:11 -0700 (PDT) X-Google-Smtp-Source: APXvYqwxqObtUMmPOKtdUjBgkfmjaVBkmsIIlSn9Rj4n53lTy7DjktDKXM09wVhQoix6a8INK0ST X-Received: by 2002:a17:902:e08b:: with SMTP id cb11mr89090112plb.122.1560442211409; Thu, 13 Jun 2019 09:10:11 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560442211; cv=none; d=google.com; s=arc-20160816; b=REsZw2i09TkD9Uqh8KCQyYei5zGSeMwfQoAGQFi+IimIXNKa7iApFcYT8MPJriwOZH n0AkLbyLmaW+shk8N91Uvmr0KmIooD9maLt36QwdwiACf/9br1QW82VcV+tSq8AxjvfP 5OEDYl3azcNwNXNlPCDQA7y3C8AOrCjMqMPou6RaZKWIKLGc9/6c20bJabTSF7GDLkan DNciZ9ZIyny+3AEdcusBac0n+pM18wgh3T7q5MMz+iXYgwIdjzqdI6qOqFIiSZA/uJ9l cIFCmM8RxgGH2NNcs+Tf/8cbJh8j80Y5D7eR9uwjINmh+Z3X2bNjXFgeNtGhK7s/XQxt gjyg== 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:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=F4ZAetQ+yWXeZISUjpZ+C8sOJTM+DJ/3FpcwoNHGDiU=; b=e/MoLXW8tR75H5kAMapi9pSicX8xPrzI/7dHeMrpFKoMCDIbO84Gshm8ewsdItmFNx CN+W4rhlO3MoUTOa6E3ckPmQNqoitzO2ZMZb0EJQ2Jh/PTH4oIQrfHNFho7O1/VKHHzK L00fy2+FCqH+78ByYRkjg/un+aHCN2eHTgQdiEvMA8eIA53bCEQOtpQ1/1iQDCqx2YO0 Te+STAzarHO3KV8tNV0y2ViC+D7gQI71b9++MHg/sBx+/DVMGTREAxODF/wayg6cRRQt AB6On/oV76riNaNLAnC8aBa4vWu5MFP2/T7L67oi+Kh++ehu0xGLMD3ieI8WHRYlOffR idpQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=PrgboXWF; 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 w4si145292pgr.150.2019.06.13.09.09.56; Thu, 13 Jun 2019 09:10:11 -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; dkim=pass header.i=@kernel.org header.s=default header.b=PrgboXWF; 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 S2391271AbfFMQJv (ORCPT + 99 others); Thu, 13 Jun 2019 12:09:51 -0400 Received: from mail.kernel.org ([198.145.29.99]:33164 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731258AbfFMIoP (ORCPT ); Thu, 13 Jun 2019 04:44:15 -0400 Received: from localhost (83-86-89-107.cable.dynamic.v4.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id D125E20851; Thu, 13 Jun 2019 08:44:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1560415455; bh=TjV3RwwWRZ1gCM6lQIitVpUg75zrgZi1QDrGyCoKdYg=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrgboXWFGLYiUwFY5Lq4DlrXrez9aTbtHxmv8F6CpFcXOdWBSMGl1A9Q5C3aYKdBq LJiGOtAxdfKRYIlVA3bRHzwLM/BGGSRMMKNNo7ORPq+pdWlQiIlK+9zpf2w52PmxNy GQum0uKukqBHWyEQ0ee4JgkxYXFO3zvb5VJ4xfGM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Mike Rapoport , Andrew Morton , Song Liu , Linus Torvalds , Sasha Levin Subject: [PATCH 5.1 010/155] mm/mprotect.c: fix compilation warning because of unused mm variable Date: Thu, 13 Jun 2019 10:32:02 +0200 Message-Id: <20190613075653.320914667@linuxfoundation.org> X-Mailer: git-send-email 2.22.0 In-Reply-To: <20190613075652.691765927@linuxfoundation.org> References: <20190613075652.691765927@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [ Upstream commit 94393c78964c432917014e3a456fa15c3e78f741 ] Since 0cbe3e26abe0 ("mm: update ptep_modify_prot_start/commit to take vm_area_struct as arg") the only place that uses the local 'mm' variable in change_pte_range() is the call to set_pte_at(). Many architectures define set_pte_at() as macro that does not use the 'mm' parameter, which generates the following compilation warning: CC mm/mprotect.o mm/mprotect.c: In function 'change_pte_range': mm/mprotect.c:42:20: warning: unused variable 'mm' [-Wunused-variable] struct mm_struct *mm = vma->vm_mm; ^~ Fix it by passing vma->mm to set_pte_at() and dropping the local 'mm' variable in change_pte_range(). [liu.song.a23@gmail.com: fix missed conversions] Link: http://lkml.kernel.org/r/CAPhsuW6wcQgYLHNdBdw6m0YiR4RWsS4XzfpSKU7wBLLeOCTbpw@mail.gmail.comLink: http://lkml.kernel.org/r/1557305432-4940-1-git-send-email-rppt@linux.ibm.com Signed-off-by: Mike Rapoport Reviewed-by: Andrew Morton Cc: Song Liu Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds Signed-off-by: Sasha Levin --- mm/mprotect.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 028c724dcb1a..ab40f3d04aa3 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -39,7 +39,6 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, unsigned long addr, unsigned long end, pgprot_t newprot, int dirty_accountable, int prot_numa) { - struct mm_struct *mm = vma->vm_mm; pte_t *pte, oldpte; spinlock_t *ptl; unsigned long pages = 0; @@ -136,7 +135,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, newpte = swp_entry_to_pte(entry); if (pte_swp_soft_dirty(oldpte)) newpte = pte_swp_mksoft_dirty(newpte); - set_pte_at(mm, addr, pte, newpte); + set_pte_at(vma->vm_mm, addr, pte, newpte); pages++; } @@ -150,7 +149,7 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, */ make_device_private_entry_read(&entry); newpte = swp_entry_to_pte(entry); - set_pte_at(mm, addr, pte, newpte); + set_pte_at(vma->vm_mm, addr, pte, newpte); pages++; } -- 2.20.1