From patchwork Sun Jan 27 04:11:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yang Fan X-Patchwork-Id: 10782677 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 42C6991E for ; Sun, 27 Jan 2019 04:12:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1DAC22C6B2 for ; Sun, 27 Jan 2019 04:12:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBC5B2C6B4; Sun, 27 Jan 2019 04:12:18 +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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 71ED82C6B2 for ; Sun, 27 Jan 2019 04:12:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A66FC8E00F9; Sat, 26 Jan 2019 23:12:15 -0500 (EST) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 9EE628E00C8; Sat, 26 Jan 2019 23:12:15 -0500 (EST) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 88F658E00F9; Sat, 26 Jan 2019 23:12:15 -0500 (EST) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-wr1-f72.google.com (mail-wr1-f72.google.com [209.85.221.72]) by kanga.kvack.org (Postfix) with ESMTP id 295148E00C8 for ; Sat, 26 Jan 2019 23:12:15 -0500 (EST) Received: by mail-wr1-f72.google.com with SMTP id z16so5293705wrt.5 for ; Sat, 26 Jan 2019 20:12:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:references; bh=VgvZcxRTKZNydZGMeLnIIEEwY33IYJfdy58ePKF8fks=; b=T37EErJRspKuMR3D+uvMWFxwNWIomnCDDtVm6+qYqmrDUUBmG/7XJ7SpxcoYUNtw74 5UJSjWeItMTIpFZ8gVS8DyR6rhg+DLp1ecmdrFK1UxNNSwEaCuszA8iMiLNjm1hsQG86 tMD6es7ZzUAi/hSlY4aVp3qWuxcARKFcbXSKzMZxF7XsNNw7Sh77flTmzk0myzcsjvHg kcZHeW9r1kN47ZpvDKi4OO842XuWmQ8hs5Q+n8A0tzZSimRtRPe9gi1LtfqSbLDc+L1s n9IJNYv/MYNVi5sYDV6i0XfB361+qEgLMQs28GRC1EXt2Tjmmkco0oPpiI2vwsYIS405 80hg== X-Gm-Message-State: AJcUukdDUm9+4i+491HM4BY6MPgS8IvDiK6GQOaNeUjt+uBK9qHgjH68 uMK8DK2dDtd37SVorV0/XcwPXeIeGfR1Fwsk8uCm5Im0xHl7mrOzoZEu8OW6O299g4NsGthnufh wl5IlWZMGEO+fTh/p5n5XT2gNtJVNPd+1Q8WFkZwvSWr49/zZyOGaTk+bm4tsmXcJcKEq1OYrdk q3+hsUeN2UivpdCOvyVfFCK6jsN5bTlRrdkxjKkK9B71XJ+MfcFZGuRob9Y51aqXMLwHcTTyDBh C3Lkph0BjnRBG9KYro/TrThBiDOCkpoHN7O5UjBwfmsi/7PN5TGJobcvPowaPoxYO0J4ItU8ytt T1URnCxMSgbQ+rncPikccYtZ2xYMbgYpqrn5KW1w3GsNE8lIFX/dZi1gZC8SQsD1+l+G+14tSyq Z X-Received: by 2002:a7b:c0c5:: with SMTP id s5mr12561148wmh.40.1548562334436; Sat, 26 Jan 2019 20:12:14 -0800 (PST) X-Received: by 2002:a7b:c0c5:: with SMTP id s5mr12561106wmh.40.1548562333286; Sat, 26 Jan 2019 20:12:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548562333; cv=none; d=google.com; s=arc-20160816; b=ndZpgOtKfRj9vyzGwdeXfiIYQEXSg9iRFIP9uECtdocObpbopLLRu8ZxEb8S6OEwsH Nrm0XNBU1u2+R1mfz8xUn5XR8IrUuV1fJwS6RrdPYXSmNf86VDGdlVJ/kmRBIIaGDReT Vj0XEbNS3eVH+q5dlbFCi0KP8MMPGvcwIa6OagnXBoQ/642ndzwl/iVB+55MCw6/PwS7 9Ys8g3Egsp2Gvl8EJU9kR0/HKk5QELv7UqauIEL36MRDK8Mg6PDFlacVFie068AEezFk T1nQVB2kZ46fIIAkWP5Vx9bf0cc/dqYm1JIEnrQrHjWQlDUyHMOSZT6ljKo6GdEtQYgR 6gmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:message-id:date:subject:cc:to:from:dkim-signature; bh=VgvZcxRTKZNydZGMeLnIIEEwY33IYJfdy58ePKF8fks=; b=hIn+D96UbPp8umvNtdbnV2h6beA7pDPxRjofhYPUgP+zEku23JWMd+VHFm58/PBwfD 90mAI404ZNiGBqUJ8/oy0FNrJO1Eb6Pr7E0bxcoxTG9wmdaSBuADnGNifpbktmh4WiuR ovW2Xs+9QXmWF+KMypo0YmcPfb4XLEXbJhGvjDrEv15tvwR/QI8pA0qVtDemEncyFsKG xD9IBH7bMS7VWkW4MbNBS+mwZCLj0gFURjA+zbXfnf9iiHUjqyI5+CthPTT00Qqai7rC 8ews/bwTutbLrIAcNp5V4iSlkhtzrJFnQ6S9KetP54Ug2uKQ3EtXLb0NEgM3JtKbd76L vr+w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c7HjVuVu; spf=pass (google.com: domain of nullptr.cpp@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nullptr.cpp@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from mail-sor-f65.google.com (mail-sor-f65.google.com. [209.85.220.65]) by mx.google.com with SMTPS id z16sor40862404wmc.11.2019.01.26.20.12.13 for (Google Transport Security); Sat, 26 Jan 2019 20:12:13 -0800 (PST) Received-SPF: pass (google.com: domain of nullptr.cpp@gmail.com designates 209.85.220.65 as permitted sender) client-ip=209.85.220.65; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=c7HjVuVu; spf=pass (google.com: domain of nullptr.cpp@gmail.com designates 209.85.220.65 as permitted sender) smtp.mailfrom=nullptr.cpp@gmail.com; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:references; bh=VgvZcxRTKZNydZGMeLnIIEEwY33IYJfdy58ePKF8fks=; b=c7HjVuVuxsfVxbY0XM1rrdYvfjT7xyNgGpSxMsBeC3xon/aNnnBfIGnR9iv4r7dSAL bCDr/BRfBBYe9dtdvY9729Z0KnCb9CDyYfwx7DwXMLn66Bu/qcPOBzsHS1WQb1/gZPiU WRZIQpfYootkmMvHDPl6ya1g5I9WjT8Fw4cpPA0bBetBJWxdrczsMF1bFlZNIpcd/yRr kMMse7Y8kWtHRzV7sk8eG/FmB3W7lpiogd9lDm74oZi344vkAd12ggLNcccWJbdS30cc 0pIMqZyY3FRVJIdRh1TbTtKNYQPUFKkyth4msUye8J/GeGE8T6FuxeXZBRzLfXSdyp/O WQ8Q== X-Google-Smtp-Source: ALg8bN4P76UKQ5q8W5T/wvwJpic1NAF3KRjstmwQ+BAUPx+UNRPmMVKLGyuhEmZNc7xjYLSz8jZWrA== X-Received: by 2002:a1c:4c0c:: with SMTP id z12mr11448849wmf.17.1548562332792; Sat, 26 Jan 2019 20:12:12 -0800 (PST) Received: from localhost ([81.17.27.135]) by smtp.gmail.com with ESMTPSA id v6sm107229768wrd.88.2019.01.26.20.12.09 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Sat, 26 Jan 2019 20:12:12 -0800 (PST) From: Yang Fan To: rppt@linux.ibm.com, william.kucharski@oracle.com, akpm@linux-foundation.org, will.deacon@arm.com Cc: Yang Fan , linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: [PATCH v2] mm/mmap.c: Remove some redundancy in arch_get_unmapped_area_topdown() Date: Sun, 27 Jan 2019 05:11:12 +0100 Message-Id: <20190127041112.25599-1-nullptr.cpp@gmail.com> X-Mailer: git-send-email 2.17.1 References: X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The variable 'addr' is redundant in arch_get_unmapped_area_topdown(), just use parameter 'addr0' directly. Then remove the const qualifier of the parameter, and change its name to 'addr'. And in according with other functions, remove the const qualifier of all other no-pointer parameters in function arch_get_unmapped_area_topdown(). Reviewed-by: Mike Rapoport Signed-off-by: Yang Fan --- Changes in v2: - Merge the two patches into one. mm/mmap.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index f901065c4c64..84cdde125d4d 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -2126,13 +2126,12 @@ arch_get_unmapped_area(struct file *filp, unsigned long addr, */ #ifndef HAVE_ARCH_UNMAPPED_AREA_TOPDOWN unsigned long -arch_get_unmapped_area_topdown(struct file *filp, const unsigned long addr0, - const unsigned long len, const unsigned long pgoff, - const unsigned long flags) +arch_get_unmapped_area_topdown(struct file *filp, unsigned long addr, + unsigned long len, unsigned long pgoff, + unsigned long flags) { struct vm_area_struct *vma, *prev; struct mm_struct *mm = current->mm; - unsigned long addr = addr0; struct vm_unmapped_area_info info; const unsigned long mmap_end = arch_get_mmap_end(addr);