ide: Build fix for CONFIG_IDE_PROC_FS=n
PATCH 1/1 ide: Build fix for CONFIG_IDE_PROC_FS=n
Recent changes have broken compilation when CONFIG_IDE_PROC_FS is not set.
---
Applies to next-20080829.
drivers/ide/Makefile | 9 +++++++-- drivers/ide/ide-disk.h | 2 ++ drivers/ide/ide-floppy.h | 2 ++ 3 files changed, 11 insertions(+), 2 deletions(-)
drivers/ide/Makefile +7 -2
@@ -36,9 +36,14 @@ obj-$(CONFIG_IDE_H8300) += h8300/ obj-$(CONFIG_IDE_GENERIC) += ide-generic.o obj-$(CONFIG_BLK_DEV_IDEPNP) += ide-pnp.o -ide-disk_mod-y += ide-disk.o ide-disk_ioctl.o ide-disk_proc.o +ide-disk_mod-y += ide-disk.o ide-disk_ioctl.o ide-cd_mod-y += ide-cd.o ide-cd_ioctl.o ide-cd_verbose.o -ide-floppy_mod-y += ide-floppy.o ide-floppy_ioctl.o ide-floppy_proc.o +ide-floppy_mod-y += ide-floppy.o ide-floppy_ioctl.o + +ifeq ($(CONFIG_IDE_PROC_FS), y) + ide-disk_mod-y += ide-disk_proc.o + ide-floppy_mod-y += ide-floppy_proc.o +endif obj-$(CONFIG_BLK_DEV_IDEDISK) += ide-disk_mod.o obj-$(CONFIG_BLK_DEV_IDECD) += ide-cd_mod.o
drivers/ide/ide-disk.h +2 -0
@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);/* ide-disk_ioctl.c */ int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-disk_proc.c */ extern ide_proc_entry_t ide_disk_proc[];extern const struct ide_proc_devset ide_disk_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /* __IDE_DISK_H */
drivers/ide/ide-floppy.h +2 -0
@@ -53,8 +53,10 @@ sector_t ide_floppy_capacity(ide_drive_t *);/* ide-floppy_ioctl.c */ int ide_floppy_ioctl (struct inode *,struct file *,unsigned ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-floppy_proc.c */ extern ide_proc_entry_t ide_floppy_proc[];extern const struct ide_proc_devset ide_floppy_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /*__IDE_FLOPPY_H */
Hello.
Quoted 4 lines · Elias Oltmanns
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>
[...]
Quoted 20 lines
drivers/ide/ide-disk.h +2
-0@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);/* ide-disk_ioctl.c */ int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-disk_proc.c */ extern ide_proc_entry_t ide_disk_proc[];extern const struct ide_proc_devset ide_disk_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /* __IDE_DISK_H */ drivers/ide/ide-floppy.h +0
-0
drivers/ide/ide-floppy.h sector_t ide_floppy_capacity(ide_drive_t *); · line 61
Quoted 9 lines
drivers/ide/ide-floppy.h +2
-0@@ -53,8 +53,10 @@ sector_t ide_floppy_capacity(ide_drive_t *);/* ide-floppy_ioctl.c */ int ide_floppy_ioctl (struct inode *,struct file *,unsigned ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-floppy_proc.c */ extern ide_proc_entry_t ide_floppy_proc[];extern const struct ide_proc_devset ide_floppy_settings[]; +#endif /* CONFIG_IDE_PROC_FS */
Is surrounding 'extern' declarations by #ifdef's really of any value? They shouldn't be used if CONFIG_IDE_PROC_FS=n, so no object file
records should be generated.
WBR, Sergei
Hello, I have just written:
Quoted 30 lines
Quoted 4 lines
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>[...]
Quoted 25 lines
drivers/ide/ide-disk.h +2
-0@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);/* ide-disk_ioctl.c */ int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-disk_proc.c */ extern ide_proc_entry_t ide_disk_proc[];extern const struct ide_proc_devset ide_disk_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /*
__IDE_DISK_H*/drivers/ide/ide-floppy.h +0
-0@@ -53,8 +53,10 @@ sector_t ide_floppy_capacity(ide_drive_t *);/* ide-floppy_ioctl.c */ int ide_floppy_ioctl (struct inode *,struct file *,unsigned ,unsigned long );
Quoted 10 lines
drivers/ide/ide-floppy.h sector_t ide_floppy_capacity(ide_drive_t *); · line 61
Quoted 6 lines
drivers/ide/ide-floppy.h +2
-0+#ifdef CONFIG_IDE_PROC_FS /* ide-floppy_proc.c */ extern ide_proc_entry_t ide_floppy_proc[];extern const struct ide_proc_devset ide_floppy_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ Is surrounding 'extern' declarations by #ifdef's really of any value? They shouldn't be used if
CONFIG_IDE_PROC_FS=n, so no object file
records should be generated.
Ah, you probably mean to turn the possible link time errors if the do
get referenced into the compile time errors...
MBR, Sergei
Quoted 22 lines · Sergei Shtylyov
Hello, I have just written:
Quoted 21 lines
Quoted 6 lines
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSisnot set.
Signed-off-by Elias Oltmanns <[email protected]>[...]
Quoted 14 lines
drivers/ide/ide-disk.h +1
-0@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);/* ide-disk_ioctl.c */ int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS/* ide-disk_proc.c */ extern ide_proc_entry_t ide_disk_proc[];extern const struct ide_proc_devset ide_disk_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /* __IDE_DISK_H */
[...]
Quoted 7 lines
Quoted 4 lines
Is surrounding 'extern' declarations by #ifdef's really of any value? They shouldn't be used if
CONFIG_IDE_PROC_FS=n, so no object file
records should be generated.Ah, you probably mean to turn the possible link time errors if the
do get referenced into the compile time errors...
Sorry, I don't quite understand that last sentence. But we definitely have compile time errors here because the compiler doesn't even know of ide_proc_entry_t when CONFIG_IDE_PROC_FS is not set. Therefore the forward declarations appear to be syntactically incorrect, regardless whether extern or not.
Regards,
Elias
Quoted 24 lines · Elias Oltmanns
Quoted 21 lines
Quoted 21 lines
Quoted 4 lines
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>[...]
Quoted 14 lines
drivers/ide/ide-disk.h +2
-0@@ -23,8 +23,10 @@ ide_decl_devset(acoustic);/* ide-disk_ioctl.c */ int ide_disk_ioctl (struct inode *,struct file *,unsigned int ,unsigned long ); +#ifdef CONFIG_IDE_PROC_FS /* ide-disk_proc.c */ extern ide_proc_entry_t ide_disk_proc[];extern const struct ide_proc_devset ide_disk_settings[]; +#endif /* CONFIG_IDE_PROC_FS */ #endif /* __IDE_DISK_H */ [...]
Quoted 8 lines
Quoted 6 lines
Quoted 3 lines
Is surrounding 'extern' declarations by #ifdef's really of any value? They shouldn't be used if
CONFIG_IDE_PROC_FS=n, so no object file
records should be generated.Ah, you probably mean to turn the possible link time errors if the
do get referenced into the compile time errors...Sorry, I don't quite understand that last sentence.
If a variable declared 'extern' is referenced but the module containing
its definition is not linked in, you get unresolved symbol at link time, if the declaration is missing altogether, you get error at compile time...
Quoted 5 lines
But we definitely
have compile time errors here because the compiler doesn't even know ofide_proc_entry_twhenCONFIG_IDE_PROC_FSis not set. Therefore the forward declarations appear to be syntactically incorrect, regardless whether extern or not.
Ah. I should've looked at the types of those variables, stupid/hasty me...
Quoted 3 lines
Regards,
Elias
MBR, Sergei
Quoted 3 lines · Elias Oltmanns
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>
Thanks!
I integrated your fixes into guilty patches ("ide-floppy: move /proc handling to ide-floppy_proc.c" and "ide-disk: move /proc handling to ide-disk_proc.c") to preserve bisection.
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 3 lines · Elias Oltmanns
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>Thanks!
I integrated your fixes into guilty patches ("ide-floppy: move /proc handling to
ide-floppy_proc.c" and "ide-disk: move /proc handling toide-disk_proc.c") to preserve bisection.
Yes, that's fine with me, but in the case of ide-disk_proc.h things apparently went wrong. As of next-20080901, I still have the line
ide-disk_mod-y += ide-disk.o ide-disk_ioctl.o ide-disk_proc.o
in the Makefile. Could you please truncate that line appropriately?
Regards,
Elias
Quoted 12 lines · Elias Oltmanns
Quoted 10 lines · Bartlomiej Zolnierkiewicz
Quoted 3 lines · Elias Oltmanns
Recent changes have broken compilation when
CONFIG_IDE_PROC_FSis not set.Signed-off-by Elias Oltmanns <[email protected]>Thanks!
I integrated your fixes into guilty patches ("ide-floppy: move /proc handling to
ide-floppy_proc.c" and "ide-disk: move /proc handling toide-disk_proc.c") to preserve bisection.
Quoted 6 lines
Yes, that's fine with me, but in the case of
ide-disk_proc.hthings apparently went wrong. As of next-20080901, I still have the lineide-disk_mod-y += ide-disk.o ide-disk_ioctl.o ide-disk_proc.o
in the
Makefile. Could you please truncate that line appropriately?
Fixed, thanks for noticing.