netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Leon Romanovsky <leon@kernel.org>
To: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Cc: Jakub Kicinski <kuba@kernel.org>,
	"David S . Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Paolo Abeni <pabeni@redhat.com>,
	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
Date: Thu, 5 Jan 2023 10:01:52 +0200	[thread overview]
Message-ID: <Y7aD8F5OuAwaEKjU@unreal> (raw)
In-Reply-To: <94876618-bc7c-dd42-6d41-eda80deb6f1d@wanadoo.fr>

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

  reply	other threads:[~2023-01-05  8:02 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-01-04 21:05 [PATCH net-next 0/3] ezchip: Simplify some code Christophe JAILLET
2023-01-04 21:05 ` [PATCH net-next 1/3] ezchip: Remove some redundant clean-up functions Christophe JAILLET
2023-01-05  4:52   ` Jakub Kicinski
2023-01-04 21:05 ` [PATCH net-next 2/3] ezchip: Switch to some devm_ function to simplify code Christophe JAILLET
2023-01-05  4:54   ` Jakub Kicinski
2023-01-05  6:27     ` Christophe JAILLET
2023-01-05  8:01       ` Leon Romanovsky [this message]
2023-01-05 18:31       ` Jakub Kicinski
2023-01-04 21:05 ` [PATCH net-next 3/3] ezchip: Further clean-up Christophe JAILLET

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y7aD8F5OuAwaEKjU@unreal \
    --to=leon@kernel.org \
    --cc=christophe.jaillet@wanadoo.fr \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kernel-janitors@vger.kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).