[v1] net/iucv: Remove redundant driver match function

Message ID 20230319050840.377727-1-sensor1010@163.com
State New
Headers
Series [v1] net/iucv: Remove redundant driver match function |

Commit Message

Lizhe March 19, 2023, 5:08 a.m. UTC
  If there is no driver match function, the driver core assumes that each
candidate pair (driver, device) matches, see driver_match_device().

Drop the bus's match function that always returned 1 and so
implements the same behaviour as when there is no match function

Signed-off-by: Lizhe <sensor1010@163.com>
---
 net/iucv/iucv.c | 6 ------
 1 file changed, 6 deletions(-)
  

Comments

Heiko Carstens March 19, 2023, 8:16 p.m. UTC | #1
On Sun, Mar 19, 2023 at 01:08:40PM +0800, Lizhe wrote:
> If there is no driver match function, the driver core assumes that each
> candidate pair (driver, device) matches, see driver_match_device().
> 
> Drop the bus's match function that always returned 1 and so
> implements the same behaviour as when there is no match function
...
> 
> Signed-off-by: Lizhe <sensor1010@163.com>
> ---
>  net/iucv/iucv.c | 6 ------
>  1 file changed, 6 deletions(-)
...
> -static int iucv_bus_match(struct device *dev, struct device_driver *drv)
> -{
> -	return 0;
        ^^^^^^^^

If I'm not wrong then 0 != 1.
  
Alex Williamson March 20, 2023, 4:20 p.m. UTC | #2
On Sun, 19 Mar 2023 21:16:31 +0100
Heiko Carstens <hca@linux.ibm.com> wrote:

> On Sun, Mar 19, 2023 at 01:08:40PM +0800, Lizhe wrote:
> > If there is no driver match function, the driver core assumes that each
> > candidate pair (driver, device) matches, see driver_match_device().
> > 
> > Drop the bus's match function that always returned 1 and so
> > implements the same behaviour as when there is no match function  
> ...
> > 
> > Signed-off-by: Lizhe <sensor1010@163.com>
> > ---
> >  net/iucv/iucv.c | 6 ------
> >  1 file changed, 6 deletions(-)  
> ...
> > -static int iucv_bus_match(struct device *dev, struct device_driver *drv)
> > -{
> > -	return 0;  
>         ^^^^^^^^
> 
> If I'm not wrong then 0 != 1.
> 

Seems like an unchecked patch bot, proposed an identical bad patch for
vfio/mdev.  Thanks,

Alex
  

Patch

diff --git a/net/iucv/iucv.c b/net/iucv/iucv.c
index fc3fddeb6f36..7dd15dead88e 100644
--- a/net/iucv/iucv.c
+++ b/net/iucv/iucv.c
@@ -62,14 +62,8 @@ 
 #define IUCV_IPNORPY	0x10
 #define IUCV_IPALL	0x80
 
-static int iucv_bus_match(struct device *dev, struct device_driver *drv)
-{
-	return 0;
-}
-
 struct bus_type iucv_bus = {
 	.name = "iucv",
-	.match = iucv_bus_match,
 };
 EXPORT_SYMBOL(iucv_bus);