Received: by 2002:a05:6358:16cd:b0:dc:6189:e246 with SMTP id r13csp92245rwl; Thu, 3 Nov 2022 20:19:06 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7XyiFQN2nFMJ6tZg1KKA3KcOGKQjaP1Q3a5nW+10zeD/fH11HfvoRuuUeciitASxhzms5n X-Received: by 2002:a63:1cb:0:b0:46f:a202:fa36 with SMTP id 194-20020a6301cb000000b0046fa202fa36mr24243406pgb.276.1667531946303; Thu, 03 Nov 2022 20:19:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1667531946; cv=none; d=google.com; s=arc-20160816; b=lzx5GKtwYFE5oqPItCB30eD/ldHnnNL1qMP8J4cwbg9hjPKw2nKUfg+6aKya0fa0C7 uEjKgq63l3CKwRhfM47yK/6XZtbj85FHMWoLsxv1MPpUF3U1quAVZsEuipHpP8cgu1Ij p94aYfoUgTA24hjAKLH7KCzkaJTZpI7zeM9vmEWbqPTKDk4f0Gz4rG4pLuUqNPHBZJLy Hyu3rDaa21DxUw6vvOC/DmHsFSci+bsuEZQn+qlOeeiyxFexRaL7nMkwKRODyRo/QtDM 4MxYZ5IZFa5+XAvcwl8HyLa0IqBK2by0yHUGYzg4HXG+Q0cUYPvFswTTr5205RS279bN hTPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:abuse-reports-to:tuid:content-transfer-encoding :mime-version:message-id:date:subject:cc:to:from; bh=hTb3SZQy1UqFXcBDWHP51NQZ0otJxVDmRDFhWqIcEl0=; b=uCXqShup1B+6MYnYRt6kdeUAp00DDkSs8RWbNP8/GQoICd2oxvALkb6VaJd0Ga6wYk VGTJYL+wvKpCtxVhsp78ys3Lo3exC/sOoH67uOl9gv7CVZA03n3H37HreKpEWbe73Hl8 j4TBFWxM5rmI7YcLHDs6xw5htPJdAYrDzshPbDuZ4nyM4IT1AeQ8hKJTrjanqgW6rbAF PbDs3hSoyp2WTgqdFau9hqtgSNKe2+2zjC3LVzqU89R4Q+m4uDBArkyD0fzibDAoIvjl R2EoIq+WOke1FPLOxQ3+aLDhZuvocHnCVZbAwPz0KsOuKdef7JU3cjGgcCxDww66lgGt 7SBA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n7-20020a170903110700b001869e6efb8asi3720280plh.59.2022.11.03.20.18.53; Thu, 03 Nov 2022 20:19:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231319AbiKDDRl (ORCPT + 96 others); Thu, 3 Nov 2022 23:17:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51716 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230497AbiKDDQ7 (ORCPT ); Thu, 3 Nov 2022 23:16:59 -0400 Received: from ssh248.corpemail.net (ssh248.corpemail.net [210.51.61.248]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 254F522BE9; Thu, 3 Nov 2022 20:16:58 -0700 (PDT) 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 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII 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 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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; } -- 2.27.0