Skip to contentSkip to conversation

Staging: fsm-mc: bus: remove unused function modalias_show

PATCH In review Bhumika Goyal 2 participants 7 messages Oct 7, 2016 Staging

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Staging: fsm-mc: bus: remove unused function modalias_show

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 	return 0;
 }
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-			     char *buf)
-{
-	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-	return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-		       mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);
 
 static struct attribute *fsl_mc_dev_attrs[] = {
Signature · 1 line
1.9.1
maintainer
#1 lore raw
Quoted 36 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
 	return 0;
 }

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 10 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-			     char *buf)
-{
-	struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-	return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-		       mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

confused,

greg k-h

#2 lore raw
Quoted 35 lines · Greg KH
Quoted 34 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
Quoted 16 lines

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 12 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
      return 0;
 }
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-     struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-     return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-                    mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

Yes, it did build successfully. I am confused that why didn't the build complain then ?

Thanks for the input.

Thanks,
Bhumika

Quoted 3 lines

confused,

greg k-h

maintainer
#3 lore raw
Quoted 52 lines · Bhumika Goyal
Quoted 35 lines · Greg KH
Quoted 34 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
Quoted 16 lines

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 12 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
      return 0;
 }
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-     struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-     return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-                    mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

Quoted 2 lines

Yes, it did build successfully. I am confused that why didn't the build complain then ?

Are you sure you built this file? It's only usually built for an ARM system...

thanks,

greg k-h

#4 lore raw
Quoted 53 lines · Greg KH
Quoted 52 lines · Bhumika Goyal
Quoted 51 lines · Greg KH
Quoted 36 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
      return 0;
 }

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 10 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-     struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-     return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-                    mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

Quoted 6 lines
Quoted 2 lines

Yes, it did build successfully. I am confused that why didn't the build complain then ?

Are you sure you built this file? It's only usually built for an ARM system...

My system's architecture is x86_64. And yes, it did build successfully. I did : make drivers/staging/fsl-mc/

Thanks,
Bhumika

Quoted 3 lines

thanks,

greg k-h

maintainer
#5 lore raw
Quoted 54 lines · Bhumika Goyal
Quoted 53 lines · Greg KH
Quoted 52 lines · Bhumika Goyal
Quoted 51 lines · Greg KH
Quoted 36 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
      return 0;
 }

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 10 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-     struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-     return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-                    mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

Quoted 8 lines
Quoted 6 lines
Quoted 2 lines

Yes, it did build successfully. I am confused that why didn't the build complain then ?

Are you sure you built this file? It's only usually built for an ARM system...

My system's architecture is x86_64. And yes, it did build successfully. I did : make drivers/staging/fsl-mc/

And did a .o file get built from the .c file you modified?

Just because you tell the build system to build a subdir, doesn't mean it builds all of the files in it.

thanks,

greg k-h

#6 lore raw
Quoted 61 lines · Greg KH
Quoted 60 lines · Bhumika Goyal
Quoted 59 lines · Greg KH
Quoted 52 lines · Bhumika Goyal
Quoted 35 lines · Greg KH
Quoted 34 lines · Bhumika Goyal

The function modalias_show is not used anywhere in the kernel, so remove it. Done using Coccinelle:

@r1@
identifier func;
type T;
@@
static T func(...)
{
...
}

@r@
identifier r1.func;
@@
func

@delete depends on !r@
identifier r1.func;
type r1.T;
@@
- static T func(...){...}

---
 drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
 1 file changed, 9 deletions(-)
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -0
index 44f64b6..e8bca6e 100644
@@ -121,15 +121,6 @@ static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env)
 
Quoted 16 lines

drivers/staging/fsl-mc/bus/fsl-mc-bus.c static int fsl_mc_bus_uevent(struct device *dev, struct kobj_uevent_env *env) · line 124

Quoted 12 lines
drivers/staging/fsl-mc/bus/fsl-mc-bus.c +0 -9
      return 0;
 }
-
-static ssize_t modalias_show(struct device *dev, struct device_attribute *attr,
-                          char *buf)
-{
-     struct fsl_mc_device *mc_dev = to_fsl_mc_device(dev);
-
-     return sprintf(buf, "fsl-mc:v%08Xd%s\n", mc_dev->obj_desc.vendor,
-                    mc_dev->obj_desc.type);
-}
 static DEVICE_ATTR_RO(modalias);

Um, it's used right there in the line you didn't delete. Did you build this code successfully with this change?

Quoted 2 lines

Yes, it did build successfully. I am confused that why didn't the build complain then ?

Are you sure you built this file? It's only usually built for an ARM system...

Quoted 8 lines
Quoted 2 lines

My system's architecture is x86_64. And yes, it did build successfully. I did : make drivers/staging/fsl-mc/

And did a .o file get built from the .c file you modified?

Just because you tell the build system to build a subdir, doesn't mean it builds all of the files in it.

Understood.
My bad, I will be more careful from next time. Thanks for the input.

Thanks,
Bhumika

Quoted 3 lines

thanks,

greg k-h