Skip to contentSkip to conversation

remove genhd.h from header exports

PATCH In review Olaf Hering 2 participants 3 messages Aug 7, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 remove genhd.h from header exports

remove linux/genhd.h from make headers_install

It contains no userinterfaces, only the msdos partition table layout and some numbers. And it became finally unusable with the CONFIG_BLOCK addition.

Remove it from the Kconfig list, and remove the __KERNEL__ checks. Move #include block up
remove unused inclusion of linux/major.h

compile tested with ppc64_defconfig

---
 include/linux/Kbuild  |    1 -
 include/linux/genhd.h |   37 ++++++-------------------------------
 2 files changed, 6 insertions(+), 32 deletions(-)
include/linux/Kbuild +0 -1
@@ -204,7 +204,6 @@ unifdef-y += futex.h
 unifdef-y += fs.h
 unifdef-y += gameport.h
 unifdef-y += generic_serial.h
-unifdef-y += genhd.h
 unifdef-y += gfs2_ondisk.h
 unifdef-y += hayesesp.h
 unifdef-y += hdlcdrv.h
include/linux/genhd.h +6 -31
@@ -9,9 +9,14 @@
  *		<[email protected]>
  */
 
+#ifdef CONFIG_BLOCK
 #include <linux/types.h>
+#include <linux/device.h>
+#include <linux/smp.h>
+#include <linux/string.h>
+#include <linux/fs.h>
+#include <linux/workqueue.h>
 
-#ifdef CONFIG_BLOCK
 
 enum {
 /* These three have identical behaviour; use the second one if DOS FDISK gets
@@ -43,31 +48,6 @@ enum {
 	UNIXWARE_PARTITION = 0x63,	/* Same as GNU_HURD and SCO Unix */
 };
 
-#ifndef __KERNEL__
-
-struct partition {
-	unsigned char boot_ind;		/* 0x80 - active */
-	unsigned char head;		/* starting head */
-	unsigned char sector;		/* starting sector */
-	unsigned char cyl;		/* starting cylinder */
-	unsigned char sys_ind;		/* What partition type */
-	unsigned char end_head;		/* end head */
-	unsigned char end_sector;	/* end sector */
-	unsigned char end_cyl;		/* end cylinder */
-	unsigned int start_sect;	/* starting sector counting from 0 */
-	unsigned int nr_sects;		/* nr of sectors in partition */
-} __attribute__((packed));
-
-#endif
-
-#ifdef __KERNEL__
-#include <linux/major.h>
-#include <linux/device.h>
-#include <linux/smp.h>
-#include <linux/string.h>
-#include <linux/fs.h>
-#include <linux/workqueue.h>
-
 struct partition {
 	unsigned char boot_ind;		/* 0x80 - active */
 	unsigned char head;		/* starting head */
@@ -260,8 +240,6 @@ static inline void set_capacity(struct g
 	disk->capacity = size;
 }
 
-#endif  /*  __KERNEL__  */
-
 #ifdef CONFIG_SOLARIS_X86_PARTITION
 
 #define SOLARIS_X86_NUMSLICE	16
@@ -405,7 +383,6 @@ struct unixware_disklabel {
 #   define MINIX_NR_SUBPARTITIONS  4
 #endif /* CONFIG_MINIX_SUBPARTITION */
 
-#ifdef __KERNEL__
 
 #define ADDPART_FLAG_NONE	0
 #define ADDPART_FLAG_RAID	1
@@ -435,8 +412,6 @@ static inline struct block_device *bdget
 	return bdget(MKDEV(disk->major, disk->first_minor) + index);
 }
 
-#endif
-
 #else /* CONFIG_BLOCK */
 
 static inline void printk_all_partitions(void) { }
#1 lore raw
Quoted 5 lines · Olaf Hering

remove linux/genhd.h from make headers_install

It contains no userinterfaces, only the msdos partition table layout and some numbers. And it became finally unusable with the CONFIG_BLOCK addition.

Quoted 8 lines

Remove it from the Kconfig list, and remove the __KERNEL__ checks. Move #include block up
remove unused inclusion of linux/major.h

compile tested with ppc64_defconfig

AFAICS the proper fix is to undo the CONFIG_BLOCK breakage, not make the header unusable.

Jeff

#2 lore raw
Quoted 2 lines · Jeff Garzik

AFAICS the proper fix is to undo the CONFIG_BLOCK breakage, not make the header unusable.

No package uses linux/genhd.h, it is safe to remove it.