2021-07-06 15:54:21

by Uwe Kleine-König

[permalink] [raw]
Subject: [PATCH v2 2/4] s390/ccwgroup: Drop if with an always false condition

The driver core only calls a bus remove callback when there is a driver.
So dev->driver is never NULL and the check can safely be removed.

Signed-off-by: Uwe Kleine-König <[email protected]>
---
drivers/s390/cio/ccwgroup.c | 2 --
1 file changed, 2 deletions(-)

diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
index 9748165e08e9..a6aeab1ea0ae 100644
--- a/drivers/s390/cio/ccwgroup.c
+++ b/drivers/s390/cio/ccwgroup.c
@@ -444,8 +444,6 @@ static int ccwgroup_remove(struct device *dev)
struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
struct ccwgroup_driver *gdrv = to_ccwgroupdrv(dev->driver);

- if (!dev->driver)
- return 0;
if (gdrv->remove)
gdrv->remove(gdev);

--
2.30.2


2021-07-06 16:05:46

by Cornelia Huck

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] s390/ccwgroup: Drop if with an always false condition

On Tue, Jul 06 2021, Uwe Kleine-König <[email protected]> wrote:

> The driver core only calls a bus remove callback when there is a driver.
> So dev->driver is never NULL and the check can safely be removed.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> ---
> drivers/s390/cio/ccwgroup.c | 2 --
> 1 file changed, 2 deletions(-)

Reviewed-by: Cornelia Huck <[email protected]>

2021-07-07 11:17:07

by Vineeth Vijayan

[permalink] [raw]
Subject: Re: [PATCH v2 2/4] s390/ccwgroup: Drop if with an always false condition

Thank you. Looks good to me.
Heiko/Vasily will pick this up and will be part of the next s390-tree
patchset.

Also,

Acked-by: Vineeth Vijayan <[email protected]>


On 7/6/21 5:48 PM, Uwe Kleine-König wrote:
> The driver core only calls a bus remove callback when there is a driver.
> So dev->driver is never NULL and the check can safely be removed.
>
> Signed-off-by: Uwe Kleine-König <[email protected]>
> ---
> drivers/s390/cio/ccwgroup.c | 2 --
> 1 file changed, 2 deletions(-)
>
> diff --git a/drivers/s390/cio/ccwgroup.c b/drivers/s390/cio/ccwgroup.c
> index 9748165e08e9..a6aeab1ea0ae 100644
> --- a/drivers/s390/cio/ccwgroup.c
> +++ b/drivers/s390/cio/ccwgroup.c
> @@ -444,8 +444,6 @@ static int ccwgroup_remove(struct device *dev)
> struct ccwgroup_device *gdev = to_ccwgroupdev(dev);
> struct ccwgroup_driver *gdrv = to_ccwgroupdrv(dev->driver);
>
> - if (!dev->driver)
> - return 0;
> if (gdrv->remove)
> gdrv->remove(gdev);
>