LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
From: Finn Thain <fthain@linux-m68k.org>
To: "Uwe Kleine-König" <u.kleine-koenig@pengutronix.de>
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
	linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org,
	kernel@pengutronix.de
Subject: Re: [PATCH v2 1/4] nubus: Simplify check in remove callback
Date: Tue, 3 Aug 2021 12:14:07 +1000 (AEST)	[thread overview]
Message-ID: <efc9599-82db-5343-a377-ed53bdb928c6@linux-m68k.org> (raw)
In-Reply-To: <20210802065224.n2tarfx6hzfamdyp@pengutronix.de>

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

On Mon, 2 Aug 2021, Uwe Kleine-König wrote:

> > 
> > BTW, aside from nubus, zorro and superhyway you can find the same 
> > pattern in many other busses. You may want to patch the following 
> > methods too.
> > 
> > acpi_device_remove
> > apr_device_remove
> > ccwgroup_remove
> > gio_device_remove
> > hid_device_remove 
> > ibmebus_bus_device_remove
> > macio_device_remove
> > memstick_device_remove
> > ntb_remove
> > pci_device_remove
> > pnp_device_remove
> > ps3_system_bus_remove
> > rio_device_remove
> > slim_device_remove
> > soundbus_device_remove
> > ssb_device_remove
> > tifm_device_remove
> > vdpa_dev_remove
> > vmbus_remove
> 
> Did you find these by hand? Or using a coccinelle match?
> 

I used grep and visual inspection.

> Anyhow, thanks for the list, I'll add it to my todo list but if you're 
> motivated don't consider these cleanups as my property. (Please Cc: me 
> though to prevent duplicated effort.)
> 

I went looking for the other examples of this pattern because I wanted to 
understand it better. Then I realized that I might as well make a list 
since I was searching anyway.

When skimming that code, I took the impression that the dev->driver == 
NULL test probably comes from old code written before the 'remove' 
functions became bus methods. See also commit 594c8281f905 ("[PATCH] Add 
bus_type probe, remove, shutdown methods.")

Back when I wrote drivers/nubus/bus.c, apparently I copied-and-pasted the 
old pattern from drivers/pci/pci-driver.c, even though that pattern was 
already obsolete.

So I do see the value in this cleanup but I'm afraid I'm too busy to help 
further. If you don't want to finish it perhaps you can get the janitors 
to do so.

  reply	other threads:[~2021-08-03  2:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-07-30 19:10 [PATCH v2 0/4] Some cleanups after making bus_type::remove return void Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 1/4] nubus: Simplify check in remove callback Uwe Kleine-König
2021-08-01  5:04   ` Finn Thain
2021-08-02  6:52     ` Uwe Kleine-König
2021-08-03  2:14       ` Finn Thain [this message]
2021-07-30 19:10 ` [PATCH v2 2/4] sh: superhyway: " Uwe Kleine-König
2021-07-30 19:10 ` [PATCH v2 3/4] zorro: Simplify " Uwe Kleine-König
2021-08-09 13:22   ` Geert Uytterhoeven
2021-07-30 19:10 ` [PATCH v2 4/4] zorro: Drop useless (and hardly used) .driver member in struct zorro_dev Uwe Kleine-König
2021-08-09 13:25   ` Geert Uytterhoeven

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=efc9599-82db-5343-a377-ed53bdb928c6@linux-m68k.org \
    --to=fthain@linux-m68k.org \
    --cc=gregkh@linuxfoundation.org \
    --cc=kernel@pengutronix.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=u.kleine-koenig@pengutronix.de \
    --subject='Re: [PATCH v2 1/4] nubus: Simplify check in remove callback' \
    /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

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).