From: Wei Yang <weiyang@linux.vnet.ibm.com>
To: Greg KH <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, joe@perches.com,
shangw@linux.vnet.ibm.com, linuxram@us.ibm.com
Subject: Re: [PATCH 1/2] driver core: remove device_add_attrs() in drivers/base/bus.c
Date: Tue, 19 Mar 2013 10:08:11 +0800 [thread overview]
Message-ID: <20130319020811.GA10936@weiyang.vnet.ibm.com> (raw)
In-Reply-To: <20130319001822.GC13502@kroah.com>
On Mon, Mar 18, 2013 at 05:18:22PM -0700, Greg KH wrote:
>On Thu, Mar 07, 2013 at 10:22:45AM +0800, Wei Yang wrote:
>> Originally, we have two functions named device_add_attrs() in
>> drivers/base/bus.c and drivers/base/core.c. This will cause some confusion
>> when reading the code.
>
>Why? It's just static functions.
Hmm, yes, they are static functions.
The confusion comes from myself. When I look for the definitions of the
function in cscope, it pop out two line with the same name. So I just think
whether we can help the reader, if there is only one pop up.
Well, I have to admit this is my personal feeling and due to my lack of
experence.
>
>> And the one in drivers/base/bus.c do the same action as device_add_attributes()
>> in drivers/base/core.c. That would be better to reuse this code.
>
>Possibly, yes, but you put the .h entry in the wrong place, thereby
>exposing a previously static function to the entire kernel, which is not
Agree, this is not a good idea to expose an extra interface to the entire
kernel.
>good at all. Why did you do that? Are you now going to want to call
>that function from some driver?
The reason for this patch is, the logic in these two functions are the same.
My purpose is to reuse the code and save some space for the kernel image,
well, I have to admit it is just a very small piece of space.
>
>greg k-h
--
Richard Yang
Help you, Help me
next prev parent reply other threads:[~2013-03-19 2:08 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-03-07 2:22 [PATCH 0/2] Some cleanup in driver core Wei Yang
2013-03-07 2:22 ` [PATCH 1/2] driver core: remove device_add_attrs() in drivers/base/bus.c Wei Yang
2013-03-19 0:18 ` Greg KH
2013-03-19 2:08 ` Wei Yang [this message]
2013-03-07 2:22 ` [PATCH 2/2] driver-core: remove the duplicate assignment of kobj->parent in device_add Wei Yang
2013-03-07 11:33 ` Bjørn Mork
[not found] ` <20130307135032.GA6100@richard.(null)>
2013-03-07 14:49 ` Bjørn Mork
2013-03-19 0:17 ` [PATCH 0/2] Some cleanup in driver core Greg KH
2013-03-19 2:11 ` Wei Yang
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=20130319020811.GA10936@weiyang.vnet.ibm.com \
--to=weiyang@linux.vnet.ibm.com \
--cc=gregkh@linuxfoundation.org \
--cc=joe@perches.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxram@us.ibm.com \
--cc=shangw@linux.vnet.ibm.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®