All of lore.kernel.org
 help / color / mirror / Atom feed
From: Brendan Burns <bburns@genet.cs.umass.edu>
To: linux-kernel@vger.kernel.org
Subject: MINOR(inode->i_rdev) vs. minor(inode->i_rdev)
Date: 09 Jan 2002 14:20:23 -0500	[thread overview]
Message-ID: <1010604024.2904.0.camel@epiphany> (raw)

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

Hello,
In the process of compiling ALSA for my new 2.5.2pre10 kernel I noticed
that MINOR(inode->i_rdev) causes compile errors and should be replaced
with minor(inode->i_rdev) Looking at a number of the OSS sound drivers
in the kernel I noticed that they to would not compile in 2.5.2pre10 (eg
Turtle Beach Pinnacle)  I fixed all of these modules and a patch is
attached.  However, looking further I noticed that there were similar
problems in a number of other drivers.  Before I undertook cleaning all
of them I thought I would check in and make sure I was doing the right
thing.  Namely that every instance of MINOR(inode->i_rdev) or
MINOR(i_rdev) should be replaced with minor(inode->i_rdev) or
minor(i_rdev).

Please CC me on any replies since I am not subscribed to the list.
Thanks,
Brendan




[-- Attachment #2: sound-patch --]
[-- Type: text/x-patch, Size: 9180 bytes --]

diff -uNr linux/drivers/sound/btaudio.c linux.new/drivers/sound/btaudio.c
--- linux/drivers/sound/btaudio.c	Wed Oct 17 17:19:20 2001
+++ linux.new/drivers/sound/btaudio.c	Wed Jan  9 13:57:09 2002
@@ -300,7 +300,7 @@
 
 static int btaudio_mixer_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
@@ -459,7 +459,7 @@
 
 static int btaudio_dsp_open_digital(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
@@ -475,7 +475,7 @@
 
 static int btaudio_dsp_open_analog(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct btaudio *bta;
 
 	for (bta = btaudios; bta != NULL; bta = bta->next)
diff -uNr linux/drivers/sound/cmpci.c linux.new/drivers/sound/cmpci.c
--- linux/drivers/sound/cmpci.c	Sun Nov 25 13:17:47 2001
+++ linux.new/drivers/sound/cmpci.c	Wed Jan  9 13:54:59 2002
@@ -1440,7 +1440,7 @@
 
 static int cm_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 
 	while (s && s->dev_mixer != minor)
@@ -2190,7 +2190,7 @@
 
 static int cm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 	unsigned char fmtm = ~0, fmts = 0;
 
@@ -2445,7 +2445,7 @@
 
 static int cm_midi_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 	unsigned long flags;
 
@@ -2662,7 +2662,7 @@
 
 static int cm_dmfm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct cm_state *s = devs;
 
 	while (s && s->dev_dmfm != minor)
diff -uNr linux/drivers/sound/ite8172.c linux.new/drivers/sound/ite8172.c
--- linux/drivers/sound/ite8172.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/ite8172.c	Wed Jan  9 13:57:22 2002
@@ -832,7 +832,7 @@
 
 static int it8172_open_mixdev(struct inode *inode, struct file *file)
 {
-    int minor = MINOR(inode->i_rdev);
+    int minor = minor(inode->i_rdev);
     struct list_head *list;
     struct it8172_state *s;
 
@@ -1543,7 +1543,7 @@
 
 static int it8172_open(struct inode *inode, struct file *file)
 {
-    int minor = MINOR(inode->i_rdev);
+    int minor = minor(inode->i_rdev);
     DECLARE_WAITQUEUE(wait, current);
     unsigned long flags;
     struct list_head *list;
diff -uNr linux/drivers/sound/msnd_pinnacle.c linux.new/drivers/sound/msnd_pinnacle.c
--- linux/drivers/sound/msnd_pinnacle.c	Sun Sep 30 15:26:08 2001
+++ linux.new/drivers/sound/msnd_pinnacle.c	Wed Jan  9 13:54:12 2002
@@ -641,7 +641,7 @@
 
 static int dev_ioctl(struct inode *inode, struct file *file, unsigned int cmd, unsigned long arg)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 
 	if (cmd == OSS_GETVERSION) {
 		int sound_version = SOUND_VERSION;
@@ -753,7 +753,7 @@
 
 static int dev_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	int err = 0;
 
 	if (minor == dev.dsp_minor) {
@@ -788,7 +788,7 @@
 
 static int dev_release(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	int err = 0;
 
 	lock_kernel();
@@ -978,7 +978,7 @@
 
 static ssize_t dev_read(struct file *file, char *buf, size_t count, loff_t *off)
 {
-	int minor = MINOR(file->f_dentry->d_inode->i_rdev);
+	int minor = minor(file->f_dentry->d_inode->i_rdev);
 	if (minor == dev.dsp_minor)
 		return dsp_read(buf, count);
 	else
@@ -987,7 +987,7 @@
 
 static ssize_t dev_write(struct file *file, const char *buf, size_t count, loff_t *off)
 {
-	int minor = MINOR(file->f_dentry->d_inode->i_rdev);
+	int minor = minor(file->f_dentry->d_inode->i_rdev);
 	if (minor == dev.dsp_minor)
 		return dsp_write(buf, count);
 	else
diff -uNr linux/drivers/sound/nec_vrc5477.c linux.new/drivers/sound/nec_vrc5477.c
--- linux/drivers/sound/nec_vrc5477.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/nec_vrc5477.c	Wed Jan  9 13:57:32 2002
@@ -813,7 +813,7 @@
 
 static int vrc5477_ac97_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	struct vrc5477_ac97_state *s;
 
@@ -1529,7 +1529,7 @@
 
 static int vrc5477_ac97_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
 	struct list_head *list;
diff -uNr linux/drivers/sound/rme96xx.c linux.new/drivers/sound/rme96xx.c
--- linux/drivers/sound/rme96xx.c	Thu Oct 25 16:53:52 2001
+++ linux.new/drivers/sound/rme96xx.c	Wed Jan  9 13:56:13 2002
@@ -1162,7 +1162,7 @@
 
 static int rme96xx_open(struct inode *in, struct file *f)
 {
-	int minor = MINOR(in->i_rdev);
+	int minor = minor(in->i_rdev);
 	struct list_head *list;
 	int devnum = ((minor-3)/16) % devices; /* default = 0 */
 	rme96xx_info *s;
@@ -1490,7 +1490,7 @@
 
 static int rme96xx_mixer_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	rme96xx_info *s;
 
diff -uNr linux/drivers/sound/sonicvibes.c linux.new/drivers/sound/sonicvibes.c
--- linux/drivers/sound/sonicvibes.c	Sun Sep 30 15:26:08 2001
+++ linux.new/drivers/sound/sonicvibes.c	Wed Jan  9 13:54:36 2002
@@ -1235,7 +1235,7 @@
 
 static int sv_open_mixdev(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct list_head *list;
 	struct sv_state *s;
 
@@ -1893,7 +1893,7 @@
 
 static int sv_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned char fmtm = ~0, fmts = 0;
 	struct list_head *list;
@@ -2142,7 +2142,7 @@
 
 static int sv_midi_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	unsigned long flags;
 	struct list_head *list;
@@ -2364,7 +2364,7 @@
 
 static int sv_dmfm_open(struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	DECLARE_WAITQUEUE(wait, current);
 	struct list_head *list;
 	struct sv_state *s;
diff -uNr linux/drivers/sound/trident.c linux.new/drivers/sound/trident.c
--- linux/drivers/sound/trident.c	Tue Nov 13 12:19:41 2001
+++ linux.new/drivers/sound/trident.c	Wed Jan  9 13:55:47 2002
@@ -2555,7 +2555,7 @@
 static int trident_open(struct inode *inode, struct file *file)
 {
 	int i = 0;
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct trident_card *card = devs;
 	struct trident_state *state = NULL;
 	struct dmabuf *dmabuf = NULL;
@@ -3750,7 +3750,7 @@
 static int trident_open_mixdev(struct inode *inode, struct file *file)
 {
 	int i = 0;
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct trident_card *card = devs;
 
 	for (card = devs; card != NULL; card = card->next)
diff -uNr linux/drivers/sound/via82cxxx_audio.c linux.new/drivers/sound/via82cxxx_audio.c
--- linux/drivers/sound/via82cxxx_audio.c	Mon Dec 10 13:39:20 2001
+++ linux.new/drivers/sound/via82cxxx_audio.c	Wed Jan  9 13:53:44 2002
@@ -1358,7 +1358,7 @@
 
 static int via_mixer_open (struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct via_info *card;
 	struct pci_dev *pdev;
 	struct pci_driver *drvr;
@@ -2974,7 +2974,7 @@
 
 static int via_dsp_open (struct inode *inode, struct file *file)
 {
-	int minor = MINOR(inode->i_rdev);
+	int minor = minor(inode->i_rdev);
 	struct via_info *card;
 	struct pci_dev *pdev;
 	struct via_channel *chan;
diff -uNr linux/drivers/sound/vwsnd.c linux.new/drivers/sound/vwsnd.c
--- linux/drivers/sound/vwsnd.c	Fri Nov  9 17:07:41 2001
+++ linux.new/drivers/sound/vwsnd.c	Wed Jan  9 13:57:43 2002
@@ -2907,7 +2907,7 @@
 static int vwsnd_audio_open(struct inode *inode, struct file *file)
 {
 	vwsnd_dev_t *devc;
-	dev_t minor = MINOR(inode->i_rdev);
+	dev_t minor = minor(inode->i_rdev);
 	int sw_samplefmt;
 
 	DBGE("(inode=0x%p, file=0x%p)\n", inode, file);
@@ -3054,7 +3054,7 @@
 
 	INC_USE_COUNT;
 	for (devc = vwsnd_dev_list; devc; devc = devc->next_dev)
-		if (devc->mixer_minor == MINOR(inode->i_rdev))
+		if (devc->mixer_minor == minor(inode->i_rdev))
 			break;
 
 	if (devc == NULL) {

             reply	other threads:[~2002-01-09 19:17 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-01-09 19:20 Brendan Burns [this message]
2002-01-09 19:55 ` MINOR(inode->i_rdev) vs. minor(inode->i_rdev) Nikita Gergel

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=1010604024.2904.0.camel@epiphany \
    --to=bburns@genet.cs.umass.edu \
    --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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.