Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1071156rdh; Mon, 25 Sep 2023 02:15:43 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHCi8phz+vvswIWdbTszDAk/x+rR0cF/mSvcezxBgDBq+Y8Um/lREcdjcRYE3AYLGk9qSQV X-Received: by 2002:a05:6358:98a3:b0:143:5fd5:b826 with SMTP id q35-20020a05635898a300b001435fd5b826mr8499998rwa.24.1695633343392; Mon, 25 Sep 2023 02:15:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695633343; cv=none; d=google.com; s=arc-20160816; b=PfFgPlQc+LcEvLt9Npsx7/ZWg39aZOo+rGl5PmVCDxUfUf7NakETJkxw9A1EoeQOwA miJN7uu/c73QSsqXHL7UWQTA5kC83cxWSkmWg8EEZ8nrhLzOA/h6xNhHy1N2hO4MdwPK kJ94WeCP1qF+zStUbQzirGwjbqO7BUfU4CWcZtxW1qo06gBDzq2Md9H3o2uixzYe3GDu aCD5XKeBo6xpZzV6PeFylTXVL87v1dteg0ArwPBOG9obfV5NJJ9QsQQnR2Dva5DT51xI CcnbQclXJbTpDvC5eFAtqfJSF5W7ElEDYX/XGIwvuKMhhPpPgjLdAcZDZy/Bv8kWhaUP pOqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=w4XXZlfw+xZ3KRqTeBP98yMWcU3Sg6iOetUlD/igc34=; fh=bdu7jEQgCwrJT8lb8uCiWBIpUs+M/Xdb1UIjBxMEOD0=; b=MsVY92VrOCfyZHvausALvthE4tdabDOutgRj1EnFTb97TpssFLORpWJAgBxxzJh8SQ 7LDdg2ngV/DPZjZsjF4Cwe7/lgj82fjnz0HLiprY7xaLmwcyXcnFNcJC9y495H8IymsM TKUdIZG9UCSaztWmOzQBPHstZa0nNwV5zoIW+oggXQQgZzuhvKKynK8WWzTVIob6Pzh9 td0wBRzSaI4hrH5Rrcvw88eDrI13Wk/Gv1iGByQt5aB3d2g3ky/BnPjfrPUUcnrAVvqO Oe+9kcdrxafzd1KDHqTNCza2EhsOD2fSdPLkZq7ABIGwrvQmIpR7Q/deu7Qv/yI6bxRu sPjQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=pvQSeP0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from agentk.vger.email (agentk.vger.email. [23.128.96.32]) by mx.google.com with ESMTPS id m9-20020a654389000000b005774d2f4ab5si9169458pgp.807.2023.09.25.02.15.41 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 02:15:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) client-ip=23.128.96.32; Authentication-Results: mx.google.com; dkim=pass header.i=@infradead.org header.s=bombadil.20210309 header.b=pvQSeP0B; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.32 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by agentk.vger.email (Postfix) with ESMTP id DC91A8095651; Sun, 24 Sep 2023 21:25:52 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at agentk.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231741AbjIYEZl (ORCPT + 99 others); Mon, 25 Sep 2023 00:25:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49728 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231176AbjIYEZj (ORCPT ); Mon, 25 Sep 2023 00:25:39 -0400 Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B0B1BDF for ; Sun, 24 Sep 2023 21:25:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=bombadil.20210309; h=Content-Transfer-Encoding: Content-Type:In-Reply-To:From:References:Cc:To:Subject:MIME-Version:Date: Message-ID:Sender:Reply-To:Content-ID:Content-Description; bh=w4XXZlfw+xZ3KRqTeBP98yMWcU3Sg6iOetUlD/igc34=; b=pvQSeP0BXwKuh1EWIHnXj0L0Ru DUo9+xbJ800/DNzBXfbJiMNV5/+TaJTgJQSVSjy+lDURSF2eklfDFunDVPEfzIAYAdCUf4RkMGnhI 7n1ffAW3I0EACo7vdDxfHMHOt3W/VVTrpXuxfCLG/eEho2ti5ZqX+fnWiJFhHY49XlIostAuLZQcx mxrVbtBy0MelCjsKPCHam85NLlv7Xw+qoVPRTokDnVWD+0bYADMdY7JyrJcnD5Y9UaxXW93FTb6d1 Gf6lfDlrs2/TJC3mxXi53RIG3pgAyogg+3UJnXO61gvEQhxOvbLcZcwXV7EOZHieoVsR/PloHQFBP S6tA1Ymg==; Received: from [2601:1c2:980:9ec0::9fed] by bombadil.infradead.org with esmtpsa (Exim 4.96 #2 (Red Hat Linux)) id 1qkdA3-00DIAq-1B; Mon, 25 Sep 2023 04:25:31 +0000 Message-ID: Date: Sun, 24 Sep 2023 21:25:29 -0700 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: ERR_PTR(0) in a couple of places Content-Language: en-US To: Matthew Brost , "Dr. David Alan Gilbert" Cc: mgreer@animalcreek.com, krzysztof.kozlowski@linaro.org, linux-kernel@vger.kernel.org, airlied@gmail.com, intel-gfx@lists.freedesktop.org References: From: Randy Dunlap In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on agentk.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (agentk.vger.email [0.0.0.0]); Sun, 24 Sep 2023 21:25:53 -0700 (PDT) On 9/24/23 21:18, Matthew Brost wrote: > On Sun, Sep 24, 2023 at 12:41:07AM +0000, Dr. David Alan Gilbert wrote: >> Hi, >> I randomly noticed there are a couple of places in the kernel that >> do >> ERR_PTR(0); >> >> and thought that was odd - shouldn't those just be NULL's ? >> >> 1) i915 >> drivers/gpu/drm/i915/gt/uc/selftest_guc_multi_lrc.c : 47 >> >> if (i <= 1) >> return ERR_PTR(0); > > Yes, s/ERR_PTR(0)/ERR_PTR(NULL)/ > > Matt I agree with Dave's original suggestion since casting NULL isn't needed. > >> >> from f9d72092cb490 >> >> 2) trf7970a >> drivers/nfc/trf7970a.c : 896 >> >> trf->ignore_timeout = >> !cancel_delayed_work(&trf->timeout_work); >> trf->rx_skb = ERR_PTR(0); >> trf7970a_send_upstream(trf); >> >> from 1961843ceeca0 >> >> Dave >> -- >> -----Open up your eyes, open up your mind, open up your code ------- >> / Dr. David Alan Gilbert | Running GNU/Linux | Happy \ >> \ dave @ treblig.org | | In Hex / >> \ _________________________|_____ http://www.treblig.org |_______/ -- ~Randy