* [PATCH] intel_th: Remove an unused exit point from intel_th_remove() @ 2021-05-05 20:37 Uwe Kleine-König 2021-05-06 9:20 ` Alexander Shishkin 0 siblings, 1 reply; 3+ messages in thread From: Uwe Kleine-König @ 2021-05-05 20:37 UTC (permalink / raw) To: Alexander Shishkin; +Cc: linux-kernel, kernel As described in the added comment device_for_each_child never returns a non-zero value. So remove the corresponding error check. This simplifies the quest to make struct bus_type::remove() return void. Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> --- drivers/hwtracing/intel_th/core.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/drivers/hwtracing/intel_th/core.c b/drivers/hwtracing/intel_th/core.c index 24d0c974bfd5..4bf025ef2031 100644 --- a/drivers/hwtracing/intel_th/core.c +++ b/drivers/hwtracing/intel_th/core.c @@ -100,16 +100,18 @@ static int intel_th_remove(struct device *dev) struct intel_th_driver *thdrv = to_intel_th_driver(dev->driver); struct intel_th_device *thdev = to_intel_th_device(dev); struct intel_th_device *hub = to_intel_th_hub(thdev); - int err; if (thdev->type == INTEL_TH_SWITCH) { struct intel_th *th = to_intel_th(hub); int i, lowest; - /* disconnect outputs */ - err = device_for_each_child(dev, thdev, intel_th_child_remove); - if (err) - return err; + /* + * disconnect outputs + * + * intel_th_child_remove returns 0 unconditionally, so there is + * no need to check the return value of device_for_each_child. + */ + device_for_each_child(dev, thdev, intel_th_child_remove); /* * Remove outputs, that is, hub's children: they are created base-commit: d665ea6ea86c785760ee4bad4543dab3267ad074 -- 2.30.2 ^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] intel_th: Remove an unused exit point from intel_th_remove() 2021-05-05 20:37 [PATCH] intel_th: Remove an unused exit point from intel_th_remove() Uwe Kleine-König @ 2021-05-06 9:20 ` Alexander Shishkin 2021-05-06 9:42 ` Uwe Kleine-König 0 siblings, 1 reply; 3+ messages in thread From: Alexander Shishkin @ 2021-05-06 9:20 UTC (permalink / raw) To: Uwe Kleine-König; +Cc: linux-kernel, kernel, alexander.shishkin Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes: > As described in the added comment device_for_each_child never returns > a non-zero value. So remove the corresponding error check. > > This simplifies the quest to make struct bus_type::remove() return void. > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> Picked up, thanks! Out of curiosity: does the mentioned quest have a message-id or a git branch? Thanks, -- Alex ^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] intel_th: Remove an unused exit point from intel_th_remove() 2021-05-06 9:20 ` Alexander Shishkin @ 2021-05-06 9:42 ` Uwe Kleine-König 0 siblings, 0 replies; 3+ messages in thread From: Uwe Kleine-König @ 2021-05-06 9:42 UTC (permalink / raw) To: Alexander Shishkin; +Cc: linux-kernel, kernel [-- Attachment #1: Type: text/plain, Size: 1143 bytes --] Hello Alexander, On Thu, May 06, 2021 at 12:20:30PM +0300, Alexander Shishkin wrote: > Uwe Kleine-König <u.kleine-koenig@pengutronix.de> writes: > > > As described in the added comment device_for_each_child never returns > > a non-zero value. So remove the corresponding error check. > > > > This simplifies the quest to make struct bus_type::remove() return void. > > > > Signed-off-by: Uwe Kleine-König <u.kleine-koenig@pengutronix.de> > > Picked up, thanks! Out of curiosity: does the mentioned quest have a > message-id or a git branch? I just pushed my wip patch to https://git.pengutronix.de/git/ukl/linux bus-make-remove-void to satisfy your curiosity. If you prefer a clickable version: https://git.pengutronix.de/cgit/ukl/linux/log/?h=bus-make-remove-void There are already a few patches for that quest in mainline[1]. Other than that nothing special. Best regards Uwe [1] git log --oneline --author=Kleine-König --grep=void v5.10.. -- Pengutronix e.K. | Uwe Kleine-König | Industrial Linux Solutions | https://www.pengutronix.de/ | [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 488 bytes --] ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2021-05-06 9:42 UTC | newest] Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed) -- links below jump to the message on this page -- 2021-05-05 20:37 [PATCH] intel_th: Remove an unused exit point from intel_th_remove() Uwe Kleine-König 2021-05-06 9:20 ` Alexander Shishkin 2021-05-06 9:42 ` Uwe Kleine-König
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).