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
fs/partitions/msdos.c +20 -14
@@ -207,15 +207,13 @@put_dev_sector (sect); } +#ifdef CONFIG_SOLARIS_X86_PARTITION /* [email protected]: 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 <[email protected]>
@@ -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 }, };/*