Message ID | 20240220051830.61099-1-zeming@nfschina.com |
---|---|
State | New |
Headers |
Return-Path: <linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:a05:693c:2685:b0:108:e6aa:91d0 with SMTP id mn5csp202245dyc; Mon, 19 Feb 2024 21:21:12 -0800 (PST) X-Forwarded-Encrypted: i=3; AJvYcCUmytAOcZNN6hmZJozuzY7aSg13r+bjOMTspOZrJitydy/WQve8MHnfU5l8Zv0ic8yDOtX4UTHmrGahirmXz78Mw3IO0w== X-Google-Smtp-Source: AGHT+IGtPYSod49hPdvN8U09nwoE5s6rK1i1jsWj33jZDmx8ggAM+GrQGXUlSazvEBO5CL5rSG/7 X-Received: by 2002:a05:6a00:6c95:b0:6e4:6a3f:f065 with SMTP id jc21-20020a056a006c9500b006e46a3ff065mr3541180pfb.10.1708406472718; Mon, 19 Feb 2024 21:21:12 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1708406472; cv=pass; d=google.com; s=arc-20160816; b=z7gp55xERlhbJSudi0IKePhb3yfnObx90HiAIhlcIZvdFyAiLbWhSnHpFcmyx+DMR2 Nws6O3+hOKFlk+Hjfq4Bza/pB9HGH+1Ci+ZT63knhzlpHDckO237yEZuOjx+uvt2J8yW w4BjW5mkUs9aqsUrxf7WbAVKxUMuu0N679Z73Dw9gnIVL7ltWSjWrqi2Ax3zPMqE1Nv3 z65fnrCUixnfo4Qf8m5AHx1o21eEJxCR5pH9ygEihfOrBVLas4ITFTzokPRJtcW0Iq03 zomEVHcR3PKGoSMeW274Hq9/Jq2LG18wTjYwfPgvpuS0G+v+bOoVkHfCNWCxdr6r9c0t k7ng== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:message-id:date:subject:cc:to :from; bh=PRvTW/Fxx7IuAl9WsFt4Rq5lAEduBniw16BQ7ekF7OM=; fh=v2fz/sRMjgxucNwET7tjkZ34H/eAm68AEQbRczZvf7Y=; b=N0Z6/bazgWR+b3IKaLuAhPQUv0ieKPGVs2hUh4GHLKO2I55CdrFneBTPPD/JdjrvnZ IAqqdGGr38bE7hreqqTUoPVohvVVjHrbObNZNlVneVAmMLk+lBNkO3VoA26lqKDtyCtu HkibHwQB6dR7xiy8QOYTo0PVYGywSzgmEsII4hiuVF+hTgsnv2K0avZ+l1rSxFwN6jZp 9WqhbMDpZppoL2AULrDExLgPun0x8xZvF6cIcrpCx/b+2NA8hxHtjO2ZHIp3yc9a3t8g JwVjbyhITNmom9GbTnV/GkvSQ+yuTbZsP5a/AKl4SaqOVz84x7AwPN0CUVX4g0ikKVoI TGRw==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org" Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id p15-20020a056a000b4f00b006e4647c26casi2722350pfo.348.2024.02.19.21.21.12 for <ouuuleilei@gmail.com> (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 19 Feb 2024 21:21:12 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; arc=pass (i=1 spf=pass spfdomain=nfschina.com); spf=pass (google.com: domain of linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-72341-ouuuleilei=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id D6DF6B20D91 for <ouuuleilei@gmail.com>; Tue, 20 Feb 2024 05:19:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 0436C57333; Tue, 20 Feb 2024 05:19:09 +0000 (UTC) Received: from mail.nfschina.com (unknown [42.101.60.195]) by smtp.subspace.kernel.org (Postfix) with SMTP id 0F060482D0; Tue, 20 Feb 2024 05:18:58 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=42.101.60.195 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708406347; cv=none; b=OmgTYeYRsM1e6Jj7khyqF3hR/mN95VwppG6RmY2FmIqDgcoXMLBZljEbpgkiGU9hurwrv6ipb4dD6BhdvXl3RtylKelmghrBo7v5CdEtvOTjpd2p3J5EFusGvUq/Q9OKWkpTZ6Cu1GzhVTn5zqpooAwL2hteph5t7O8tLEA3aU8= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1708406347; c=relaxed/simple; bh=WW6nBO6M2oCGgiocdFG4e1PF8PO+zS+gCZmKFpHIpp8=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version:Content-Type; b=SyW6wyixAF3KZRDpUYrJPyus1bECDYjWhxnrHDBuFBT7h25zWYdUf4ie0TJGiNhH8Wyw9g2utMoiNxqKlcPkvpS2uz+8uHPtFDHdatKhCN65d6Hzj9ApHyjpAJ1ISMRLVk6gkUVQsVd6WF0DHlRHU3Cdy0w9tw/5fAwGah6p1Jw= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com; spf=pass smtp.mailfrom=nfschina.com; arc=none smtp.client-ip=42.101.60.195 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=nfschina.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=nfschina.com Received: from localhost.localdomain (unknown [219.141.250.2]) by mail.nfschina.com (Maildata Gateway V2.8.8) with ESMTPA id BD124602610CC; Tue, 20 Feb 2024 13:18:37 +0800 (CST) X-MD-Sfrom: zeming@nfschina.com X-MD-SrcIP: 219.141.250.2 From: Li zeming <zeming@nfschina.com> To: viro@zeniv.linux.org.uk, brauner@kernel.org, ebiederm@xmission.com, keescook@chromium.org Cc: linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, Li zeming <zeming@nfschina.com> Subject: [PATCH] =?utf-8?q?exec=3A_Remove_unnecessary_=E2=80=98NULL=E2=80=99?= =?utf-8?q?_values_from_vma?= Date: Tue, 20 Feb 2024 13:18:30 +0800 Message-Id: <20240220051830.61099-1-zeming@nfschina.com> X-Mailer: git-send-email 2.18.2 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: <linux-kernel.vger.kernel.org> List-Subscribe: <mailto:linux-kernel+subscribe@vger.kernel.org> List-Unsubscribe: <mailto:linux-kernel+unsubscribe@vger.kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1791394025653343480 X-GMAIL-MSGID: 1791394025653343480 |
Series |
exec: Remove unnecessary ‘NULL’ values from vma
|
|
Commit Message
Li zeming
Feb. 20, 2024, 5:18 a.m. UTC
vma is assigned first, so it does not need to initialize the
assignment.
Signed-off-by: Li zeming <zeming@nfschina.com>
---
fs/exec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
Comments
On Tue, Feb 20, 2024 at 01:18:30PM +0800, Li zeming wrote: > vma is assigned first, so it does not need to initialize the > assignment. I don't really like removing explicit initializations. They don't cause any problems and the compiler will remove redundant stores, so there's no benefit in dropping them.
diff --git a/fs/exec.c b/fs/exec.c index af4fbb61cd53e..7be0527f5ff25 100644 --- a/fs/exec.c +++ b/fs/exec.c @@ -254,7 +254,7 @@ static void flush_arg_page(struct linux_binprm *bprm, unsigned long pos, static int __bprm_mm_init(struct linux_binprm *bprm) { int err; - struct vm_area_struct *vma = NULL; + struct vm_area_struct *vma; struct mm_struct *mm = bprm->mm; bprm->vma = vma = vm_area_alloc(mm);