Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp5491529rwi; Mon, 17 Oct 2022 23:03:45 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7O/u+/2nt82knYOrK06D1ac3R0pgFky6rFV/vV4W+533R6jhxZAIGcDMyu07ElbvVrK5XT X-Received: by 2002:a63:18f:0:b0:43c:24d2:c0f7 with SMTP id 137-20020a63018f000000b0043c24d2c0f7mr1356570pgb.470.1666073025041; Mon, 17 Oct 2022 23:03:45 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666073025; cv=none; d=google.com; s=arc-20160816; b=0W9AQIQv+ftFV5BCyROCNwiaWXuxDygBB+01irsi7Ae3cYkXmXLG18nD/u6JP/eL3d sJfAYU5MTIVv/1r14ktt8+5X2kl4X8KPl9JIGXGeMLEcgs35gssDjSWMukuEjy3H2mb+ Zi1eaZpHXWrU1Aopcd7jR/gMB5SO4GpHYzOR0b4ecASJ//fAzl/jgRd+TLDRVCPtOa7K jYnPuUgCWpEFe8AyGMPmh9jQNacz9F3DyCnLYZF0tQxm5cpRFlZU4zfOMO0pDtdOZF7S hTq5vnQcf9CdnZHFqJt2p8BdHDhw4blIBPLlMoLKiG2FGx6K/HAd6BbYrWBjUJOjqQ5j UU6w== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=5M5hW54OP3FcHBFbXUW0BvyRXPUP5sF32vTgPzuINJw=; b=Ex/rLSojJDToMnBW4QQnPEQjsdCml1U1cDLr/K8s1KQeniH3BD4cXQ/mVxfK4wkRCa oU1vt9oAX2EBHWAIl7I13SJ3CCsRsVYfHR2oRW3C7D+TaOiN7t9xzyCIKUmNeNw24k6M tBN/H0+NP4yzUGBVKFohpvNgQgtKCIXaWUjlA3b9CjcRBEzwZBQae5NAduZsAuBLYB18 uNWjzIFMQwdacffK9+h0wdR0FQQNY5P6w4PLv9d41sGkwawHFb8kIOGXsU4FyvQj7oOb qFrXi4/Un1nDvNDDc6SGVt6M6UEx0DhxrT6IVCCWbiLLN83/z2Iq/gV50TmYu3GsRLQw AxdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OpPjLqj+; 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=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i71-20020a63874a000000b0046124b7a62bsi14066863pge.691.2022.10.17.23.03.33; Mon, 17 Oct 2022 23:03:45 -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=@chromium.org header.s=google header.b=OpPjLqj+; 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=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229607AbiJRE5N (ORCPT + 99 others); Tue, 18 Oct 2022 00:57:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60484 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230162AbiJRE4c (ORCPT ); Tue, 18 Oct 2022 00:56:32 -0400 Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8E3DDA344A for ; Mon, 17 Oct 2022 21:56:06 -0700 (PDT) Received: by mail-pl1-x630.google.com with SMTP id c24so12738440pls.9 for ; Mon, 17 Oct 2022 21:56:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=5M5hW54OP3FcHBFbXUW0BvyRXPUP5sF32vTgPzuINJw=; b=OpPjLqj+j0EF5h4VtuAZp6f+eGdl/5fSvLw56hi7HO01ZV6gqL3LhfNt4tuqvbFZWL B9Zo2V1IhStyc8xGnpweJqdk5JOPtoGtNyRZvNKx+nA/GCWy7rPkstTlJfT4GGbEyOzL khin31KlV69YEer+c0KA1hT4XmJY8qBrHD7bg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=5M5hW54OP3FcHBFbXUW0BvyRXPUP5sF32vTgPzuINJw=; b=mSJf3fII1EzdyIqhmJCm1b5h3fZo7jkWmbPJjnQrG2wxPRQyXZBafUEUVD5/Lp9U6f Zp4T5u+7obVYrace19qMkzd6KQgYu4CaBZIneVEUaHXEbeB/5uyuCx8/GQN5vMHFwUNJ MDAgFnrn6M4O8HlN9k+1/Y2FLEzvTHdyMXvwl4E+tcjVbhxGOg2Yxx74ALst+KiBIao7 +6cNMI67zgzJoZFSsHqKMGNF9V/j9IVMdGZDk6fbFgBVtrR4ODg01SH6JFo/mSknDvNw GWek+I6KzwNl9wNKcd7gf1OqRwBOEd4ICm4PByUwPe0XvMmqa5KPBtdnwtqU8NOTcxep 1Zfg== X-Gm-Message-State: ACrzQf2n3RTG1f2NAhK10wQsVD1CrIl0/4MBosdvrhdUmFP0hCL7e9gO EWy/xNl8WsYNjGAmxSg896jCpw== X-Received: by 2002:a17:902:e5c3:b0:185:53ee:60e3 with SMTP id u3-20020a170902e5c300b0018553ee60e3mr1397002plf.71.1666068964804; Mon, 17 Oct 2022 21:56:04 -0700 (PDT) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:17a9:73b0:c262:eccd]) by smtp.gmail.com with ESMTPSA id p4-20020a170902e74400b0017b69f99321sm7549220plf.219.2022.10.17.21.56.03 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 17 Oct 2022 21:56:04 -0700 (PDT) From: Sergey Senozhatsky To: Andrew Morton , Minchan Kim Cc: Nitin Gupta , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: [PATCHv4 9/9] zram: Use IS_ERR_VALUE() to check for zs_malloc() errors Date: Tue, 18 Oct 2022 13:55:33 +0900 Message-Id: <20221018045533.2396670-10-senozhatsky@chromium.org> X-Mailer: git-send-email 2.38.0.413.g74048e4d9e-goog In-Reply-To: <20221018045533.2396670-1-senozhatsky@chromium.org> References: <20221018045533.2396670-1-senozhatsky@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-2.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 Avoid type casts that are needed for IS_ERR() and use IS_ERR_VALUE() instead. Suggested-by: Andrew Morton Signed-off-by: Sergey Senozhatsky --- drivers/block/zram/zram_drv.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index 6b56f6f2ce82..422e3cfd2ddc 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1506,19 +1506,19 @@ static int __zram_bvec_write(struct zram *zram, struct bio_vec *bvec, * if we have a 'non-null' handle here then we are coming * from the slow path and handle has already been allocated. */ - if (IS_ERR((void *)handle)) + if (IS_ERR_VALUE(handle)) handle = zs_malloc(zram->mem_pool, comp_len, __GFP_KSWAPD_RECLAIM | __GFP_NOWARN | __GFP_HIGHMEM | __GFP_MOVABLE); - if (IS_ERR((void *)handle)) { + if (IS_ERR_VALUE(handle)) { zcomp_stream_put(zram->comps[ZRAM_PRIMARY_ZCOMP]); atomic64_inc(&zram->stats.writestall); handle = zs_malloc(zram->mem_pool, comp_len, GFP_NOIO | __GFP_HIGHMEM | __GFP_MOVABLE); - if (IS_ERR((void *)handle)) + if (IS_ERR_VALUE(handle)) return PTR_ERR((void *)handle); if (comp_len != PAGE_SIZE) @@ -1685,7 +1685,7 @@ static int zram_recompress(struct zram *zram, u32 index, struct page *page, __GFP_NOWARN | __GFP_HIGHMEM | __GFP_MOVABLE); - if (IS_ERR((void *)handle_next)) { + if (IS_ERR_VALUE(handle_next)) { zcomp_stream_put(zram->comps[ZRAM_SECONDARY_ZCOMP]); return PTR_ERR((void *)handle_next); } -- 2.38.0.413.g74048e4d9e-goog