All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <gregkh@linuxfoundation.org>
To: Bhumika Goyal <bhumirks@gmail.com>
Cc: outreachy-kernel@googlegroups.com, German.Rivera@freescale.com,
	stuart.yoder@nxp.com
Subject: Re: [Outreachy kernel] Re: [PATCH] Staging: fsm-mc: bus: remove unused function modalias_show
Date: Fri, 7 Oct 2016 17:06:14 +0200	[thread overview]
Message-ID: <20161007150614.GA23300@kroah.com> (raw)
In-Reply-To: <CAOH+1jENdbwVwe=h+TXa7_ON+QDvL3uX4M_+t-jhX=b95CnYig@mail.gmail.com>

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


  reply	other threads:[~2016-10-07 15:06 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
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 [this message]
2016-10-07 16:35           ` Bhumika Goyal

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20161007150614.GA23300@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=German.Rivera@freescale.com \
    --cc=bhumirks@gmail.com \
    --cc=outreachy-kernel@googlegroups.com \
    --cc=stuart.yoder@nxp.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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.