[2.6 patch] cdrom.c: make several functions static (fwd)

From: Adrian Bunk (bunk_at_stusta.de)
Date: 11/22/04

  • Next message: Adrian Bunk: "[2.6 patch] ALSA sound/pcmcia/pdaudiocf/pdaudiocf_core.c: make some code static"
    Date:	Mon, 22 Nov 2004 00:58:51 +0100
    To: Andrew Morton <akpm@osdl.org>, axboe@suse.de
    
    

    The patch forwarded below still applies and compiles against
    2.6.10-rc2-mm2 (I've edited it for a trivial context adjustment).

    Please apply or comment on it.

    ----- Forwarded message from Adrian Bunk <bunk@stusta.de> -----

    Date: Sun, 31 Oct 2004 22:33:19 +0100
    From: Adrian Bunk <bunk@stusta.de>
    To: axboe@suse.de
    Cc: linux-kernel@vger.kernel.org
    Subject: [2.6 patch] cdrom.c: make several functions static

    The patch below makes several functions in cdrom.c static.

    This includes cdrom_is_mrw and cdrom_is_random_writable which were
    EXPORT_SYMBOL'ed but weren't used anywhere outside of cdrom.h .

    diffstat output:
     drivers/cdrom/cdrom.c | 24 +++++++++++-------------
     include/linux/cdrom.h | 2 --
     2 files changed, 11 insertions(+), 15 deletions(-)

    Signed-off-by: Adrian Bunk <bunk@stusta.de>

    --- linux-2.6.10-rc1-mm2-full/include/linux/cdrom.h.old 2004-10-31 01:19:52.000000000 +0200
    +++ linux-2.6.10-rc1-mm2-full/include/linux/cdrom.h 2004-10-31 01:20:17.000000000 +0200
    @@ -1185,8 +1185,6 @@
     };
     
     extern int cdrom_get_media_event(struct cdrom_device_info *cdi, struct media_event_desc *med);
    -extern int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write);
    -extern int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write);
     
     #endif /* End of kernel only stuff */
     
    --- linux-2.6.10-rc1-mm2-full/drivers/cdrom/cdrom.c.old 2004-10-31 01:13:21.000000000 +0200
    +++ linux-2.6.10-rc1-mm2-full/drivers/cdrom/cdrom.c 2004-10-31 01:16:08.000000000 +0200
    @@ -505,7 +505,7 @@
      * the first prototypes used 0x2c as the page code for the mrw mode page,
      * subsequently this was changed to 0x03. probe the one used by this drive
      */
    -int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
    +static int cdrom_mrw_probe_pc(struct cdrom_device_info *cdi)
     {
             struct packet_command cgc;
             char buffer[16];
    @@ -526,7 +526,7 @@
             return 1;
     }
     
    -int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
    +static int cdrom_is_mrw(struct cdrom_device_info *cdi, int *write)
     {
             struct packet_command cgc;
             struct mrw_feature_desc *mfd;
    @@ -680,7 +680,7 @@
             return 0;
     }
     
    -int cdrom_get_random_writable(struct cdrom_device_info *cdi,
    +static int cdrom_get_random_writable(struct cdrom_device_info *cdi,
                                   struct rwrt_feature_desc *rfd)
     {
             struct packet_command cgc;
    @@ -701,7 +701,7 @@
             return 0;
     }
     
    -int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
    +static int cdrom_has_defect_mgt(struct cdrom_device_info *cdi)
     {
             struct packet_command cgc;
             char buffer[16];
    @@ -726,7 +726,7 @@
     }
     
     
    -int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write)
    +static int cdrom_is_random_writable(struct cdrom_device_info *cdi, int *write)
     {
             struct rwrt_feature_desc rfd;
             int ret;
    @@ -3074,14 +3074,12 @@
     EXPORT_SYMBOL(cdrom_mode_sense);
     EXPORT_SYMBOL(init_cdrom_command);
     EXPORT_SYMBOL(cdrom_get_media_event);
    -EXPORT_SYMBOL(cdrom_is_mrw);
    -EXPORT_SYMBOL(cdrom_is_random_writable);
     
     #ifdef CONFIG_SYSCTL
     
     #define CDROM_STR_SIZE 1000
     
    -struct cdrom_sysctl_settings {
    +static struct cdrom_sysctl_settings {
             char info[CDROM_STR_SIZE]; /* general info */
             int autoclose; /* close tray upon mount, etc */
             int autoeject; /* eject on umount */
    @@ -3090,7 +3088,7 @@
             int check; /* check media type */
     } cdrom_sysctl_settings;
     
    -int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
    +static int cdrom_sysctl_info(ctl_table *ctl, int write, struct file * filp,
                                void __user *buffer, size_t *lenp, loff_t *ppos)
     {
             int pos;
    @@ -3193,7 +3191,7 @@
        procfs/sysctl yet. When they are, this will naturally disappear. For now
        just update all drives. Later this will become the template on which
        new registered drives will be based. */
    -void cdrom_update_settings(void)
    +static void cdrom_update_settings(void)
     {
             struct cdrom_device_info *cdi;
     
    @@ -3271,7 +3269,7 @@
     }
     
     /* Place files in /proc/sys/dev/cdrom */
    -ctl_table cdrom_table[] = {
    +static ctl_table cdrom_table[] = {
             {
                     .ctl_name = DEV_CDROM_INFO,
                     .procname = "info",
    @@ -3323,7 +3321,7 @@
             { .ctl_name = 0 }
     };
     
    -ctl_table cdrom_cdrom_table[] = {
    +static ctl_table cdrom_cdrom_table[] = {
             {
                     .ctl_name = DEV_CDROM,
                     .procname = "cdrom",
    @@ -3335,7 +3333,7 @@
     };
     
     /* Make sure that /proc/sys/dev is there */
    -ctl_table cdrom_root_table[] = {
    +static ctl_table cdrom_root_table[] = {
             {
                     .ctl_name = CTL_DEV,

    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at http://www.tux.org/lkml/

    ----- End forwarded message -----

    cu
    Adrian

    -- 
           "Is there not promise of rain?" Ling Tan asked suddenly out
            of the darkness. There had been need of rain for many days.
           "Only a promise," Lao Er said.
                                           Pearl S. Buck - Dragon Seed
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Adrian Bunk: "[2.6 patch] ALSA sound/pcmcia/pdaudiocf/pdaudiocf_core.c: make some code static"

    Relevant Pages

    • Re: 2.6.11-rc2-mm1
      ... > It breaks compilation with gcc-4.0 ... This patch is correct, too. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6 patch] i386: always use 4k stacks
      ... reverting my patch would be more ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: RFC: [2.6 patch] better i386 CPU selection
      ... I had a short try to port Debian's patch ... This is not related to the issues my patch addresses. ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [2.6 patch] update Dag Brattlis email address
      ... > This patch is huge. ... There had been need of rain for many days. ... Pearl S. Buck - Dragon Seed ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)
    • Re: [-mm patch] SCSI_QLA2ABC options must select FW_LOADER
      ... > I send a patch for this yesterday that lets SCSI_QLA2XXX select ... stay as it is (with the fixes from my patches) doesn't matter much - ... There had been need of rain for many days. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)