From patchwork Wed Nov 9 11:50:41 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Sergey Senozhatsky X-Patchwork-Id: 13037464 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 D78A4C4332F for ; Wed, 9 Nov 2022 11:52:14 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 724EB8E0009; Wed, 9 Nov 2022 06:52:14 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 6AE9A8E0005; Wed, 9 Nov 2022 06:52:14 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5A92B8E0008; Wed, 9 Nov 2022 06:52:14 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0016.hostedemail.com [216.40.44.16]) by kanga.kvack.org (Postfix) with ESMTP id 4E07B8E0005 for ; Wed, 9 Nov 2022 06:52:14 -0500 (EST) Received: from smtpin24.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay10.hostedemail.com (Postfix) with ESMTP id 1BA98C13C6 for ; Wed, 9 Nov 2022 11:52:09 +0000 (UTC) X-FDA: 80113740378.24.01F06ED Received: from mail-pf1-f173.google.com (mail-pf1-f173.google.com [209.85.210.173]) by imf13.hostedemail.com (Postfix) with ESMTP id B22D320014 for ; Wed, 9 Nov 2022 11:52:03 +0000 (UTC) Received: by mail-pf1-f173.google.com with SMTP id m6so16501086pfb.0 for ; Wed, 09 Nov 2022 03:52:03 -0800 (PST) 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=LtxYsj6E0bxgea4oeDPQD6uPBfUoT8WqWkKOxHgnlE8=; b=BhhFMs1ML3PGfZKVrN186Q97ul+1G9ZHCoV+RVoLQr8lz4T5uyEB8FVWXqOd2MPEJV WXRNdPNw5zFbek9OBqFeG95mqUcpvBVSA9OgxkLNbzSfXs/gtXDE0iZciXnFTnO7xbEx VVL2cpPMLshWAYupNPDK+0SFTzwaSKVuxvrqg= 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=LtxYsj6E0bxgea4oeDPQD6uPBfUoT8WqWkKOxHgnlE8=; b=t31ixJMqLQtq9ogXC2Bf1/5BM3ZHoM5Tj+VV2EW+JUUaNDiWEPSccnG5Hg/xqwifEN UtrFOu1S4nvpe3q+JZzSwTTgS2RQ4knJx+6d3219wYXPXSNyzJq+2I+kPqfp1TONgQTj rPQkTy9B75/tE+aj5AGzSlYlUOhxcKToNoQpve4Jner7ezX6BoP645wTh57CS3BCZ1lb 8JY8z9g7nwSlOWbJBeK6nfkPRNgDGQeM9vd+p4nT0hBYeD8riN/hMtoQp01isO4Awi5m hFu7l/FWU1kXCEUUfupfr2zVsBOu33/Mg1C0AT/yVCop0e4bvW4lTV35ia3KzRrGhIl7 4IBg== X-Gm-Message-State: ANoB5pnS3AGKGnw3r8wMTrQIcnZMc23Lv6OXz+OXuxddZUgzgnomSqwq kjRvzrdMZK7hjGwQfJo2rZqTfEgw/ydM8g== X-Google-Smtp-Source: AA0mqf5O4dQwnhqX2UIonKGx0YaOrk9LZS0ppNcJn3lPaVyD2Siq7naWMzUGxAKXAAnyXSHio9Vedw== X-Received: by 2002:a65:6846:0:b0:470:8e8f:fe89 with SMTP id q6-20020a656846000000b004708e8ffe89mr5699996pgt.172.1667994672770; Wed, 09 Nov 2022 03:51:12 -0800 (PST) Received: from tigerii.tok.corp.google.com ([2401:fa00:8f:203:61f1:44d3:3f47:2cdb]) by smtp.gmail.com with ESMTPSA id f5-20020a655505000000b00434760ee36asm7292311pgr.16.2022.11.09.03.51.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 03:51:12 -0800 (PST) From: Sergey Senozhatsky To: Minchan Kim , Andrew Morton Cc: Nitin Gupta , Suleiman Souhlal , linux-kernel@vger.kernel.org, linux-mm@kvack.org, Sergey Senozhatsky Subject: [PATCHv5 07/13] zram: Use IS_ERR_VALUE() to check for zs_malloc() errors Date: Wed, 9 Nov 2022 20:50:41 +0900 Message-Id: <20221109115047.2921851-8-senozhatsky@chromium.org> X-Mailer: git-send-email 2.38.1.431.g37b22c650d-goog In-Reply-To: <20221109115047.2921851-1-senozhatsky@chromium.org> References: <20221109115047.2921851-1-senozhatsky@chromium.org> MIME-Version: 1.0 ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1667994723; a=rsa-sha256; cv=none; b=LmVzyOW4oUz+jKcLPzVIZZ4bGlycoNBDdwvQxxUx2u6TrHmGzFf/l47rVcZL5YncTt4kC7 Od3CnYoJetBEthQuMgykyUw54p7i6nTfBbagH8j2sTcRSkLofzSkxhusJU2+jUqBvPZT0I NzzHwM58SJkmrpxRjYxMm3ViIGO9C8Y= ARC-Authentication-Results: i=1; imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=BhhFMs1M; spf=pass (imf13.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.173 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1667994723; 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-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:dkim-signature; bh=LtxYsj6E0bxgea4oeDPQD6uPBfUoT8WqWkKOxHgnlE8=; b=tGkXeaUcqme4iz/fDKUXQbk1JiW3h0JMuaYzzjD8UyD5TRddLos4gOUn8z3NmFQNzUmiGh fdZwtNrwmYPSZK4lPPTApImVG4GZoA8pLfuZqlt1Wlr3cSiI5YXzXTwlFAdWE+HlguPjUH 51oXfeE9WzXdW3xt6FqFdLNEYiz51Bo= X-Stat-Signature: 9k7y68cek8dsb3tjdtyu5yfyw16iii55 X-Rspamd-Queue-Id: B22D320014 Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=chromium.org header.s=google header.b=BhhFMs1M; spf=pass (imf13.hostedemail.com: domain of senozhatsky@chromium.org designates 209.85.210.173 as permitted sender) smtp.mailfrom=senozhatsky@chromium.org; dmarc=pass (policy=none) header.from=chromium.org X-Rspam-User: X-Rspamd-Server: rspam11 X-HE-Tag: 1667994723-189328 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: 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 | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/block/zram/zram_drv.c b/drivers/block/zram/zram_drv.c index a5d2ce0bcd5d..9561569273fe 100644 --- a/drivers/block/zram/zram_drv.c +++ b/drivers/block/zram/zram_drv.c @@ -1545,19 +1545,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_COMP]); 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)