public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Mingming cao <cmm@us.ibm.com>
To: davej@suse.de, linux-kernel <linux-kernel@vger.kernel.org>
Subject: [PATCH]Size of raw_devices[]
Date: Fri, 08 Feb 2002 15:28:41 -0800	[thread overview]
Message-ID: <3C645F29.A11E5693@us.ibm.com> (raw)

[-- Attachment #1: Type: text/plain, Size: 347 bytes --]

Hi, 

While I was looking at the static arrays in the drivers, I found global
array raw_devices[] used for describing raw device infos is hard sized
by 256.  To better prepare for more minor bits in the future,  this
small patch is made to using MINORMASK to size raw_devices[] instead of
hardcoding.  Please consider it in 2.5.


-- 
Mingming Cao

[-- Attachment #2: raw.patch --]
[-- Type: text/plain, Size: 654 bytes --]

diff -urN -X dontdiff /usr/src/linux-2.5.3/drivers/char/raw.c 253.raw/drivers/char/raw.c
--- /usr/src/linux-2.5.3/drivers/char/raw.c	Tue Jan  1 11:40:34 2002
+++ 253.raw/drivers/char/raw.c	Fri Feb  8 14:17:03 2002
@@ -25,7 +25,7 @@
 	struct semaphore mutex;
 } raw_device_data_t;
 
-static raw_device_data_t raw_devices[256];
+static raw_device_data_t raw_devices[MINORMASK+1];
 
 static ssize_t rw_raw_dev(int rw, struct file *, char *, size_t, loff_t *);
 
@@ -53,7 +53,7 @@
 	int i;
 	register_chrdev(RAW_MAJOR, "raw", &raw_fops);
 
-	for (i = 0; i < 256; i++)
+	for (i = 0; i < MINORMASK+1; i++)
 		init_MUTEX(&raw_devices[i].mutex);
 
 	return 0;



                 reply	other threads:[~2002-02-08 23:35 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=3C645F29.A11E5693@us.ibm.com \
    --to=cmm@us.ibm.com \
    --cc=davej@suse.de \
    --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