From mboxrd@z Thu Jan 1 00:00:00 1970 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 lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 81031105A596 for ; Thu, 12 Mar 2026 12:57:38 +0000 (UTC) Received: from boromir.ozlabs.org (localhost [127.0.0.1]) by lists.ozlabs.org (Postfix) with ESMTP id 4fWnhd033Dz3cFN; Thu, 12 Mar 2026 23:57:37 +1100 (AEDT) Authentication-Results: lists.ozlabs.org; arc=none smtp.remote-ip="2607:f8b0:4864:20::82c" ARC-Seal: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773320256; cv=none; b=EWZ7Wvzb2ZEoOSmiFkzoDsFkkWEaa4Gr5iSmMjfxE8j8We+Ky9Tt6yTuoEG2Q5d8EwWqnfirJ3vOuwDS7OxLe2+vc2ybClTnPyVYXY4e7JtB2tX2T8p3DTQq6OzqJ8wScEZEehd9pnxQ9Z3gdmX9Ajt4nXZIlt3lbvNeup4qTB1+iVp9nKgipBjs8D+KP5A6MiE7RA2k2B24wBMCLt+BPQXzRd2VS2Pogj/HDlM0YYcbFmVbZV+usD4jlBzqCAnMeQjZKOUm8k2HxGUpRd6Ln38mM0ZAPYqnA0uD0sC81wG0aBh/XTkd1QO5s1X1LvAdL1nj9HCHoJ5jEY8PULZFFw== ARC-Message-Signature: i=1; a=rsa-sha256; d=lists.ozlabs.org; s=201707; t=1773320256; c=relaxed/relaxed; bh=J1SF1XBHkHR0j7NZVucv0LxpGoGXl67PUefLsfwpAbo=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=Rph7ELd4GbWI0yFpQeXVEcb+xWFCubEW61l1wuy8th1CTZpEUR7VfMCnJScDrXwJLjHGEP57Psz+X4eJ84JIcEzYxk8k/Ds9Pze4MzuJJNFo9TQKczTbncPSavQ6zZBefpUwoxNAvAK2KwNoOhoBKIUJzIToMHirjaVdpmzCiQzoH0B8enmSaNzJRoWApBVKLzfq1uArO/h67EJyc3DrcpOFePDyDiLCuBw8n0RACyjRjItktL3Fybe3pq2Uh705apJ5FM54wvxJZAfH1ZBG63IqrdgmClNtvjfgxx/Ww/jXKh+Sbpi7dTnvxX/vFbF0SLNPZdsdfsbJtWeFasGvEQ== ARC-Authentication-Results: i=1; lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=D0vmWWbb; dkim-atps=neutral; spf=pass (client-ip=2607:f8b0:4864:20::82c; helo=mail-qt1-x82c.google.com; envelope-from=jgg@ziepe.ca; receiver=lists.ozlabs.org) smtp.mailfrom=ziepe.ca Authentication-Results: lists.ozlabs.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=ziepe.ca header.i=@ziepe.ca header.a=rsa-sha256 header.s=google header.b=D0vmWWbb; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ziepe.ca (client-ip=2607:f8b0:4864:20::82c; helo=mail-qt1-x82c.google.com; envelope-from=jgg@ziepe.ca; receiver=lists.ozlabs.org) Received: from mail-qt1-x82c.google.com (mail-qt1-x82c.google.com [IPv6:2607:f8b0:4864:20::82c]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange x25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4fWnhb1RWbz3cCJ for ; Thu, 12 Mar 2026 23:57:34 +1100 (AEDT) Received: by mail-qt1-x82c.google.com with SMTP id d75a77b69052e-506a6cf8242so8849461cf.1 for ; Thu, 12 Mar 2026 05:57:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1773320252; x=1773925052; darn=lists.ozlabs.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=J1SF1XBHkHR0j7NZVucv0LxpGoGXl67PUefLsfwpAbo=; b=D0vmWWbbT1FhhX84Jrwuuq0mQQXi6W9KrroEDDoQErovxPVIIQXSv17odkOBEyMh0z Ja/OlNoHhmkDO4XNzNyaZiTMXWshbC5VLyH866I/tCPnnxRtrAEZuTcwNnuGCy5Vjs7d 03S8mdyPNSnsKsfld5k50HloGkfAooUX9qOb0R8+spIv23JDvgUUyHVVEYWUY+7NxlpM T4Q4iHrkDIS7rFx+C3NHOMwoDXYOzLp5dEqxwY4ctZUthet28TjffvvBv45wqgXgZ/Wm b1aMsQttVj/8INQ4B0sxuDvAlXF4ie9oFN2wHbZn1CIfeYtSExGsUIiYEd2AE6LUeGOt yUlQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1773320252; x=1773925052; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-gg:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=J1SF1XBHkHR0j7NZVucv0LxpGoGXl67PUefLsfwpAbo=; b=LECckWACkCPV0ahdXLAO7KAoYmqKjeAyTyGzVp6amO9cl+ecRqTDpgsnVIo4WXhiRR 0gwfbtJFxou+LWMmPTfxzm9iNv5Wme8RnAckrlSAoCGxR/7Xea/3r3RRMF5xoJ97unAy upFHhnwICjsR6SBY71deeIAY7pbw9kSOdy3R4hPPr71TFn/wcyghCfhAmyLjk0/VyKmZ QsLKYfZMhnUEOXlerynsaLtZaDA+NSy/8WJduVXBSuA8U1OTa6Om0cd3q5/TvjPh3z/Q DRRPVCpCtFniHf2IFtcsrLhwqVpN9rdNrEx5dsVk7YYOZpQViQ0e6WjRFAVkSjBiDh/B lRnw== X-Forwarded-Encrypted: i=1; AJvYcCXgiPKZh131btOOdghgJt/bh2DimwHw1K/Jx/o/Bb/pzIpo/SXMuqCb7FlJVNEpT7y2QLF8y1u2pizVRQ==@lists.ozlabs.org X-Gm-Message-State: AOJu0YxFRD4jAo3+owy6bE7rejsg0i5oNTvhdgw8SIvvQzi5DQg2yoQJ aMuIsDEB3suu+nFVRFSa2HU/MisX4Fnmm4LWC8uERvyQ6Weg7zBMvVlTfvxaA2zvbEI= X-Gm-Gg: ATEYQzzbP1tNXrBFFrulR4X7dxa4Sabgf0cAO5W76kHpmAz9DK9iCjocbiFDPUMimp6 zhslL/L4+9I/VnPMglN1ZzgLShSUG181VwMXuKcQZKfL/eJ+mJ4ZiXCscOz7hir7/ElbB7n2j2M UcQWf2Ioz8nidYLNIWUzgZklGiXn4IxGkeGOHwca4ynj7ktWXROF55DWqlxXp4fuORcCuUdhvWZ hVOhH1dayiIVlAZ40z1nkeGSn8xmYcMGVFuV8kU/HEqd5xUEI7fV5Gk7C+IfXiMDwZRtquvQBof 6TrUBQchcT+pJ6on300yEJoBfqPfuPi0NtSwSZDatQzp5wIbrWJBNuhpk71wIrj1//THszu2dGG dXU6YcXCkoCV9UCHMWwb8Cs/EyxbuaWyhKuNQNmUVUVCIsJDpSZndqsi5csfrHjLDU9fHFCHGDx k8V8Doo/RoqKLzmOyYSH/+a/xGFYsClbp6a2Z9OY436p6F9cPRkqOH5veKilKbie4Y6/CiH4ehJ rjj8AYP X-Received: by 2002:ac8:5d4d:0:b0:509:cbc:127b with SMTP id d75a77b69052e-5093a1bd58fmr77950521cf.60.1773320251710; Thu, 12 Mar 2026 05:57:31 -0700 (PDT) Received: from ziepe.ca (hlfxns017vw-142-162-112-119.dhcp-dynamic.fibreop.ns.bellaliant.net. [142.162.112.119]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-89a65bd318fsm33341196d6.8.2026.03.12.05.57.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 12 Mar 2026 05:57:31 -0700 (PDT) Received: from jgg by wakko with local (Exim 4.97) (envelope-from ) id 1w0fbW-00000006fKD-1POa; Thu, 12 Mar 2026 09:57:30 -0300 Date: Thu, 12 Mar 2026 09:57:30 -0300 From: Jason Gunthorpe To: Kuan-Wei Chiu Cc: Philipp Hahn , amd-gfx@lists.freedesktop.org, apparmor@lists.ubuntu.com, bpf@vger.kernel.org, ceph-devel@vger.kernel.org, cocci@inria.fr, dm-devel@lists.linux.dev, dri-devel@lists.freedesktop.org, gfs2@lists.linux.dev, intel-gfx@lists.freedesktop.org, intel-wired-lan@lists.osuosl.org, iommu@lists.linux.dev, kvm@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-block@vger.kernel.org, linux-bluetooth@vger.kernel.org, linux-btrfs@vger.kernel.org, linux-cifs@vger.kernel.org, linux-clk@vger.kernel.org, linux-erofs@lists.ozlabs.org, linux-ext4@vger.kernel.org, linux-fsdevel@vger.kernel.org, linux-gpio@vger.kernel.org, linux-hyperv@vger.kernel.org, linux-input@vger.kernel.org, linux-kernel@vger.kernel.org, linux-leds@vger.kernel.org, linux-media@vger.kernel.org, linux-mips@vger.kernel.org, linux-mm@kvack.org, linux-modules@vger.kernel.org, linux-mtd@lists.infradead.org, linux-nfs@vger.kernel.org, linux-omap@vger.kernel.org, linux-phy@lists.infradead.org, linux-pm@vger.kernel.org, linux-rockchip@lists.infradead.org, linux-s390@vger.kernel.org, linux-scsi@vger.kernel.org, linux-sctp@vger.kernel.org, linux-security-module@vger.kernel.org, linux-sh@vger.kernel.org, linux-sound@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-trace-kernel@vger.kernel.org, linux-usb@vger.kernel.org, linux-wireless@vger.kernel.org, netdev@vger.kernel.org, ntfs3@lists.linux.dev, samba-technical@lists.samba.org, sched-ext@lists.linux.dev, target-devel@vger.kernel.org, tipc-discussion@lists.sourceforge.net, v9fs@lists.linux.dev Subject: Re: [PATCH 00/61] treewide: Use IS_ERR_OR_NULL over manual NULL check - refactor Message-ID: <20260312125730.GI1469476@ziepe.ca> References: <20260310-b4-is_err_or_null-v1-0-bd63b656022d@avm.de> X-Mailing-List: linux-erofs@lists.ozlabs.org List-Id: List-Help: List-Owner: List-Post: List-Subscribe: , , List-Unsubscribe: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Mar 11, 2026 at 02:40:36AM +0800, Kuan-Wei Chiu wrote: > IMHO, the necessity of IS_ERR_OR_NULL() often highlights a confusing or > flawed API design. It usually implies that the caller is unsure whether > a failure results in an error pointer or a NULL pointer. +1 IS_ERR_OR_NULL() should always be looked on with suspicion. Very little should be returning some tri-state 'ERR' 'NULL' 'SUCCESS' pointer. What does the middle condition even mean? IS_ERR_OR_NULL() implies ERR and NULL are semanticly the same, so fix the things to always use ERR. If you want to improve things work to get rid of the NULL checks this script identifies. Remove ERR or NULL because only one can ever happen, or fix the source to consistently return ERR. Jason