Received: by 2002:a05:7412:b10a:b0:f3:1519:9f41 with SMTP id az10csp1489606rdb; Fri, 1 Dec 2023 20:11:57 -0800 (PST) X-Google-Smtp-Source: AGHT+IFWntDCDr/iu0rgGZTHFAcwZMh9vPPRia+vszxEWjjEGi22BWr6HBu/qzOVf3+4Yj63hGxZ X-Received: by 2002:a05:6e02:1cae:b0:35d:5995:79a4 with SMTP id x14-20020a056e021cae00b0035d599579a4mr970228ill.62.1701490317127; Fri, 01 Dec 2023 20:11:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701490317; cv=none; d=google.com; s=arc-20160816; b=RwripjeauF9x+Q4V9clEKnJ8MDI6uD6mAjV6Dnl9wkonw1vT80YvP1bgMKby1UNBrt gwKydHB4tZvTLSRXceDjoGMAAwy5nEMJnbrSfoXCJRp4fJJlsOaJfBdPQrkpwnXHcpZu oVpQGw1+fqPqVITHOEVne1XSUu1fpP7VA/TS4WoCl9/RwC88n4vVSx2tClaufuKSgXAP OEVdAajNq9Guj6cZR6kOUVXm9W4BZeJN0IC0JGR7VRvqpsgvUhNSgeNJq+cRVB1vn8vA yW8mptT2S+QOYqNoqh8CvI4eMy8jx4UIUcymqr4a++IkSa4FQ/vFImLykjYy6JdqFaWG zaiw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date :dkim-signature; bh=TYxYO+O4bTE3DmflgP/MlCHWNovgEE1RKQ4gG+DAhmQ=; fh=yQp/nEUE4LChVkeTU+ldj/VaFIUfXszOyj5wwpjoCaM=; b=dv89nFWBKCeicO6ucXneFR1u3K/Jzm9k1blsFL8hNTtYH71tMUyL2Guv6/EOXSGQ6z BFPYLUeJi3htdVyyp5rcqg6AXljR6ZGpOWNZU7MlctB0DDz0EqFjuHqRRk7ZuDkfVlch gYdUz6B2Ocr3xCGaIxYhvDS5K4SFoNXrTBF03/LtIjDMwA7JXGwmGPvAnyIQ9SwpqBcE KXMej5d8t14K0DfY7cIJnEL3Amtvhm8eYaBRQ3dgNB9+Z7aS2W15QxJlxagc1h3vGHkW 3WgGJd+uD6cY3Utj5wKVABOYNzLYsOUlR+hwKLDstig2Uwe2AjaS7u1f9nHZLndOcLVq 8t0g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=antRZhyW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id z32-20020a634c20000000b005c201808430si4239298pga.120.2023.12.01.20.11.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 01 Dec 2023 20:11:57 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=antRZhyW; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id E711E81A205D; Fri, 1 Dec 2023 20:11:54 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229537AbjLBELm (ORCPT + 99 others); Fri, 1 Dec 2023 23:11:42 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44902 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229456AbjLBELl (ORCPT ); Fri, 1 Dec 2023 23:11:41 -0500 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DC479126 for ; Fri, 1 Dec 2023 20:11:47 -0800 (PST) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0E470C433C9; Sat, 2 Dec 2023 04:11:46 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1701490307; bh=1+nNWFO5K984/3PjlBg4MbMZtLgdAePl/arFcHZyCBA=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=antRZhyW9OJFc8PJ7MCSBpl6Dv69m+q310z41f5BZ/8TllOiIJ62hf3xpm+XMpn+h 47BwXTTORiE9/QXFF8aCeCV6KhfJ6Xy0bh9mj4zVjh8kqeKEODT94iwqph+tuX9zyq 6/O4dDG/hVM4Y06aH4THs12QwoToJGi3fnOI2kkTuDZM7asYag+tr0TZdt+oDn0M/A TPl0W+piJh+vojH5+VC+MFBWZCuDBQjg3X4oVYp8qlgr5PevF7YMB5xel3ZLvF23Rq INA9XYXS5/kS+CXxkUjC2L1jNojvnAJ6XoRcpQ6i6Y8Ms52bPyvbyC/Pj68upurhtD 9uV4BuIuqvocg== Date: Fri, 1 Dec 2023 20:11:46 -0800 From: Jakub Kicinski To: Haoran Liu Cc: davem@davemloft.net, edumazet@google.com, pabeni@redhat.com, heiko@sntech.de, netdev@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-rockchip@lists.infradead.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] [net/ethernet] arc_emac: Add error handling in emac_rockchip_probe Message-ID: <20231201201146.12aa16df@kernel.org> In-Reply-To: <20231130031318.35850-1-liuhaoran14@163.com> References: <20231130031318.35850-1-liuhaoran14@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-1.2 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.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 (lipwig.vger.email [0.0.0.0]); Fri, 01 Dec 2023 20:11:55 -0800 (PST) On Wed, 29 Nov 2023 19:13:18 -0800 Haoran Liu wrote: > Although the error addressed by this patch may not occur in the current > environment, I still suggest implementing these error handling routines > if the function is not highly time-sensitive. As the environment evolves > or the code gets reused in different contexts, there's a possibility that > these errors might occur. Addressing them now can prevent potential > debugging efforts in the future, which could be quite resource-intensive. Please skip this pointless boilerplate. > match = of_match_node(emac_rockchip_dt_ids, dev->of_node); > + if (!match) { > + dev_err(dev, "No matching device found\n"); > + return -ENODEV; "device" and ENODEV are not right here. -- pw-bot: cr