LKML Archive on lore.kernel.org
help / color / mirror / Atom feed
* [PATCH] misc: ifdef KMOD, saving some bytes probably
@ 2008-02-08 16:48 Jiri Olsa
  2008-02-08 17:30 ` Sam Ravnborg
  0 siblings, 1 reply; 2+ messages in thread
From: Jiri Olsa @ 2008-02-08 16:48 UTC (permalink / raw)
  To: rubini; +Cc: linux-kernel

found some code in misc.c that could be ifdef'ed for KMOD

Signed-off-by: Jiri Olsa <olsajiri@gmail.com>
---
 drivers/char/misc.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git a/drivers/char/misc.c b/drivers/char/misc.c
index a39101f..3455b09 100644
--- a/drivers/char/misc.c
+++ b/drivers/char/misc.c
@@ -126,7 +126,8 @@ static int misc_open(struct inode * inode, struct file * file)
 			break;
 		}
 	}
-		
+
+#if defined(CONFIG_KMOD)
 	if (!new_fops) {
 		mutex_unlock(&misc_mtx);
 		request_module("char-major-%d-%d", MISC_MAJOR, minor);
@@ -141,6 +142,10 @@ static int misc_open(struct inode * inode, struct file * file)
 		if (!new_fops)
 			goto fail;
 	}
+#else
+	if (!new_fops)
+		goto fail;
+#endif
 
 	err = 0;
 	old_fops = file->f_op;

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PATCH] misc: ifdef KMOD, saving some bytes probably
  2008-02-08 16:48 [PATCH] misc: ifdef KMOD, saving some bytes probably Jiri Olsa
@ 2008-02-08 17:30 ` Sam Ravnborg
  0 siblings, 0 replies; 2+ messages in thread
From: Sam Ravnborg @ 2008-02-08 17:30 UTC (permalink / raw)
  To: Jiri Olsa; +Cc: rubini, linux-kernel

On Fri, Feb 08, 2008 at 05:48:14PM +0100, Jiri Olsa wrote:
> found some code in misc.c that could be ifdef'ed for KMOD
> 
We need very good arguments in order to introduce
#ifdef/#endif in code.
So this patch needs to come with hard fatcs about .text
savings and where it matters.

	Sam

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2008-02-08 17:30 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2008-02-08 16:48 [PATCH] misc: ifdef KMOD, saving some bytes probably Jiri Olsa
2008-02-08 17:30 ` Sam Ravnborg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).