Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp444646rwl; Wed, 4 Jan 2023 22:48:26 -0800 (PST) X-Google-Smtp-Source: AMrXdXuu1cSvlnr3t0b+KT0VRXtMW36fd/d/dyaU3ysF2SjCGz/RBI0ZLisOYc7H369xytqSDvbS X-Received: by 2002:a17:907:72d3:b0:7c0:fd1e:972e with SMTP id du19-20020a17090772d300b007c0fd1e972emr55334626ejc.46.1672901306475; Wed, 04 Jan 2023 22:48:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672901306; cv=none; d=google.com; s=arc-20160816; b=ICjXu87HzwwGGpynI8N1hmcWbKwV3W5eg85sqx94zVUaTh7KY2LPz0zsL+69p1XC/H aPVycbcj1B/U10pT3Bycc+oo0jUlmdayQPw5zGQDt8mUY2W4Oms+LVOA8cBn34GE1HYk UVb8+sE0i3/Ob9fRXdtcScodnSwt3JwlLuCn8Etl+XFOgBK3NXf7ccCA/iJRxc87DJTK 6SkDnYRnmAHYq36AuOSv6U1Q2jSEylMlG8VBLwYY2OX97DmrvV7EGPzsIJObF38wRldh bDKeIu2//kQBq3ExEyQpHomh2cN4qllR01x0SvYXBJ6qpQqzNunDTA5pV6Zy/ov/L7H6 z7SA== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id; bh=ozoNoWq5YHQg17SUSazz8hPc3GLmc3oTnkD0QDH663o=; b=fLES30x18kWuSjy7LRD2JYgx1RlgMjIctCOYak/z6dB3MjHsT+7Rfa59D5oiH44Of1 zIGWM2cZ3tEtRoa21taPylHoguN0W5PnAAAMnlVpASq9Xe9ZyhwlxZg7qo/78ysNDnxS neo3Op57CXB0MUR2RceJMWExE8+70o5d5Rg0Tove2cf/KIvYVmtSH8eFNvl6imNUh3EI GT0+0Nro1ENneB8ydJ4HApdw1Dhszk9un71tr/XgDT6YDVzrX0LMiF9gRRjkwHH5AJh7 OPTvMN9LF4TPGR035dAvExkcYzu5pDB0xdilt6jOad60GLfAAvmqihiVrZtOnJpr8SOR wOCg== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id js22-20020a17090797d600b007a5cdd9550esi35888511ejc.201.2023.01.04.22.48.13; Wed, 04 Jan 2023 22:48:26 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230112AbjAEG1H (ORCPT + 55 others); Thu, 5 Jan 2023 01:27:07 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230131AbjAEG1F (ORCPT ); Thu, 5 Jan 2023 01:27:05 -0500 Received: from smtp.smtpout.orange.fr (smtp-11.smtpout.orange.fr [80.12.242.11]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2AE3E50F55 for ; Wed, 4 Jan 2023 22:27:03 -0800 (PST) Received: from [192.168.1.18] ([86.243.100.34]) by smtp.orange.fr with ESMTPA id DJiOpLFMWoBUEDJiOpC7y5; Thu, 05 Jan 2023 07:27:02 +0100 X-ME-Helo: [192.168.1.18] X-ME-Auth: Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= X-ME-Date: Thu, 05 Jan 2023 07:27:02 +0100 X-ME-IP: 86.243.100.34 Message-ID: <94876618-bc7c-dd42-6d41-eda80deb6f1d@wanadoo.fr> Date: Thu, 5 Jan 2023 07:27:00 +0100 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.4.2 Subject: Re: [PATCH net-next 2/3] ezchip: Switch to some devm_ function to simplify code To: Jakub Kicinski Cc: "David S . Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, netdev@vger.kernel.org References: <20230104205438.61a7dc20@kernel.org> Content-Language: fr, en-US From: Christophe JAILLET In-Reply-To: <20230104205438.61a7dc20@kernel.org> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-3.6 required=5.0 tests=BAYES_00,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_PASS,SPF_PASS autolearn=ham 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 Le 05/01/2023 à 05:54, Jakub Kicinski a écrit : > On Wed, 4 Jan 2023 22:05:33 +0100 Christophe JAILLET wrote: >> devm_alloc_etherdev() and devm_register_netdev() can be used to simplify >> code. >> >> Now the error handling path of the probe and the remove function are >> useless and can be removed completely. > > Right, but this is very likely a dead driver. Why invest in refactoring? > Hi Jakub, this driver was just randomly picked as an example. My main point is in the cover letter. I look for feed-back to know if patches like that are welcomed. Only the first, Only the second, Both or None. I put it here, slightly rephrased: These patches (at least 1 and 2) can be seen as an RFC for net MAINTAINERS, to see if there is any interest in: - axing useless netif_napi_del() calls, when free_netdev() is called just after. (patch 1) - simplifying code with axing the error handling path of the probe and the remove function in favor of using devm_ functions (patch 2) or if it doesn't worth it and would only waste MAINTAINERS' time to review what is in fact only code clean-ups. The rational for patch 1 is based on Jakub's comment [1]. free_netdev() already cleans up NAPIs (see [2]). CJ [1]: https://lore.kernel.org/all/20221221174043.1191996a@kernel.org/ [2]: https://elixir.bootlin.com/linux/v6.2-rc1/source/net/core/dev.c#L10710