From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4E091F9DF for ; Tue, 3 Sep 2024 18:01:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725386506; cv=none; b=mAqbHLChQMoXYb71LmDzG0oGZSd4IBGODRupUkP5AdFsUQ7VUGwrj8eXIe1J/WexeL/ggvH53Lu401w5ujCxVrt8tM16aqnXnd5y6pLhCbW7v9K5g2cX2DCSk1jRtsZhjw1rG2GBC/31h2B0OoFru1pPhEj8T7+l4IeSdsffdiY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1725386506; c=relaxed/simple; bh=397YjbGxn55sn7oWWPCdX0tA5QOEYmiTY6LUN7S6tg8=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=mpzhwtedxax5X+RTJfkB7giwBf6kMEjEw6UklKatKBj9LFj6I3WBcwWL5pHM4UELk8F77TL3V+TXG5WJFiauxiQ4Wuw7i+0IFJykgCutjYmPUHX1gcxAQ6ewFHBYk+ipbSbQWc94aB/aIZzCqsuTQl9MVfYrCgYW31q/sPfOPlo= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=lBrF56Hy; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="lBrF56Hy" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 7E2B4C4CEC4; Tue, 3 Sep 2024 18:01:45 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1725386505; bh=397YjbGxn55sn7oWWPCdX0tA5QOEYmiTY6LUN7S6tg8=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=lBrF56HyZq0NPw5vJwQFoFSs8AL4zw8O2wmS0hshX3zfmvEQDGbqqU9MfaMxdHwIq 4YiAbpnq4PdqVJWrlqbxShiNdpV8KrF843dzuxU7izLcigu5VHIMuVG4Z2zAZMELQX cYe10zKt6s+VEJdaSMqqlPFc13wUeXKa8ynSBEhE= Date: Tue, 3 Sep 2024 20:01:42 +0200 From: Greg KH To: Li Zetao Cc: hverkuil-cisco@xs4all.nl, mchehab@kernel.org, ricardo@marliere.net, laurent.pinchart+renesas@ideasonboard.com, ruanjinjie@huawei.com, linux-media@vger.kernel.org Subject: Re: [PATCH -next 2/2] media: siano: remove redundant null pointer checks in cec_devnode_init() Message-ID: <2024090334-garment-goliath-3c73@gregkh> References: <20240903143607.2004802-1-lizetao1@huawei.com> <20240903143607.2004802-2-lizetao1@huawei.com> Precedence: bulk X-Mailing-List: linux-media@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: <20240903143607.2004802-2-lizetao1@huawei.com> On Tue, Sep 03, 2024 at 10:36:07PM +0800, Li Zetao wrote: > Since the debugfs_create_dir() never returns a null pointer, checking > the return value for a null pointer is redundant, and using IS_ERR is > safe enough. > > Signed-off-by: Li Zetao > --- > drivers/media/common/siano/smsdvb-debugfs.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/media/common/siano/smsdvb-debugfs.c b/drivers/media/common/siano/smsdvb-debugfs.c > index 73990e469df9..325d674c74d9 100644 > --- a/drivers/media/common/siano/smsdvb-debugfs.c > +++ b/drivers/media/common/siano/smsdvb-debugfs.c > @@ -411,7 +411,7 @@ void smsdvb_debugfs_register(void) > * subsystem. > */ > d = debugfs_create_dir("smsdvb", usb_debug_root); > - if (IS_ERR_OR_NULL(d)) { > + if (IS_ERR(d)) { > pr_err("Couldn't create sysfs node for smsdvb\n"); Again, just do not check. thanks, greg k-h