* [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
@ 2016-10-07 14:26 Bhumika Goyal
2016-10-07 14:32 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Bhumika Goyal @ 2016-10-07 14:26 UTC (permalink / raw)
To: outreachy-kernel, gregkh, German.Rivera, stuart.yoder; +Cc: 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(...){...}
Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
---
drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
1 file changed, 9 deletions(-)
diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
index 44f64b6..e8bca6e 100644
--- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
+++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
@@ -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[] = {
--
1.9.1
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 14:26 [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show Bhumika Goyal
@ 2016-10-07 14:32 ` Greg KH
2016-10-07 14:37 ` Bhumika Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2016-10-07 14:32 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
> 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(...){...}
>
> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> ---
> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
> 1 file changed, 9 deletions(-)
>
> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> index 44f64b6..e8bca6e 100644
> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> @@ -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);
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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 14:32 ` Greg KH
@ 2016-10-07 14:37 ` Bhumika Goyal
2016-10-07 14:54 ` [Outreachy kernel] " Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Bhumika Goyal @ 2016-10-07 14:37 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 7, 2016 at 8:02 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
>> 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(...){...}
>>
>> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>> ---
>> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
>> 1 file changed, 9 deletions(-)
>>
>> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> index 44f64b6..e8bca6e 100644
>> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> @@ -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);
>
> 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
> confused,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 14:37 ` Bhumika Goyal
@ 2016-10-07 14:54 ` Greg KH
2016-10-07 15:00 ` Bhumika Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2016-10-07 14:54 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 07, 2016 at 08:07:24PM +0530, Bhumika Goyal wrote:
> On Fri, Oct 7, 2016 at 8:02 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
> >> 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(...){...}
> >>
> >> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> >> ---
> >> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
> >> 1 file changed, 9 deletions(-)
> >>
> >> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> index 44f64b6..e8bca6e 100644
> >> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> @@ -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);
> >
> > 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 ?
Are you sure you built this file? It's only usually built for an ARM
system...
thanks,
greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 14:54 ` [Outreachy kernel] " Greg KH
@ 2016-10-07 15:00 ` Bhumika Goyal
2016-10-07 15:06 ` Greg KH
0 siblings, 1 reply; 7+ messages in thread
From: Bhumika Goyal @ 2016-10-07 15:00 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 7, 2016 at 8:24 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Oct 07, 2016 at 08:07:24PM +0530, Bhumika Goyal wrote:
>> On Fri, Oct 7, 2016 at 8:02 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
>> >> 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(...){...}
>> >>
>> >> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>> >> ---
>> >> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
>> >> 1 file changed, 9 deletions(-)
>> >>
>> >> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> index 44f64b6..e8bca6e 100644
>> >> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> @@ -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);
>> >
>> > 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 ?
>
> 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
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 15:00 ` Bhumika Goyal
@ 2016-10-07 15:06 ` Greg KH
2016-10-07 16:35 ` Bhumika Goyal
0 siblings, 1 reply; 7+ messages in thread
From: Greg KH @ 2016-10-07 15:06 UTC (permalink / raw)
To: Bhumika Goyal; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 07, 2016 at 08:30:11PM +0530, Bhumika Goyal wrote:
> On Fri, Oct 7, 2016 at 8:24 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> > On Fri, Oct 07, 2016 at 08:07:24PM +0530, Bhumika Goyal wrote:
> >> On Fri, Oct 7, 2016 at 8:02 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> >> > On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
> >> >> 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(...){...}
> >> >>
> >> >> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
> >> >> ---
> >> >> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
> >> >> 1 file changed, 9 deletions(-)
> >> >>
> >> >> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> >> index 44f64b6..e8bca6e 100644
> >> >> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> >> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
> >> >> @@ -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);
> >> >
> >> > 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 ?
> >
> > 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
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [Outreachy kernel] Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
2016-10-07 15:06 ` Greg KH
@ 2016-10-07 16:35 ` Bhumika Goyal
0 siblings, 0 replies; 7+ messages in thread
From: Bhumika Goyal @ 2016-10-07 16:35 UTC (permalink / raw)
To: Greg KH; +Cc: outreachy-kernel, German.Rivera, stuart.yoder
On Fri, Oct 7, 2016 at 8:36 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
> On Fri, Oct 07, 2016 at 08:30:11PM +0530, Bhumika Goyal wrote:
>> On Fri, Oct 7, 2016 at 8:24 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> > On Fri, Oct 07, 2016 at 08:07:24PM +0530, Bhumika Goyal wrote:
>> >> On Fri, Oct 7, 2016 at 8:02 PM, Greg KH <gregkh@linuxfoundation.org> wrote:
>> >> > On Fri, Oct 07, 2016 at 07:56:51PM +0530, Bhumika Goyal wrote:
>> >> >> 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(...){...}
>> >> >>
>> >> >> Signed-off-by: Bhumika Goyal <bhumirks@gmail.com>
>> >> >> ---
>> >> >> drivers/staging/fsl-mc/bus/fsl-mc-bus.c | 9 ---------
>> >> >> 1 file changed, 9 deletions(-)
>> >> >>
>> >> >> diff --git a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> >> index 44f64b6..e8bca6e 100644
>> >> >> --- a/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> >> +++ b/drivers/staging/fsl-mc/bus/fsl-mc-bus.c
>> >> >> @@ -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);
>> >> >
>> >> > 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 ?
>> >
>> > 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.
>
Understood.
My bad, I will be more careful from next time. Thanks for the input.
Thanks,
Bhumika
> thanks,
>
> greg k-h
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2016-10-07 16:35 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-10-07 14:26 [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show Bhumika Goyal
2016-10-07 14:32 ` Greg KH
2016-10-07 14:37 ` Bhumika Goyal
2016-10-07 14:54 ` [Outreachy kernel] " Greg KH
2016-10-07 15:00 ` Bhumika Goyal
2016-10-07 15:06 ` Greg KH
2016-10-07 16:35 ` Bhumika Goyal
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.