Received: by 2002:a05:6359:6284:b0:131:369:b2a3 with SMTP id se4csp4686474rwb; Tue, 8 Aug 2023 12:06:35 -0700 (PDT) X-Google-Smtp-Source: AGHT+IGudXdf69fS8B+1YVu7TBpwVCf7CVKAOQTWjRe8MaawWO/7pHyz+4TdCv9Vwp9girInAVLw X-Received: by 2002:a17:907:2cf0:b0:99c:3b4:940f with SMTP id hz16-20020a1709072cf000b0099c03b4940fmr407791ejc.27.1691521594784; Tue, 08 Aug 2023 12:06:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691521594; cv=none; d=google.com; s=arc-20160816; b=YIVi7sRJfSrK27nvCCCQ4au9Yz9wYYNGlYiwD2DlVD7xD3LHHytyr6o0ycu9/UD5Sd TByr5P7a4Zhi9bcJcF91J1KRRaH/QlI61W4Zm2KJNScer54Ax9qDDtjhg9E5y4qtUJC1 RHJRom2frEnfE4xoh6QB7t2M50na+OlSC2Y6Bl5PhlqvdFxNwmByfE85SQc0dDCU1bzE o+gb0/EEYfnGeuMrJutW6TWpGFKcrnDBYeh6bbzZ5Gp25CcHDLAy5Ql3jt7UppcFqHHt Auz0LtSywYT/qy6cB2K6jMvctlf90hDGv5bbQkAUO/3qYFRfnnNoS0JfVzk86ojaXs9o C4/g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:message-id:references :in-reply-to:subject:cc:to:from:date:mime-version:dkim-signature; bh=RhsEcFqZiHgGcTZd80cthbmqzTC3QEK1gP/svUayE5c=; fh=EMpdRqgEUUgsAYAAjrtI8GYThYk5tg420bGJa/tmS7o=; b=umwdnMwBkSswpLH9Psx2RidBXofEbZidVwCJ5Jt2KetA6R3q2Wnh61V3abUnVSibjE ZNBDW+5351/ox5zLzl5WIblHbr9zFlKVTtmVQjje1+PwFIZxs0N0fdIlODyBtlwP/foh IpLBC9Xdf0ReXngIv+ItOQk+fOLkKD9+ZzWFxe4GWqVggYeF93kei6YFjaFRFHkxKr9s rDGRhkzepFH93cQQrABP9aFsOhJi37OOleehWHHUXSjoN2/2WJ6QVIGK1GupLbN6fa+p JdOPKHbbuOyzcYn6XbUaabqgzDeT8mR6jGi1gOzyKuFApt+dt+CBsVpc7LBKrwANHszT hHUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@walle.cc header.s=mail2022082101 header.b=Qr5b9UWf; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id l18-20020a1709061c5200b00991df86ac08si7454963ejg.256.2023.08.08.12.06.09; Tue, 08 Aug 2023 12:06:34 -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=@walle.cc header.s=mail2022082101 header.b=Qr5b9UWf; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=walle.cc Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234320AbjHHRRm (ORCPT + 99 others); Tue, 8 Aug 2023 13:17:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36076 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234345AbjHHRRC (ORCPT ); Tue, 8 Aug 2023 13:17:02 -0400 Received: from mail.3ffe.de (0001.3ffe.de [159.69.201.130]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8CA9571F19 for ; Tue, 8 Aug 2023 09:06:58 -0700 (PDT) Received: from 3ffe.de (0001.3ffe.de [IPv6:2a01:4f8:c0c:9d57::1]) (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 mail.3ffe.de (Postfix) with ESMTPSA id C34AEEA5; Tue, 8 Aug 2023 08:38:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=walle.cc; s=mail2022082101; t=1691476690; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=RhsEcFqZiHgGcTZd80cthbmqzTC3QEK1gP/svUayE5c=; b=Qr5b9UWfKwaskhKYb08Z0hRxrxO/+5No8pVLMACXu+7xSBtXE8PbAmuo29iw2Nn6DxuiY5 viIu1NGcT5T/JVaee08JPKoz3LmwWzhWsD03VCETZplaX0LgcR8nNtwEkzykR2WYou/w7S lYWaa9rs3CrRYaN5WbX7twLGkIHlNosjpVgCZuP0Iwttyfjc4xT97AAvUKWqe8WtqngCWh 8Y0UgP4+Y82cRTGOqWML/6lb/Hf+MgvgOSj6TYfkTM5vVXKxaelbAxzBo15dJZlF0igbUY Wd2w2luUYE39Sujgg7f4paxKiOUcE/GfR4t2pbZGu16nGeK67GZKUj63I3P3qw== MIME-Version: 1.0 Date: Tue, 08 Aug 2023 08:38:10 +0200 From: Michael Walle To: Miquel Raynal Cc: Srinivas Kandagatla , Greg Kroah-Hartman , Thomas Petazzoni , Robert Marko , Luka Perkov , linux-kernel@vger.kernel.org, Randy Dunlap , Chen-Yu Tsai , Daniel Golle , =?UTF-8?Q?Rafa=C5=82_Mi=C5=82ecki?= , Miquel Raynal , kernel test robot , Dan Carpenter Subject: Re: [PATCH v9 2/7] nvmem: core: Return NULL when no nvmem layout is found In-Reply-To: <20230808062932.150588-3-miquel.raynal@bootlin.com> References: <20230808062932.150588-1-miquel.raynal@bootlin.com> <20230808062932.150588-3-miquel.raynal@bootlin.com> Message-ID: <5270b7f6e571d4016eb7018745fc0e88@walle.cc> X-Sender: michael@walle.cc Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.6 required=5.0 tests=BAYES_00,DATE_IN_PAST_06_12, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=no 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 Am 2023-08-08 08:29, schrieb Miquel Raynal: > Currently, of_nvmem_layout_get_container() returns NULL on error, or an > error pointer if either CONFIG_NVMEM or CONFIG_OF is turned off. We > should likely avoid this kind of mix for two reasons: to clarify the > intend and anyway fix the !CONFIG_OF which will likely always if we use > this helper somewhere else. Let's just return NULL when no layout is > found, we don't need an error value here. > > Link: > https://staticthinking.wordpress.com/2022/08/01/mixing-error-pointers-and-null/ > Fixes: 266570f496b9 ("nvmem: core: introduce NVMEM layouts") > Reported-by: kernel test robot > Reported-by: Dan Carpenter > Closes: https://lore.kernel.org/r/202308030002.DnSFOrMB-lkp@intel.com/ > Signed-off-by: Miquel Raynal Reviewed-by: Michael Walle