Loading drivers/ide/ide-proc.c +75 −80 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ static void __ide_remove_setting (ide_drive_t *drive, char *name) while ((*p) && strcmp((*p)->name, name)) p = &((*p)->next); if ((setting = (*p)) == NULL) setting = (*p); if (setting == NULL) return; (*p) = setting->next; Loading Loading @@ -390,7 +391,7 @@ void ide_add_generic_settings (ide_drive_t *drive) static void proc_ide_settings_warn(void) { static int warned = 0; static int warned; if (warned) return; Loading @@ -417,7 +418,8 @@ static int proc_ide_read_settings mul_factor = setting->mul_factor; div_factor = setting->div_factor; out += sprintf(out, "%-24s", setting->name); if ((rc = ide_read_setting(drive, setting)) >= 0) rc = ide_read_setting(drive, setting); if (rc >= 0) out += sprintf(out, "%-16d", rc * mul_factor / div_factor); else out += sprintf(out, "%-16s", "write-only"); Loading Loading @@ -512,8 +514,7 @@ static int proc_ide_write_settings(struct file *file, const char __user *buffer, mutex_lock(&ide_setting_mtx); setting = ide_find_setting_by_name(drive, name); if (!setting) { if (!setting) { mutex_unlock(&ide_setting_mtx); goto parse_error; } Loading Loading @@ -639,18 +640,12 @@ static int proc_ide_read_media int len; switch (drive->media) { case ide_disk: media = "disk\n"; break; case ide_cdrom: media = "cdrom\n"; break; case ide_tape: media = "tape\n"; break; case ide_floppy:media = "floppy\n"; break; case ide_optical:media = "optical\n"; break; default: media = "UNKNOWN\n"; break; case ide_disk: media = "disk\n"; break; case ide_cdrom: media = "cdrom\n"; break; case ide_tape: media = "tape\n"; break; case ide_floppy: media = "floppy\n"; break; case ide_optical: media = "optical\n"; break; default: media = "UNKNOWN\n"; break; } strcpy(page, media); len = strlen(media); Loading @@ -658,11 +653,13 @@ static int proc_ide_read_media } static ide_proc_entry_t generic_drive_entries[] = { { "driver", S_IFREG|S_IRUGO, proc_ide_read_driver, proc_ide_write_driver }, { "driver", S_IFREG|S_IRUGO, proc_ide_read_driver, proc_ide_write_driver }, { "identify", S_IFREG|S_IRUSR, proc_ide_read_identify, NULL }, { "media", S_IFREG|S_IRUGO, proc_ide_read_media, NULL }, { "model", S_IFREG|S_IRUGO, proc_ide_read_dmodel, NULL }, { "settings", S_IFREG|S_IRUSR|S_IWUSR,proc_ide_read_settings, proc_ide_write_settings }, { "settings", S_IFREG|S_IRUSR|S_IWUSR, proc_ide_read_settings, proc_ide_write_settings }, { NULL, 0, NULL, NULL } }; Loading Loading @@ -734,7 +731,6 @@ void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) spin_unlock_irqrestore(&ide_lock, flags); mutex_unlock(&ide_setting_mtx); } EXPORT_SYMBOL(ide_proc_unregister_driver); void ide_proc_port_register_devices(ide_hwif_t *hwif) Loading Loading @@ -795,7 +791,6 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info) { create_proc_info_entry(name, 0, proc_ide_root, get_info); } EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); #endif Loading Loading
drivers/ide/ide-proc.c +75 −80 Original line number Diff line number Diff line Loading @@ -205,7 +205,8 @@ static void __ide_remove_setting (ide_drive_t *drive, char *name) while ((*p) && strcmp((*p)->name, name)) p = &((*p)->next); if ((setting = (*p)) == NULL) setting = (*p); if (setting == NULL) return; (*p) = setting->next; Loading Loading @@ -390,7 +391,7 @@ void ide_add_generic_settings (ide_drive_t *drive) static void proc_ide_settings_warn(void) { static int warned = 0; static int warned; if (warned) return; Loading @@ -417,7 +418,8 @@ static int proc_ide_read_settings mul_factor = setting->mul_factor; div_factor = setting->div_factor; out += sprintf(out, "%-24s", setting->name); if ((rc = ide_read_setting(drive, setting)) >= 0) rc = ide_read_setting(drive, setting); if (rc >= 0) out += sprintf(out, "%-16d", rc * mul_factor / div_factor); else out += sprintf(out, "%-16s", "write-only"); Loading Loading @@ -512,8 +514,7 @@ static int proc_ide_write_settings(struct file *file, const char __user *buffer, mutex_lock(&ide_setting_mtx); setting = ide_find_setting_by_name(drive, name); if (!setting) { if (!setting) { mutex_unlock(&ide_setting_mtx); goto parse_error; } Loading Loading @@ -639,18 +640,12 @@ static int proc_ide_read_media int len; switch (drive->media) { case ide_disk: media = "disk\n"; break; case ide_cdrom: media = "cdrom\n"; break; case ide_tape: media = "tape\n"; break; case ide_floppy:media = "floppy\n"; break; case ide_optical:media = "optical\n"; break; default: media = "UNKNOWN\n"; break; case ide_disk: media = "disk\n"; break; case ide_cdrom: media = "cdrom\n"; break; case ide_tape: media = "tape\n"; break; case ide_floppy: media = "floppy\n"; break; case ide_optical: media = "optical\n"; break; default: media = "UNKNOWN\n"; break; } strcpy(page, media); len = strlen(media); Loading @@ -658,11 +653,13 @@ static int proc_ide_read_media } static ide_proc_entry_t generic_drive_entries[] = { { "driver", S_IFREG|S_IRUGO, proc_ide_read_driver, proc_ide_write_driver }, { "driver", S_IFREG|S_IRUGO, proc_ide_read_driver, proc_ide_write_driver }, { "identify", S_IFREG|S_IRUSR, proc_ide_read_identify, NULL }, { "media", S_IFREG|S_IRUGO, proc_ide_read_media, NULL }, { "model", S_IFREG|S_IRUGO, proc_ide_read_dmodel, NULL }, { "settings", S_IFREG|S_IRUSR|S_IWUSR,proc_ide_read_settings, proc_ide_write_settings }, { "settings", S_IFREG|S_IRUSR|S_IWUSR, proc_ide_read_settings, proc_ide_write_settings }, { NULL, 0, NULL, NULL } }; Loading Loading @@ -734,7 +731,6 @@ void ide_proc_unregister_driver(ide_drive_t *drive, ide_driver_t *driver) spin_unlock_irqrestore(&ide_lock, flags); mutex_unlock(&ide_setting_mtx); } EXPORT_SYMBOL(ide_proc_unregister_driver); void ide_proc_port_register_devices(ide_hwif_t *hwif) Loading Loading @@ -795,7 +791,6 @@ void ide_pci_create_host_proc(const char *name, get_info_t *get_info) { create_proc_info_entry(name, 0, proc_ide_root, get_info); } EXPORT_SYMBOL_GPL(ide_pci_create_host_proc); #endif Loading