From patchwork Fri Nov 4 03:16:44 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Deming Wang X-Patchwork-Id: 13031221 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 BA2FEC433FE for ; Fri, 4 Nov 2022 03:17:03 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 35A8E6B0071; Thu, 3 Nov 2022 23:17:03 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 30B056B0073; Thu, 3 Nov 2022 23:17:03 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 1F91B6B0074; Thu, 3 Nov 2022 23:17:03 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0012.hostedemail.com [216.40.44.12]) by kanga.kvack.org (Postfix) with ESMTP id 1113D6B0071 for ; Thu, 3 Nov 2022 23:17:03 -0400 (EDT) Received: from smtpin14.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay03.hostedemail.com (Postfix) with ESMTP id D8E09A0361 for ; Fri, 4 Nov 2022 03:17:02 +0000 (UTC) X-FDA: 80094298284.14.5D2DD56 Received: from ssh248.corpemail.net (ssh248.corpemail.net [210.51.61.248]) by imf01.hostedemail.com (Postfix) with ESMTP id D2B0C40003 for ; Fri, 4 Nov 2022 03:16:59 +0000 (UTC) Received: from ([60.208.111.195]) by ssh248.corpemail.net ((D)) with ASMTP (SSL) id YEU00154; Fri, 04 Nov 2022 11:16:54 +0800 Received: from localhost.localdomain (10.200.104.82) by jtjnmail201602.home.langchao.com (10.100.2.2) with Microsoft SMTP Server id 15.1.2507.12; Fri, 4 Nov 2022 11:16:54 +0800 From: Deming Wang To: CC: , , , , , Deming Wang Subject: [PATCH] binfmt_elf: replace IS_ERR() with IS_ERR_VALUE() Date: Thu, 3 Nov 2022 23:16:44 -0400 Message-ID: <20221104031644.1955-1-wangdeming@inspur.com> X-Mailer: git-send-email 2.31.1 MIME-Version: 1.0 X-Originating-IP: [10.200.104.82] tUid: 20221104111654b93665246d00bf0b2870faeb81a5701b X-Abuse-Reports-To: service@corp-email.com Abuse-Reports-To: service@corp-email.com X-Complaints-To: service@corp-email.com X-Report-Abuse-To: service@corp-email.com ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667531820; a=rsa-sha256; cv=none; b=hEA5RsN0slvL9c4S5KPj9nlNmKTTlPAaWWb3syX43RyMY/zaTV0IjnstVhphI15yPt8nYq 3Qms+9ezTlNgqX6Y8UwXoJd6J5N19w37h83dwTyz5xnBgEYXm2Ml0Mp277fpT2D3ADgYhj vZiZiZtG4JypaYav00xpxmljfWs85yU= ARC-Authentication-Results: i=1; imf01.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf01.hostedemail.com: domain of wangdeming@inspur.com designates 210.51.61.248 as permitted sender) smtp.mailfrom=wangdeming@inspur.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667531820; 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:content-transfer-encoding:in-reply-to: references; bh=hTb3SZQy1UqFXcBDWHP51NQZ0otJxVDmRDFhWqIcEl0=; b=2CLTUDv8b9rbGq3x/qXmReMdwDzhruI/6YzekmHXncRGLjBs+hR4/0+55N7mviCKjXKT1z Q+4le45I5amrlbiIKbjXTBIDnUqmygdiGASeRQlgcMvZ7oeZeRjXNzIWsYJJRGXDYuK5R9 4XeMw44gUwCplT4IiLJAZv6MthzWOkM= X-Stat-Signature: q14tp4dof51c3uz7gzwqt543jzxmjic7 X-Rspamd-Queue-Id: D2B0C40003 Authentication-Results: imf01.hostedemail.com; dkim=none; dmarc=none; spf=pass (imf01.hostedemail.com: domain of wangdeming@inspur.com designates 210.51.61.248 as permitted sender) smtp.mailfrom=wangdeming@inspur.com X-Rspam-User: X-Rspamd-Server: rspam07 X-HE-Tag: 1667531819-855777 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000004, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: Avoid typecasts that are needed for IS_ERR() and use IS_ERR_VALUE() instead. Signed-off-by: Deming Wang --- fs/binfmt_elf.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/fs/binfmt_elf.c b/fs/binfmt_elf.c index 528e2ac8931f..d9af34f816a9 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1160,7 +1160,7 @@ static int load_elf_binary(struct linux_binprm *bprm) error = elf_map(bprm->file, load_bias + vaddr, elf_ppnt, elf_prot, elf_flags, total_size); if (BAD_ADDR(error)) { - retval = IS_ERR((void *)error) ? + retval = IS_ERR_VALUE(error) ? PTR_ERR((void*)error) : -EINVAL; goto out_free_dentry; } @@ -1245,7 +1245,7 @@ static int load_elf_binary(struct linux_binprm *bprm) interpreter, load_bias, interp_elf_phdata, &arch_state); - if (!IS_ERR((void *)elf_entry)) { + if (!IS_ERR_VALUE(elf_entry)) { /* * load_elf_interp() returns relocation * adjustment @@ -1254,7 +1254,7 @@ static int load_elf_binary(struct linux_binprm *bprm) elf_entry += interp_elf_ex->e_entry; } if (BAD_ADDR(elf_entry)) { - retval = IS_ERR((void *)elf_entry) ? + retval = IS_ERR_VALUE(elf_entry) ? (int)elf_entry : -EINVAL; goto out_free_dentry; }