From: viro@parcelfarce.linux.theplanet.co.uk
To: Andries.Brouwer@cwi.nl
Cc: aebr@win.tue.nl, linux-kernel@vger.kernel.org, torvalds@transmeta.com
Subject: Re: [CFT] more kdev_t-ectomy
Date: Sun, 20 Apr 2003 22:26:07 +0100 [thread overview]
Message-ID: <20030420212607.GJ10374@parcelfarce.linux.theplanet.co.uk> (raw)
In-Reply-To: <UTC200304202117.h3KLHH217162.aeb@smtp.cwi.nl>
On Sun, Apr 20, 2003 at 11:17:17PM +0200, Andries.Brouwer@cwi.nl wrote:
> Given a number, one can copy it around freely, without the need
> to obtain a reference each time one copies it.
> Many of these numbers are just copied around and never used.
> In such a case, refcounting is a real waste of time.
Excuse me, but "copied around and never used" is by definition a real
waste of time. And proper fix is neither "keep it" nor "replace with
pointer". It's "kill it".
> By now all uses of mk_kdev()/major()/minor()/MAJOR()/MINOR() in the drivers
> are either trivially removable or represent very real problems. And it's
> not that there was a lot of them - in my current tree there's ~85 instances
> of kdev_t in the source. And only one of them (->i_rdev) is widely used -
> ~500 instances, most of them go away as soon as CIDR patch gets merged.
> The rest is part noise, part real bugs that need to be fixed anyway
> (~40--80 of those).
>
> Yes, I tend to agree. Funny that you do not mention MKDEV - that was
> the thing I worked on eliminating long ago.
No, I do not mention it. And for a good reason. It's the only constructor
for constant values of dev_t. You could keep every such value in two
fields, but then you get all their uses go in pairs and starting with
MKDEV(). Or have lookup code play with MAJOR()/MINOR() for no good
reason whatsoever.
MKDEV(<constant>,<constant>) is a valid thing, as far as I'm concerned.
next prev parent reply other threads:[~2003-04-20 21:14 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2003-04-20 21:17 Andries.Brouwer
2003-04-20 21:26 ` viro [this message]
-- strict thread matches above, loose matches on Subject: below --
2003-04-21 1:32 Andries.Brouwer
2003-04-21 3:54 ` H. Peter Anvin
2003-04-20 23:56 Andries.Brouwer
2003-04-21 0:15 ` H. Peter Anvin
2003-04-21 0:35 ` viro
2003-04-20 21:58 Andries.Brouwer
2003-04-20 22:35 ` viro
2003-04-20 13:31 viro
2003-04-20 15:26 ` Muli Ben-Yehuda
2003-04-20 16:00 ` Andries Brouwer
2003-04-20 19:24 ` viro
2003-04-20 21:10 ` H. Peter Anvin
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=20030420212607.GJ10374@parcelfarce.linux.theplanet.co.uk \
--to=viro@parcelfarce.linux.theplanet.co.uk \
--cc=Andries.Brouwer@cwi.nl \
--cc=aebr@win.tue.nl \
--cc=linux-kernel@vger.kernel.org \
--cc=torvalds@transmeta.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®