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 bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (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 ADA9CEB64DD for ; Thu, 17 Aug 2023 08:03:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=6c1XJfZ+HfoG7vKQHbN0X6FRCjx6xmoNArrq3ILaybw=; b=TeEvVAoMt7rR1n 4ifef++Vh29eY3/vu7BKlwyLhGsNw0hIwg1XQK+m9O428RNDu2f67Kn5gEkNO5ieFDyw7VmdUbxu3 CcpuIkQIAVxdV1F83toIv+15OwQ5gf1unIftUGLFSBQ0nhe/NhTxwgrAVGckXV/mBsSS/E3fx7a7X Z4Rk7sbmgYtU08wONy7XOywtlDYjlS/MeeWxTrhs86PDwWydUnBa1AzuBUZKl4s5t9923cuXIW3VN rHEWjhedHWzUMXivpYrLefs3PZjRWvvn8pcZpfZVdNVGRSjWxLwFpNvift4CEiTfIF7cEvE/ebxA0 ZscZHtc/cpqnvaNq20UQ==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.96 #2 (Red Hat Linux)) id 1qWXyE-005mRP-0t; Thu, 17 Aug 2023 08:03:06 +0000 Received: from dfw.source.kernel.org ([2604:1380:4641:c500::1]) by bombadil.infradead.org with esmtps (Exim 4.96 #2 (Red Hat Linux)) id 1qWXyC-005mR0-07 for linux-arm-kernel@lists.infradead.org; Thu, 17 Aug 2023 08:03:05 +0000 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 92D186343C; Thu, 17 Aug 2023 08:03:02 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3A114C433C7; Thu, 17 Aug 2023 08:03:00 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692259382; bh=qHhD0UVnV47SYp//W121/iPNgLZ88B0c8IP9WQRtSnk=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=pX0JsShXEwIdADNqJaCdTF69t4iyiGO/hdr2+/12zhTsQtCy0dzli3q/1qS+m484c 1oEFFBt78BibHuyLtZUK93NGVKofIPtPHizxF2ck21hzlzNoHo7TUvTDJ4k4TVFNR8 CtnJFMIDIY9vuxvZzg/Oy7ce+Xs9yEtRwEhFYypNDStM2VsqV4dWbBwr0iJf+Rg2Xc hqER9KuIk0RiOmL8kF24xuKLI7+EDelZvqMRoPNPPjiZf5YXOzjViI4Tb1NXTZFf2w 2kvBf7mA/MUcUUKacohPii2wHt2bmoBRY4fC77R9fmlhudusN6t0D5TOwn5wNns75y krk5Weeeg30sA== Date: Thu, 17 Aug 2023 11:02:57 +0300 From: Leon Romanovsky To: Ruan Jinjie Cc: davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, lars.povlsen@microchip.com, Steen.Hegelund@microchip.com, daniel.machon@microchip.com, alexandre.torgue@foss.st.com, joabreu@synopsys.com, mcoquelin.stm32@gmail.com, horatiu.vultur@microchip.com, simon.horman@corigine.com, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-stm32@st-md-mailman.stormreply.com Subject: Re: [PATCH net-next 0/2] net: Use helper function IS_ERR_OR_NULL() Message-ID: <20230817080257.GD22185@unreal> References: <20230817071941.346590-1-ruanjinjie@huawei.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20230817071941.346590-1-ruanjinjie@huawei.com> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20230817_010304_143937_C5FE8BCC X-CRM114-Status: GOOD ( 13.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Thu, Aug 17, 2023 at 03:19:39PM +0800, Ruan Jinjie wrote: > Use IS_ERR_OR_NULL() instead of open-coding it > to simplify the code. > > Ruan Jinjie (2): > net: microchip: sparx5: Use helper function IS_ERR_OR_NULL() > net: stmmac: Use helper function IS_ERR_OR_NULL() > > drivers/net/ethernet/microchip/sparx5/sparx5_tc_flower.c | 2 +- > drivers/net/ethernet/stmicro/stmmac/stmmac_main.c | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) > Thanks, Reviewed-by: Leon Romanovsky As a side note, grep of vcap_get_rule() shows that many callers don't properly check return value and expect it to be or valid or NULL. For example this code is not correct: drivers/net/ethernet/microchip/lan966x/lan966x_ptp.c 61 vrule = vcap_get_rule(lan966x->vcap_ctrl, rule_id); 62 if (vrule) { 63 u32 value, mask; 64 65 /* Just modify the ingress port mask and exit */ 66 vcap_rule_get_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK, 67 &value, &mask); 68 mask &= ~BIT(port->chip_port); 69 vcap_rule_mod_key_u32(vrule, VCAP_KF_IF_IGR_PORT_MASK, 70 value, mask); 71 72 err = vcap_mod_rule(vrule); 73 goto free_rule; 74 } _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel