From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-qt1-f179.google.com (mail-qt1-f179.google.com [209.85.160.179]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A77503C342E for ; Thu, 12 Mar 2026 12:57:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.160.179 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773320257; cv=none; b=ErZlv6CQiswLpT/U3DB5IjdBwrSBBM3aE8SSTt7xppAIXyLn772NsdiS/2Z2nIGkrUEY5BI+J3EUN4cj9hLWcnmxIVWA6/98Lq5CNgUI0/gXjIjypUQG+783ab3I8eXHNp9SzgjR3emi3XLPpsgv+kjLlbhJLH8z/Y15rql8mOs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1773320257; c=relaxed/simple; bh=Rr1jkAP22lZkLvo3o90a9fRSWh9+kilNKtAarSScWFY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=oJI5n+aVpjQyl0zTECMn/uIU6ubbfYsRMb82XyHZsooEhpwafpnPgxIkxdDVA5Y8wssuQTaS9lpwWvtgNNREuhlLr2mTtySVQdr6OHf4VFR5yeCIb683M56l7DxJ4QyFKaJ4cKA1Oa3gMX1QB9uHkZEp6YHulz7rUS+0ja6lkTA= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca; spf=pass smtp.mailfrom=ziepe.ca; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b=fHqxjqGD; arc=none smtp.client-ip=209.85.160.179 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=ziepe.ca Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=ziepe.ca header.i=@ziepe.ca header.b="fHqxjqGD" Received: by mail-qt1-f179.google.com with SMTP id d75a77b69052e-50915e14cf6so7425501cf.3 for ; Thu, 12 Mar 2026 05:57:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ziepe.ca; s=google; t=1773320252; x=1773925052; darn=vger.kernel.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=fHqxjqGD7mReR8MT2yBowt9MuNKPAKQc++mWcb4ZOttX6YldICO+OnnxWIQjO0C8L5 wjOw0Gg7MqV4U+G9pES+s6h1NtZIjaKrBXMW81hrLyc8SxWYHtvQK3FlTjqiyroZskXE jYj0kUENL7Yhu5zg+0UQ91XYlYYlozX9U8uAqBEFaih0fSnDo8kprjTDRYJ58gzKRExo MSUW+Q+e0P2WpZGotx0DuVRaUqq4vGsUUSX1YbPnOxmRUKlXFY/aNRmXMXDbAEfx0Lnn e41FpuPSZjTSuTkWfTMW8e1MvewVXC2p6zLd4GrSZjvSKS4Q06nDQYaSimUW3qR5RhoY JV6A== 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=HjZR4rKXwRYMmZVMagxxuOLy2X3Wa7FAANS8XtMMqvUaeCJE8yR6RvcS7pc9BCCl8w FCRcuFEwn8GE2flo1JZvya2uuxVyXdrsrIXOJQ6mCaPQ/0oVS7f8hhDgyQje0XdPe0ak iLILvzMeSWmlQdt/ezwJKowEOfDLFx/Vw0qGdqfNO7nXoMTgI4Tj/arbpaPmP9jtPz9Y 9sh1WQ11KHfBFdRphgQHhfAhoL7tIh1s5w4YoiZliW6RLeX5cN9/M6UTFomvboNkQXi7 dCv7FIj8UzFzP2evkb/NOH15UKaZoulBT8w+kgRNegVh/fNslQ+3hIaAvLa4B/+mWwop oSgQ== X-Forwarded-Encrypted: i=1; AJvYcCUs5RU1qIkHRAqJNvMP+jyIydlvjgpqoWdJtRFiD2PeR53FmC3te7q0NSD8P9VmXe7HowitG/8=@vger.kernel.org X-Gm-Message-State: AOJu0Yxf5KvK9o5ro/gMBjV4VM/sqEKUFbdQrcNE8gvAs5FyazAGmvvR kzmTg1VHs5Mnv7Qbmrz6Fzv0dDi//FURRoFs6/vLhKARoM8YSyQS/88Etp/5ycGPRfI= X-Gm-Gg: ATEYQzxL+48YhL/z2jkljuEd9lA0X/6iShZqoCqSq803NYZtAwmgaxTDkxhF4ku3Out IMswhdMy4YKMi8LIegwxbzbYly103k1BsnPkouZpyYeBJdu5t5XAwJkSSqi6CFCUTABydg2iZPc yGOhli1KcJU3zorHsWL0/TuH9MD1QBeqbP5QPvmWYYHMOttAcWzscH2O9O+ce12km6dVz3iSgmL JWoKvFsSjGAd7wuAn4xUFE2kquT4ckJLeTpYAVAbFoFdlWcW79siYe3fwZMVvMIfUBZUaKNrQf8 oCnBqDfv/KfgK7o0Fvszq31NoAGK3nVdys/bM1H1aIekUcnLsm1Zsz1/JolbFc1dMisEl3P+8/v u/w5gzjvLJyWcAVQmGFgh1oq2lkKFe9ofs75sO94tv3E5kkwz02OPoYQdpwMS2gDT8F2t+7c81D 5LxV9DdFo7yQkbhyCHAU16IIqTWHABXp1dYLmU95l6pz2qk39e+hOXZSTTo9IxBSgAmIfGxsvvU 80kPdz8 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> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: 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