From patchwork Mon Jul 4 11:41:12 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiu Jianfeng X-Patchwork-Id: 12905167 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id AA3F2C433EF for ; Mon, 4 Jul 2022 11:43:44 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 44AEE6B0074; Mon, 4 Jul 2022 07:43:44 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 3FB066B0075; Mon, 4 Jul 2022 07:43:44 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2EA486B0078; Mon, 4 Jul 2022 07:43:44 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 20E686B0074 for ; Mon, 4 Jul 2022 07:43:44 -0400 (EDT) Received: from smtpin04.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay13.hostedemail.com (Postfix) with ESMTP id F044460704 for ; Mon, 4 Jul 2022 11:43:43 +0000 (UTC) X-FDA: 79649232726.04.C3105F7 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by imf15.hostedemail.com (Postfix) with ESMTP id 91302A005C for ; Mon, 4 Jul 2022 11:43:42 +0000 (UTC) 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 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1656935022; a=rsa-sha256; cv=none; b=VjrFoAbNGdmgt6y6QjVat1IkZOtQT94FX4NPaOouqgzZ5lGRKQpNAZaP3ji9mmNFGWOVo4 790kj/bzaHtr/gvu8zrstNShm4Iy5YGJANPiNWqmzy+SbvpbBG+fGFDhZOmPTPdXTFepT6 C+UyE7Nq06joHNHbGQzH+qOntlDPd7I= ARC-Authentication-Results: i=1; imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1656935022; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references; bh=J5ZgGxzubiRn1OyCn1yCszh3bhVgLJ6Wnj2Q7X/05es=; b=f88iCNu1b8qB3afwpxvTElPOiGy4qPJ35/Pc8oDXWFJpzOCMBA3kHwGmy3ms2htjoKhwhd eRPiBKCGGnfE5r7Oua8YJR3oM/4hiSTaT3zZ8pJZZkKVbCE4H10KQwqSMs8zRaGw0EY/BR WPdboQhAiB6koAkwNPW044OHbsc2dU0= X-Stat-Signature: 8c3b1bd5fuz3wxtf6bjby7b7iiseh9ik X-Rspamd-Queue-Id: 91302A005C Authentication-Results: imf15.hostedemail.com; dkim=none; spf=pass (imf15.hostedemail.com: domain of xiujianfeng@huawei.com designates 45.249.212.187 as permitted sender) smtp.mailfrom=xiujianfeng@huawei.com; dmarc=pass (policy=quarantine) header.from=huawei.com X-Rspam-User: X-Rspamd-Server: rspam12 X-HE-Tag: 1656935022-453642 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: 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 = -EINVAL; + int error; const int grows = prot & (PROT_GROWSDOWN|PROT_GROWSUP); const bool rier = (current->personality & READ_IMPLIES_EXEC) && (prot & PROT_READ);