Skip to content

Commit

Permalink
[PATCH] protect ide_cdrom_capacity by ifdef
Browse files Browse the repository at this point in the history
The only call to ide_cdrom_capacity is in code protected by
CONFIG_PROC_FS, so when that is not enabled, the compiler complains:

 drivers/ide/ide-cd.c:3259: warning: `ide_cdrom_capacity' defined but not used

Here is a patch that fixes that.  It provides some space savings for
embedded systems that are not using procfs, as well:

     text    data     bss     dec     hex filename
 -  33540    6504    1032   41076    a074 drivers/ide/ide-cd.o
 +  33468    6480    1032   40980    a014 drivers/ide/ide-cd.o

Signed-off-by: Amos Waterland <[email protected]>
Cc: Jens Axboe <[email protected]>
Cc: Bartlomiej Zolnierkiewicz <[email protected]>
Signed-off-by: Andrew Morton <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
Amos Waterland authored and Linus Torvalds committed Oct 31, 2005
1 parent 42e50a5 commit d97b321
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions drivers/ide/ide-cd.c
Original file line number Diff line number Diff line change
Expand Up @@ -3254,6 +3254,7 @@ int ide_cdrom_setup (ide_drive_t *drive)
return 0;
}

#ifdef CONFIG_PROC_FS
static
sector_t ide_cdrom_capacity (ide_drive_t *drive)
{
Expand All @@ -3264,6 +3265,7 @@ sector_t ide_cdrom_capacity (ide_drive_t *drive)

return capacity * sectors_per_frame;
}
#endif

static int ide_cd_remove(struct device *dev)
{
Expand Down

0 comments on commit d97b321

Please sign in to comment.