mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* (no subject)
@ 2002-03-20 12:53 Glenn McGrath
  0 siblings, 0 replies; only message in thread
From: Glenn McGrath @ 2002-03-20 12:53 UTC (permalink / raw)
  To: linux-kernel; +Cc: Erik Andersen

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

This patch moves some defines from within the body of functions that
handle sub msdos partion types (bsd, solaris, unixware, minix) to outside
the function, and places defines around their entry in the table that maps
where they are called from. It will usually save around 100 Bytes, it isnt
much, but i dont see any reason to define a function that does nothing.

Im having trouble trying to subscribe to the lkml or get to
http://vger.kernel.org, (maybe an ECN problem?) so if anyone does get this
and wants to respond please cc me.

Thanks

Glenn



[-- Attachment #2: part.msdos.defines.diff --]
[-- Type: text/plain, Size: 3228 bytes --]

--- linux-2.5.7.orig/fs/partitions/msdos.c	Tue Mar 19 07:37:04 2002
+++ linux-2.5.7/fs/partitions/msdos.c	Wed Mar 20 22:25:31 2002
@@ -207,15 +207,13 @@
 	put_dev_sector(sect);
 }
 
+#ifdef CONFIG_SOLARIS_X86_PARTITION
 /* james@bpgc.com: Solaris has a nasty indicator: 0x82 which also
    indicates linux swap.  Be careful before believing this is Solaris. */
-
 static void
 solaris_x86_partition(struct gendisk *hd, struct block_device *bdev,
 		int minor, int *current_minor)
 {
-
-#ifdef CONFIG_SOLARIS_X86_PARTITION
 	long offset = hd->part[minor].start_sect;
 	Sector sect;
 	struct solaris_x86_vtoc *v;
@@ -257,8 +255,8 @@
 	}
 	put_dev_sector(sect);
 	printk(" >\n");
-#endif
 }
+#endif
 
 #ifdef CONFIG_BSD_DISKLABEL
 /* 
@@ -304,33 +302,34 @@
 }
 #endif
 
+#ifdef CONFIG_BSD_DISKLABEL
 static void bsd_partition(struct gendisk *hd, struct block_device *bdev,
 	int minor, int *current_minor)
 {
-#ifdef CONFIG_BSD_DISKLABEL
 	do_bsd_partition(hd, bdev, minor, current_minor, "bsd",
 		BSD_MAXPARTITIONS);
-#endif
 }
+#endif
 
+#ifdef CONFIG_BSD_DISKLABEL
 static void netbsd_partition(struct gendisk *hd, struct block_device *bdev,
 		int minor, int *current_minor)
 {
-#ifdef CONFIG_BSD_DISKLABEL
 	do_bsd_partition(hd, bdev, minor, current_minor, "netbsd",
 			BSD_MAXPARTITIONS);
-#endif
 }
+#endif
 
+#ifdef CONFIG_BSD_DISKLABEL
 static void openbsd_partition(struct gendisk *hd, struct block_device *bdev,
 		int minor, int *current_minor)
 {
-#ifdef CONFIG_BSD_DISKLABEL
 	do_bsd_partition(hd, bdev, minor, current_minor,
 			"openbsd", OPENBSD_MAXPARTITIONS);
-#endif
 }
+#endif
 
+#ifdef CONFIG_UNIXWARE_DISKLABEL
 /*
  * Create devices for Unixware partitions listed in a disklabel, under a
  * dos-like partition. See extended_partition() for more information.
@@ -338,7 +337,6 @@
 static void unixware_partition(struct gendisk *hd, struct block_device *bdev,
 		int minor, int *current_minor)
 {
-#ifdef CONFIG_UNIXWARE_DISKLABEL
 	long offset = hd->part[minor].start_sect;
 	Sector sect;
 	struct unixware_disklabel *l;
@@ -370,9 +368,10 @@
 	}
 	put_dev_sector(sect);
 	printk(" >\n");
-#endif
 }
+#endif
 
+#ifdef CONFIG_MINIX_SUBPARTITION
 /*
  * Minix 2.0.0/2.0.2 subpartition support.
  * Anand Krishnamurthy <anandk@wiproge.med.ge.com>
@@ -381,7 +380,6 @@
 static void minix_partition(struct gendisk *hd, struct block_device *bdev,
 		int minor, int *current_minor)
 {
-#ifdef CONFIG_MINIX_SUBPARTITION
 	long offset = hd->part[minor].start_sect;
 	Sector sect;
 	unsigned char *data;
@@ -416,19 +414,27 @@
 		printk(" >\n");
 	}
 	put_dev_sector(sect);
-#endif /* CONFIG_MINIX_SUBPARTITION */
 }
+#endif /* CONFIG_MINIX_SUBPARTITION */
 
 static struct {
 	unsigned char id;
 	void (*parse)(struct gendisk *, struct block_device *, int, int *);
 } subtypes[] = {
+#ifdef CONFIG_BSD_DISKLABEL
 	{BSD_PARTITION, bsd_partition},
 	{NETBSD_PARTITION, netbsd_partition},
 	{OPENBSD_PARTITION, openbsd_partition},
+#endif
+#ifdef CONFIG_MINIX_SUBPARTITION
 	{MINIX_PARTITION, minix_partition},
+#endif
+#ifdef CONFIG_UNIXWARE_DISKLABEL
 	{UNIXWARE_PARTITION, unixware_partition},
+#endif
+#ifdef CONFIG_SOLARIS_X86_PARTITION
 	{SOLARIS_X86_PARTITION, solaris_x86_partition},
+#endif
 	{0, NULL},
 };
 /*

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2002-03-20 12:54 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2002-03-20 12:53 Glenn McGrath

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®