From nobody Sun Apr 19 09:11:50 2026 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 19A5FC43334 for ; Mon, 4 Jul 2022 11:43:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233195AbiGDLnl (ORCPT ); Mon, 4 Jul 2022 07:43:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232935AbiGDLnj (ORCPT ); Mon, 4 Jul 2022 07:43:39 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 55B62E0C8 for ; Mon, 4 Jul 2022 04:43:38 -0700 (PDT) Received: from dggpeml500023.china.huawei.com (unknown [172.30.72.56]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4Lc3m921KVzhZ6H; Mon, 4 Jul 2022 19:41:13 +0800 (CST) Received: from ubuntu1804.huawei.com (10.67.174.58) by dggpeml500023.china.huawei.com (7.185.36.114) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Mon, 4 Jul 2022 19:43:31 +0800 From: Xiu Jianfeng To: CC: , Subject: [PATCH -next] mm/mprotect: Remove the redundant initialization for error Date: Mon, 4 Jul 2022 19:41:12 +0800 Message-ID: <20220704114112.163112-1-xiujianfeng@huawei.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.67.174.58] X-ClientProxiedBy: dggems702-chm.china.huawei.com (10.3.19.179) To dggpeml500023.china.huawei.com (7.185.36.114) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The variable error will be assigned correctly before it is used, the initialization is redundant, so remove it. Signed-off-by: Xiu Jianfeng --- mm/mprotect.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/mprotect.c b/mm/mprotect.c index 041beeb5fad6..0420c3ed936c 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c @@ -663,7 +663,7 @@ static int do_mprotect_pkey(unsigned long start, size_t= len, { unsigned long nstart, end, tmp, reqprot; struct vm_area_struct *vma, *prev; - int error =3D -EINVAL; + int error; const int grows =3D prot & (PROT_GROWSDOWN|PROT_GROWSUP); const bool rier =3D (current->personality & READ_IMPLIES_EXEC) && (prot & PROT_READ); --=20 2.17.1