public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org
Subject: [RFC] Some driver core and kobject minor patches
Date: Thu, 13 Sep 2007 16:37:51 -0700	[thread overview]
Message-ID: <20070913233751.GA10856@kroah.com> (raw)

Kay pointed out to me the other day that we are dragging around 20 bytes
in every struct kobject and in every struct device to contain a name
string that can be dynamically allocated instead.  For small device
names (the majority), this savings can add up, especially with a lot of
individual devices.

So, I started out by getting rid of the static array in the kobject
structure, as we already were dynamically allocating space if it was
needed.

Of course, this required a number of other minor cleanups through the
code tree to handle places where we were incorrectly directly accessing
the kobject name instead of using the "proper" function.  I also got
sidetracked by a few driver core and kobject.h cleanups of macros that
are no longer needed, or functions that no longer need to be global
(they were never exported, so we don't have to worry about that mess...)

And I added a change to trigger a warning if we add an attribute to
sysfs that we have already had created, to help the SCSI developers out
with their driver model reworks.

So, here's a series of 11 patches that I've added to my tree, and will
send to Linus when 2.6.24 is opened up.

Any review comments are appreciated.  The full diffstat is below showing
that overall, we did get rid of more code than was added.

thanks,

greg k-h

 block/bsg.c                         |    5 --
 block/elevator.c                    |    2 
 block/ll_rw_blk.c                   |    2 
 drivers/acpi/bus.c                  |    2 
 drivers/base/base.h                 |    2 
 drivers/base/bus.c                  |   60 ++++++++++++++--------------
 drivers/base/class.c                |    6 +-
 drivers/base/sys.c                  |    2 
 drivers/char/raw.c                  |    5 --
 drivers/cpufreq/cpufreq.c           |    2 
 drivers/edac/edac_mc_sysfs.c        |    3 -
 drivers/md/md.c                     |    3 -
 drivers/media/dvb/dvb-core/dvbdev.c |    5 --
 drivers/usb/core/devio.c            |    6 --
 fs/dlm/lockspace.c                  |    2 
 fs/gfs2/locking/dlm/sysfs.c         |    2 
 fs/gfs2/sys.c                       |    2 
 fs/ocfs2/cluster/masklog.c          |    3 -
 fs/partitions/check.c               |   12 +++--
 fs/sysfs/dir.c                      |    6 ++
 include/linux/kobject.h             |   46 +---------------------
 lib/kobject.c                       |   75 ++++++++++++++++--------------------
 net/bridge/br_sysfs_br.c            |    2 
 23 files changed, 102 insertions(+), 153 deletions(-)


             reply	other threads:[~2007-09-13 23:45 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-09-13 23:37 Greg KH [this message]
2007-09-13 23:38 ` Driver core: remove get_bus() Greg KH
2007-09-14 11:02   ` Cornelia Huck
2007-09-14 11:27     ` Greg KH
2007-09-13 23:39 ` Driver core: remove kset_set_kset_s Greg KH
2007-09-13 23:39 ` Driver core: remove put_bus() Greg KH
2007-09-14 11:03   ` Cornelia Huck
2007-09-13 23:40 ` Driver core: remove subsys_get() Greg KH
2007-09-13 23:40 ` Driver core: remove subsys_put() Greg KH
2007-09-13 23:40 ` Driver core: remove subsys_set_kset Greg KH
2007-09-13 23:41 ` sysfs: spit a warning to users when they try to create a duplicate sysfs file Greg KH
2007-09-14 12:06   ` Cornelia Huck
2007-09-16 20:39     ` Greg KH
2007-09-15 12:44   ` Stefan Richter
2007-09-13 23:42 ` Drivers: clean up direct setting of the name of a kset Greg KH
2007-09-13 23:42 ` [RFC] Some driver core and kobject minor patches Greg KH
2007-09-13 23:43 ` cdev: remove unneeded setting of cdev names Greg KH
2007-09-13 23:43 ` kobjects: fix up improper use of the kobject name field Greg KH
2007-09-13 23:44 ` kobject: remove the static array for the name Greg KH
2007-09-14 11:25 ` [RFC] Some driver core and kobject minor patches Cornelia Huck

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=20070913233751.GA10856@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    /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