Received: by 2002:a05:6358:16cc:b0:ea:6187:17c9 with SMTP id r12csp520481rwl; Thu, 5 Jan 2023 00:14:36 -0800 (PST) X-Google-Smtp-Source: AMrXdXs7t3Xab594P3DXRSv7zsfP2+emy5fCwrigPr8FObSmhtvNF/nuIwB7t75ATLK37pElfswJ X-Received: by 2002:a17:907:7e9f:b0:7c1:7d81:d2a8 with SMTP id qb31-20020a1709077e9f00b007c17d81d2a8mr52013698ejc.3.1672906475788; Thu, 05 Jan 2023 00:14:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1672906475; cv=none; d=google.com; s=arc-20160816; b=iv0XeeZR5OjUllfgBPPArRfLN2OX7RHum3EckVYK+xmBC1Wv05xBAoSmHzyhFLWUIS 4NjsFozbN3DOk+Im7JlGUzCIoFaHma3d9L1pWKQ/gqmiPGt8skaNcj83SIK9345EseEv kVCeNsSeZ1HvzifxVoB+HqN6KT8QeRxIcriSQ2nRho5tfNGnHdERNPI++25gZLaJkzCC l4UP5d98wp7tlSv6d/T0wNlVwsojGnOZ8JjwYhvTvZ/Nq6jEJlKrbcXCEcEoXTyg3Sx7 TqJYd1SayVjf1NrK8fuHk3GUZTC+bZPkuISSLR2y5xihpCQDGBU8c13DkWudMYmY9H9g W84A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-transfer-encoding :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=ksIYSbPzAMibRz+BgNGwK3WiDWl1W5XW1DVK7d/HEGw=; b=ze8+P0E9RQH5Lh7BsAiA9uB9hDVh5x+zhmJIFGV/IFOGv/NX1iK0kyRfmOKrh4E+0d ZTGnZf/fiVVqJNFQ87xK+lTU8WCWVMb9N2IDk8LZg2qBCNgA+cSplNcgFlcz36YUFUVj 7lv7hFPc0d+jJRnms7JB4kmubLHPli4ph0uMznstJdu1cX/X2Tv6xoaweJuASnodmTzz A9V/ptmDpjqmR5jU4evXTtZyALuivwI26qC4rqbcLPGper0KsBDmlnk4qfxtmDE/Un8B O7+VHvZtJjgtMM1q4OFgYPJ39TRhkPd1VocEDhvwxMqJnZmn0ufyeULMUaGOdDZ0Kk89 LnVw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ASD4yqvY; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id t18-20020a1709063e5200b007bc93454b3fsi26007714eji.953.2023.01.05.00.14.22; Thu, 05 Jan 2023 00:14:35 -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; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=ASD4yqvY; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231270AbjAEICG (ORCPT + 57 others); Thu, 5 Jan 2023 03:02:06 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48238 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230475AbjAEIB7 (ORCPT ); Thu, 5 Jan 2023 03:01:59 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8804C17597; Thu, 5 Jan 2023 00:01:57 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 2CB3C6190B; Thu, 5 Jan 2023 08:01:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0AB89C433EF; Thu, 5 Jan 2023 08:01:55 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1672905716; bh=w5W3eLaqipVDvJWkR5utJmks9c/6Wu40ITZJrOR/Vtg=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=ASD4yqvYISTgGKoiCrSfdnp5vYULBiuzLPyd6t5jCwXTnQ0VKRF8Kil9MYFTHwOpw tC0tWgHHo+jinhek8L5B8BpBfaPOoDKQUBsR7T1J5FcI0rtgsiOWE7vYZiY6wQXIWB K86khD8z7k0I7MtDJw+55IvgELxPUYPNizyY8Y5ktddjXO8YSY006TSzq8v5Z8KuAU bO2jmIcp4ZG4Pj/JZeonkcjHS+gs6suQ4drs8NtlKHWVBL5U0MukZJEYzyITrhHLlQ W5qroik6iikA54zX0C4WsIIbMdFiPzC0Yd/MALlee4SG0fWJ6P26U7UigVLCDEIBSq GEX54KZB9ZUvA== Date: Thu, 5 Jan 2023 10:01:52 +0200 From: Leon Romanovsky To: Christophe JAILLET Cc: Jakub Kicinski , "David S . Miller" , Eric Dumazet , Paolo Abeni , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, netdev@vger.kernel.org Subject: Re: [PATCH net-next 2/3] ezchip: Switch to some devm_ function to simplify code Message-ID: References: <20230104205438.61a7dc20@kernel.org> <94876618-bc7c-dd42-6d41-eda80deb6f1d@wanadoo.fr> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <94876618-bc7c-dd42-6d41-eda80deb6f1d@wanadoo.fr> X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,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 On Thu, Jan 05, 2023 at 07:27:00AM +0100, Christophe JAILLET wrote: > 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) I would say no. In many occasions, the devm_* calls were marked as harmful. Latest talk about devm_kzalloc(): https://lpc.events/event/16/contributions/1227/ Thanks > > 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