mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: linux-kernel@vger.kernel.org, rgooch@atnf.csiro.au
Subject: Re: [BK PATCH] devfs cleanups for 2.5.29 - take 2
Date: Wed, 31 Jul 2002 11:35:08 -0700	[thread overview]
Message-ID: <20020731183508.GB21793@kroah.com> (raw)
In-Reply-To: <20020731183358.GA21793@kroah.com>

And here's the additional patch that I made on top of the previous two I
sent to the list yesterday:


# This is a BitKeeper generated patch for the following project:
# Project Name: Linux kernel tree
# This patch format is intended for GNU patch command version 2.5 or higher.
# This patch includes the following deltas:
#	           ChangeSet	1.545   -> 1.546  
#	     fs/devfs/base.c	1.47    -> 1.48   
#	        fs/devices.c	1.8     -> 1.9    
#	include/linux/devfs_fs_kernel.h	1.14    -> 1.15   
#	      fs/block_dev.c	1.76    -> 1.77   
#
# The following is the BitKeeper ChangeSet Log
# --------------------------------------------
# 02/07/30	greg@kroah.com	1.546
# Remove the devfs_should* functions I added, and replace them with one devfs_only() call
# 
# This now explains what is really going on much better than before.
# --------------------------------------------
#
diff -Nru a/fs/block_dev.c b/fs/block_dev.c
--- a/fs/block_dev.c	Wed Jul 31 11:23:15 2002
+++ b/fs/block_dev.c	Wed Jul 31 11:23:15 2002
@@ -453,7 +453,7 @@
 
 int register_blkdev(unsigned int major, const char * name, struct block_device_operations *bdops)
 {
-	if (devfs_should_register_blkdev())
+	if (devfs_only())
 		return 0;
 	if (major == 0) {
 		for (major = MAX_BLKDEV-1; major > 0; major--) {
@@ -476,7 +476,7 @@
 
 int unregister_blkdev(unsigned int major, const char * name)
 {
-	if (devfs_should_unregister_blkdev())
+	if (devfs_only())
 		return 0;
 	if (major >= MAX_BLKDEV)
 		return -EINVAL;
diff -Nru a/fs/devfs/base.c b/fs/devfs/base.c
--- a/fs/devfs/base.c	Wed Jul 31 11:23:15 2002
+++ b/fs/devfs/base.c	Wed Jul 31 11:23:15 2002
@@ -2228,59 +2228,17 @@
 
 
 /**
- *	devfs_should_register_chrdev - should we register a conventional character driver.
+ *	devfs_only - returns if "devfs=only" is a boot option
  *
- *	If "devfs=only" this function will return -1, otherwise 0 is returned.
+ *	If "devfs=only" this function will return 1, otherwise 0 is returned.
  */
-int devfs_should_register_chrdev (void)
+int devfs_only (void)
 {
     if (boot_options & OPTION_ONLY)
-	    return -1;
+	    return 1;
     return 0;
 }
 
-
-/**
- *	devfs_should_register_blkdev - should we register a conventional block driver.
- *
- *	If the "devfs=only" option was provided at boot time, this function will
- *	return -1, otherwise 0 is returned.
- */
-
-int devfs_should_register_blkdev (void)
-{
-    if (boot_options & OPTION_ONLY)
-	    return -1;
-    return 0;
-}
-
-
-/**
- *	devfs_should_unregister_chrdev - should we unregister a conventional character driver.
- *
- *	If "devfs=only" this function will return -1, otherwise 0 is returned
- */
-int devfs_should_unregister_chrdev (void)
-{
-    if (boot_options & OPTION_ONLY)
-	    return -1;
-    return 0;
-}
-
-
-/**
- *	devfs_should_unregister_blkdev - should we unregister a conventional block driver.
- *
- *	If the "devfs=only" option was provided at boot time, this function will
- *	return -1, otherwise 0 is returned.
- */
-
-int devfs_should_unregister_blkdev (void)
-{
-    if (boot_options & OPTION_ONLY)
-	    return -1;
-    return 0;
-}
 
 /**
  *	devfs_setup - Process kernel boot options.
diff -Nru a/fs/devices.c b/fs/devices.c
--- a/fs/devices.c	Wed Jul 31 11:23:15 2002
+++ b/fs/devices.c	Wed Jul 31 11:23:15 2002
@@ -98,7 +98,7 @@
 
 int register_chrdev(unsigned int major, const char * name, struct file_operations *fops)
 {
-	if (devfs_should_register_chrdev())
+	if (devfs_only())
 		return 0;
 	if (major == 0) {
 		write_lock(&chrdevs_lock);
@@ -128,7 +128,7 @@
 
 int unregister_chrdev(unsigned int major, const char * name)
 {
-	if (devfs_should_register_chrdev())
+	if (devfs_only())
 		return 0;
 	if (major >= MAX_CHRDEV)
 		return -EINVAL;
diff -Nru a/include/linux/devfs_fs_kernel.h b/include/linux/devfs_fs_kernel.h
--- a/include/linux/devfs_fs_kernel.h	Wed Jul 31 11:23:15 2002
+++ b/include/linux/devfs_fs_kernel.h	Wed Jul 31 11:23:15 2002
@@ -94,10 +94,7 @@
 extern void devfs_auto_unregister (devfs_handle_t master,devfs_handle_t slave);
 extern devfs_handle_t devfs_get_unregister_slave (devfs_handle_t master);
 extern const char *devfs_get_name (devfs_handle_t de, unsigned int *namelen);
-extern int devfs_should_register_chrdev (void);
-extern int devfs_should_register_blkdev (void);
-extern int devfs_should_unregister_chrdev (void);
-extern int devfs_should_unregister_blkdev (void);
+extern int devfs_only (void);
 
 extern void devfs_register_tape (devfs_handle_t de);
 extern void devfs_register_series (devfs_handle_t dir, const char *format,
@@ -237,19 +234,7 @@
 {
     return NULL;
 }
-static inline int devfs_should_register_chrdev (void)
-{
-    return 0;
-}
-static inline int devfs_should_register_blkdev (void)
-{
-    return 0;
-}
-static inline int devfs_should_unregister_chrdev (void)
-{
-    return 0;
-}
-static inline int devfs_should_unregister_blkdev (void)
+static inline int devfs_only (void)
 {
     return 0;
 }

      reply	other threads:[~2002-07-31 18:33 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-07-31 18:33 Greg KH
2002-07-31 18:35 ` Greg KH [this message]

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=20020731183508.GB21793@kroah.com \
    --to=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rgooch@atnf.csiro.au \
    /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®