From: Christoph Hellwig <hch@lst.de>
To: Jens Axboe <jens.axboe@oracle.com>
Cc: linux-kernel@vger.kernel.org
Subject: [PATCH] hd: stop defining MAJOR_NR
Date: Tue, 16 Jun 2009 21:17:50 +0200 [thread overview]
Message-ID: <20090616191750.GA22726@lst.de> (raw)
Just use HD_MAJOR directly.
Signed-off-by: Christoph Hellwig <hch@lst.de>
Index: linux-2.6/drivers/block/hd.c
===================================================================
--- linux-2.6.orig/drivers/block/hd.c 2009-06-11 20:54:27.184814475 +0200
+++ linux-2.6/drivers/block/hd.c 2009-06-16 21:16:19.716938868 +0200
@@ -100,8 +100,6 @@ static DEFINE_SPINLOCK(hd_lock);
static struct request_queue *hd_queue;
static struct request *hd_req;
-#define MAJOR_NR HD_MAJOR
-
#define TIMEOUT_VALUE (6*HZ)
#define HD_DELAY 0
@@ -712,12 +710,12 @@ static int __init hd_init(void)
{
int drive;
- if (register_blkdev(MAJOR_NR, "hd"))
+ if (register_blkdev(HD_MAJOR, "hd"))
return -1;
hd_queue = blk_init_queue(do_hd_request, &hd_lock);
if (!hd_queue) {
- unregister_blkdev(MAJOR_NR, "hd");
+ unregister_blkdev(HD_MAJOR, "hd");
return -ENOMEM;
}
@@ -751,7 +749,7 @@ static int __init hd_init(void)
struct hd_i_struct *p = &hd_info[drive];
if (!disk)
goto Enomem;
- disk->major = MAJOR_NR;
+ disk->major = HD_MAJOR;
disk->first_minor = drive << 6;
disk->fops = &hd_fops;
sprintf(disk->disk_name, "hd%c", 'a'+drive);
@@ -795,7 +793,7 @@ out1:
NR_HD = 0;
out:
del_timer(&device_timer);
- unregister_blkdev(MAJOR_NR, "hd");
+ unregister_blkdev(HD_MAJOR, "hd");
blk_cleanup_queue(hd_queue);
return -1;
Enomem:
next reply other threads:[~2009-06-16 19:18 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2009-06-16 19:17 Christoph Hellwig [this message]
2009-06-16 20:13 ` [PATCH] hd: stop defining MAJOR_NR Jens Axboe
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=20090616191750.GA22726@lst.de \
--to=hch@lst.de \
--cc=jens.axboe@oracle.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