From patchwork Tue Dec 22 10:32:49 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Adrian Huang X-Patchwork-Id: 11986283 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-15.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 61666C433E0 for ; Tue, 22 Dec 2020 10:33:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id C2E1E21E92 for ; Tue, 22 Dec 2020 10:33:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org C2E1E21E92 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id E4DA16B006C; Tue, 22 Dec 2020 05:33:13 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DFEB56B0070; Tue, 22 Dec 2020 05:33:13 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id CEC4C6B0072; Tue, 22 Dec 2020 05:33:13 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0112.hostedemail.com [216.40.44.112]) by kanga.kvack.org (Postfix) with ESMTP id B58156B006C for ; Tue, 22 Dec 2020 05:33:13 -0500 (EST) Received: from smtpin21.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 74FF78249980 for ; Tue, 22 Dec 2020 10:33:13 +0000 (UTC) X-FDA: 77620555866.21.ghost16_610a8932745f Received: from filter.hostedemail.com (10.5.16.251.rfc1918.com [10.5.16.251]) by smtpin21.hostedemail.com (Postfix) with ESMTP id 46DCB180442C0 for ; Tue, 22 Dec 2020 10:33:13 +0000 (UTC) X-HE-Tag: ghost16_610a8932745f X-Filterd-Recvd-Size: 3789 Received: from mail-pf1-f182.google.com (mail-pf1-f182.google.com [209.85.210.182]) by imf31.hostedemail.com (Postfix) with ESMTP for ; Tue, 22 Dec 2020 10:33:12 +0000 (UTC) Received: by mail-pf1-f182.google.com with SMTP id x126so8220287pfc.7 for ; Tue, 22 Dec 2020 02:33:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=tKvj/bgBxxRfTrzQHkXMUBOh8hAoOnZqz+jw3Vt0T14=; b=nNPjFRIU5VfWu2eZMPupGYHVwbbiSWJ5G5SKF/W3DAmbSP6HN0+5C0/SctOdG8rwMC WZfZQQxPxbeBqDxHMcNM9G5bHCiTqaj4vAICZvFNUBocn+i3F1WyXlA3l1YRd4IeiL6P E/uT90uBqjA6XCB2k1hOBCNY19x5xxNRkZDH+aolxHlpzGXTf8H+2w26mp/Cx+Oqw8sn qFhZAkfl/7zXNZbYzts6wlWMtgzZGmLTD50htIz2ZBchIjH5IH16cHIW3FhR/EeWtTsU Rcc2LGwaUT4N3dczOM8w1VDhMIFdrnBQ9yz/BcB307XbFP/Dpf7lbfqNGyRNZRBT2U6y dxow== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=tKvj/bgBxxRfTrzQHkXMUBOh8hAoOnZqz+jw3Vt0T14=; b=Jqf8w1CFYwFpE+yiXbDvl+DWbt++wn9i4e8sT7MVdclzPoI5PNGqvXE/GeQuqQE2Hy 46Dy6XRk2kmtR4yN8ZSe3LNvLOS7jqFsRO0f5OHuQnhPiUol0gojSQA2VSATD675/z92 bLqPeBIHZffzJqS6dG1cZkgev0s/q6XZK6NCSvVwtYHrPW0jnu2I8B56H0cGiiYk4Oew pxdYeBgz43ROP5UTLuExCGvJ/aAKSWgV7fMl5v6//3i5QF+vA6hErqC1vMoWeodDCgE9 qc4oZ2ugmgLmRORA+yBSm68/PVIi5nWK2x06sHv2R0X7FFGEmSEG9sbnW2v6/l87e45x TQKg== X-Gm-Message-State: AOAM5300ukdgioB91eJyrJYERn11aXyjKi+TL9lAXDhOrDu7rPt2+gVA 8mFzGyE3o4rs+i+rCiXAc7o= X-Google-Smtp-Source: ABdhPJx8ERswps1fe+Wik010yphFdC7kHeZeeIx5Vrx53MSD1x2XRETDZmkQx10N1+t+ojyJC9+Ijg== X-Received: by 2002:a63:ea01:: with SMTP id c1mr18979021pgi.138.1608633191960; Tue, 22 Dec 2020 02:33:11 -0800 (PST) Received: from AHUANG12-1LT7M0.lenovo.com (220-142-211-188.dynamic-ip.hinet.net. [220.142.211.188]) by smtp.gmail.com with ESMTPSA id b189sm19854229pfb.194.2020.12.22.02.33.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 22 Dec 2020 02:33:11 -0800 (PST) From: Adrian Huang To: Andrew Morton Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, Adrian Huang , Adrian Huang Subject: [PATCH 1/1] mm: mmap: Remove unnecessary local variable Date: Tue, 22 Dec 2020 18:32:49 +0800 Message-Id: <20201222103249.30683-1-adrianhuang0701@gmail.com> X-Mailer: git-send-email 2.17.1 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: From: Adrian Huang The local variable 'retval' is assigned just for once in __do_sys_brk(), and the function returns the value of the local variable right after the assignment. Remove unnecessary assignment and local variable declaration. Signed-off-by: Adrian Huang Acked-by: Souptick Joarder Reviewed-by: David Hildenbrand --- mm/mmap.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/mm/mmap.c b/mm/mmap.c index dc7206032387..482c0c0bbe06 100644 --- a/mm/mmap.c +++ b/mm/mmap.c @@ -189,7 +189,6 @@ static int do_brk_flags(unsigned long addr, unsigned long request, unsigned long struct list_head *uf); SYSCALL_DEFINE1(brk, unsigned long, brk) { - unsigned long retval; unsigned long newbrk, oldbrk, origbrk; struct mm_struct *mm = current->mm; struct vm_area_struct *next; @@ -281,9 +280,8 @@ SYSCALL_DEFINE1(brk, unsigned long, brk) return brk; out: - retval = origbrk; mmap_write_unlock(mm); - return retval; + return origbrk; } static inline unsigned long vma_compute_gap(struct vm_area_struct *vma)