Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5053811pxu; Tue, 22 Dec 2020 07:19:51 -0800 (PST) X-Google-Smtp-Source: ABdhPJw6vdyy5rtrlax/47vBaqnbNK4SRv7fIYf5R86XaoHNQla+CuoL72lbSjqnEocpxreFn+q0 X-Received: by 2002:a17:906:5e0d:: with SMTP id n13mr20009460eju.500.1608650391651; Tue, 22 Dec 2020 07:19:51 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608650391; cv=none; d=google.com; s=arc-20160816; b=DL9bvPoijIVFy3V+xrfePSnpRR2jJv9+c/dG/VKpcDC+1ivLSdLkvByjFletWrRT3q 4ZaEdmLIiNPvOEkUA/Xax0cG6AsrA+zWnKVssI6esq6lVggJgRnRAaEcTp/hIURIuLnT S0bpJorLY9RfCt8GfoMeDwMrFi4Ct0m0WnNo78vlQPsfQEizgfuXpNzC8OFSuNoxgiNB xGL9jqtW+V+dkXPuIrRYD2cJ6y9jma7fygyvbI+0xkrWE6bugS+PQF52vMq1yecj/gRD tKDTA2ZN5wI8aRcdwWMVVP9zM5Q8L9c/eRlnLq5qc5pNtJjBds2Jw6lN7MicG4Hk5MHi 46AA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=WNvEywE4N7FwZmVI1O0uZ1CSue5bVfV4HsVUoFw6O1k=; b=yfDZpGeYD7crVPnL+vA/s4GgiGMHlEtljnY4SjTdi0TVBTs9rSB4k07oWjyL1j/EbK YdgdBM5q8O4cV/rQH47KZ+rkFJeuSyndmbnFV1g0g2sFSgQRetgPxduWZmCq8igKCFlY n3z6YYAius8cahd3RoTmgs8JmdxEqfLk8QH5p89iuBQrqisTA6UcpCEj5PoAx16cg8Ou HOLM+CCvNY4TAsmDUtBAuxz69eDs0jppHJtLtqLt05IHSyCX+ovXEZfI/RV7pCxEwSZA 1RSgI74i+u+3AKEDpjWWH7qns6Ny6jwFT71EP0SYJ8BYrN4h08/rff/tyWLk0Xuq4rqz STtg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tU997nhp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id 15si11418923ejg.14.2020.12.22.07.19.28; Tue, 22 Dec 2020 07:19:51 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=tU997nhp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727301AbgLVPSt (ORCPT + 99 others); Tue, 22 Dec 2020 10:18:49 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47328 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727224AbgLVPSs (ORCPT ); Tue, 22 Dec 2020 10:18:48 -0500 Received: from mail-ua1-x933.google.com (mail-ua1-x933.google.com [IPv6:2607:f8b0:4864:20::933]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A2C46C0613D6 for ; Tue, 22 Dec 2020 07:18:08 -0800 (PST) Received: by mail-ua1-x933.google.com with SMTP id s42so4457213uad.11 for ; Tue, 22 Dec 2020 07:18:08 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=WNvEywE4N7FwZmVI1O0uZ1CSue5bVfV4HsVUoFw6O1k=; b=tU997nhp1DAk8WDgVSQidbAlIcd81As9uEyx6upqk/DIAlddNALgnswvNtu7bvf+Er GK4+nxPgtY1/UJIFKfsHLhCEFZqM8htZ/nlGdPIKMI3PGI6j4o8dZzTqET5t+DdLSip+ oB5jVwM5+cWFyOwbDCyXCtNedqJ+Ol3y+57yL9TJGu9cxNtmWtIyy44MiCanfrkDtueS pvsSgfh1SwRoAOvijK/0qa45jY0dOznTCXMItKSpLoRzOI5G8JH7pNnL34TdflIswph5 m7ytV2G6ijG3XjuCcA/w4/D5XbU0Udp2QhiM9Jx9BW2OGlWPJl5DDR9bQf+pTrTAG139 EYHQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=WNvEywE4N7FwZmVI1O0uZ1CSue5bVfV4HsVUoFw6O1k=; b=RAxr0Xn2gegX7+o09o1mOEajTmZy3x49+xQFk/WnADGUycrsJimr0VsGrG9HjCbMCo NWyJVJ1NLIfr1EjcZpwtboXeoqY34m0o8bK8QlZs4htMCTZ6k9NTTSlJJfT5JX4uyHxl l3KLgIcMAenydm5F7F9xdl5AEC53Aiq57qvUxUPNHFI/BR8pq8cHi/PprEWHBS5Wx7jc 0cEk8TINutVNk3f7u4zcRWBCYCaym/UZa5+5wpILhdQdg9t9K5oUeiGskDY0dvjB5oLy 6VYkKtMh6BctCZ1vlM+fpRAdSx9fzZY94rk1e5Kf979vTDY2c2c8F7lqu8FHXQpdbHNw 7imw== X-Gm-Message-State: AOAM533OiG+IiHt5k1YLT4b6KtOO9vPoLQHXCPDre6/ncCnsYGjbFKoF BXVnSYjBNID9v5ZFdZxd6JoRDL5WHscJbopY/cEWAdwtkRI= X-Received: by 2002:ab0:2e8e:: with SMTP id f14mr15643141uaa.22.1608650287878; Tue, 22 Dec 2020 07:18:07 -0800 (PST) MIME-Version: 1.0 References: <20201222103249.30683-1-adrianhuang0701@gmail.com> In-Reply-To: <20201222103249.30683-1-adrianhuang0701@gmail.com> From: Souptick Joarder Date: Tue, 22 Dec 2020 20:47:56 +0530 Message-ID: Subject: Re: [PATCH 1/1] mm: mmap: Remove unnecessary local variable To: Adrian Huang Cc: Andrew Morton , Linux-MM , linux-kernel@vger.kernel.org, Adrian Huang Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 22, 2020 at 4:03 PM Adrian Huang wrote: > > 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 > --- > 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) > -- > 2.17.1 > >