From patchwork Thu Oct 20 11:55:58 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: ye xingchen X-Patchwork-Id: 6178 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:4242:0:0:0:0:0 with SMTP id s2csp74843wrr; Thu, 20 Oct 2022 05:19:03 -0700 (PDT) X-Google-Smtp-Source: AMsMyM5Gk9sFPaGs89lMOadrpfY/cn/OWUOJt/3NP0DitmbLQSLSpP+Ui73zmGZqzgl5GpzuCEIH X-Received: by 2002:a63:1308:0:b0:440:5517:c99d with SMTP id i8-20020a631308000000b004405517c99dmr11521935pgl.550.1666268343506; Thu, 20 Oct 2022 05:19:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666268343; cv=none; d=google.com; s=arc-20160816; b=Vw3XJRkY9Oyt9aGchG9h9YXuZp2HDeIKfj0wGeNIcvADyZM2oS2f4Vx0Le7Th9dTb1 uy8MISt2EAeCTglZMEsime2O9CE15bfRIDXtOAEWAbDD2IuAC3VNwlAztrnzO7dRd/Q3 Y3p4xg2syFOi24GrymNdSNsLrEn1EOKJ6EH62aDm6RqKWDQhbX43K9idm1OLBXF8TkyX y7v3EWexydbyY1210N32yiBqzQHqhH2tmgeG1vAKomVzqIgzG+nwCYQXnEQ4iGdEUzhX nU5eyTqShTm2cVjlvbaDh5pAPBxBuorIIQaxew7YM2iowxbCooiyJTiLR8G02I9EFr/h 5PAw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=QfEMq48V5eFN0VrM2HYUoVegivK/iVeEKYnMwW6hA7w=; b=TnYEYjQAhWBztUqu1oO7lGFLyh6cdCl7Gktwaco85G+osWB/JmdlDyDD3X9Peu9mwz HCj2kqMcfRLzSGOmxwAdA9ioXEpvQqcvF+fPPUmfGOY8vsQfNxYTSXs9rg96A6KzuNgi GEGlxf4pcvAxPW392QP/A/tmsFzAlh7znWBrtjFmvvHlqUMDz1yKG72YjgzO+B2s8PmZ kAHz7QAIShnt3UoJpUX0WaVKe+psHV1pfsuYsHc2XrQJ3KLe8YprOEDKfS8L1dB61HOq YlL0tW2A7gILuwXb7MKapX9nX41YXiGtMyJr44dEWY4cVsK1TlE1UdUXtvZKSjaY+wmp RhZA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Cyl5KTkX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id b3-20020a056a00114300b005480167b913si22625989pfm.282.2022.10.20.05.18.32; Thu, 20 Oct 2022 05:19:03 -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; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Cyl5KTkX; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229729AbiJTL4K (ORCPT + 99 others); Thu, 20 Oct 2022 07:56:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43750 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229615AbiJTL4G (ORCPT ); Thu, 20 Oct 2022 07:56:06 -0400 Received: from mail-pl1-x62c.google.com (mail-pl1-x62c.google.com [IPv6:2607:f8b0:4864:20::62c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F289616E284; Thu, 20 Oct 2022 04:56:04 -0700 (PDT) Received: by mail-pl1-x62c.google.com with SMTP id l4so20075535plb.8; Thu, 20 Oct 2022 04:56:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=QfEMq48V5eFN0VrM2HYUoVegivK/iVeEKYnMwW6hA7w=; b=Cyl5KTkXEp2CRgTe1763UrkbTjbp8kN8IbZfihSeKtAuINP1JR4IcJpEWZBlSPlzHm 6/e9CSHukaC/m5T380e7Di+F+GFOmyLyDf8OeoLzFbDUsveRwq535x5LyuDVpIMm27Qh E2KWhNjZ8sWvXYOs/qM32lBg9RED1lgMHTGjaZk4P41pY0zmWUQBZB60xgcpRrt2nX62 SKJLtJVEv9N6wpr1RS9vGNjgirkF521NhrXlSufwRbKhvO2D2s3hzvnib0OcFcn5rEDp 6+hgMJZEZVQ4DX5y4gqCf/ogS33bM5B25zOLZHKeP1m7SSWNfNe+8ybAWTuDpiHWjthx 1WzQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=QfEMq48V5eFN0VrM2HYUoVegivK/iVeEKYnMwW6hA7w=; b=Z13i4thZHtXZ8EOhxCAjpps0ArhOZtIZ8NQqcchQLTVq4z+5ruaYq25z9Q9usy75+r xWmWh8m6NckkQMEuWjyRhKSTru5iY4xrMOdhoqnWym/bt8hZUTlQrkxMTYkGH6YokjVb JOVkng2koYNob9A9bXPw/1/1zDiBgvHiJVem4g5lcxpvjUX7yk5QFIWm139nkwMdvpb8 DjjrUB7KANxhl2kfhRdSYoTeXK6+1TZo3BpsegRuu9r7ORsQi0Z4egH680e7w7ubkNnB DFOhatpKOLk1bW7HAFQweaVB+gRHM1oPIoF//Lt6LDQRi1ibXa8jGXaGeD6EHUJ7CoY6 +uIA== X-Gm-Message-State: ACrzQf2wTBy5ubi3+OReTnFngG5U86o9QZyOuEdSCOqLU0fpj6fKUoIe 0B0kbR0M3sZs6JWPRQtcFCg= X-Received: by 2002:a17:902:f78c:b0:17a:ef1:e902 with SMTP id q12-20020a170902f78c00b0017a0ef1e902mr13483537pln.5.1666266964456; Thu, 20 Oct 2022 04:56:04 -0700 (PDT) Received: from localhost.localdomain ([193.203.214.57]) by smtp.gmail.com with ESMTPSA id u13-20020a170903124d00b0017f80305239sm12784647plh.136.2022.10.20.04.56.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 20 Oct 2022 04:56:03 -0700 (PDT) From: yexingchen116@gmail.com X-Google-Original-From: ye.xingchen@zte.com.cn To: viro@zeniv.linux.org.uk Cc: ebiederm@xmission.com, keescook@chromium.org, linux-fsdevel@vger.kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, ye xingchen Subject: [PATCH linux-next] binfmt_elf: Replace IS_ERR() with IS_ERR_VALUE() Date: Thu, 20 Oct 2022 11:55:58 +0000 Message-Id: <20221020115558.400359-1-ye.xingchen@zte.com.cn> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-Spam-Status: No, score=-1.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM,RCVD_IN_DNSWL_NONE,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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747208994677568711?= X-GMAIL-MSGID: =?utf-8?q?1747208994677568711?= From: ye xingchen Avoid type casts that are needed for IS_ERR() and use IS_ERR_VALUE() instead. Signed-off-by: ye xingchen --- 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 72f0672b4b74..afd2d6f1c21c 100644 --- a/fs/binfmt_elf.c +++ b/fs/binfmt_elf.c @@ -1166,7 +1166,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; } @@ -1251,7 +1251,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 @@ -1260,7 +1260,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; }