IDE: Coding Style fixes to drivers/ide/ide-proc.c
Lot of errors and warnings removed. Compile tested. [bart: minor fixes, md5sum checked] Signed-off-by: Paolo Ciarrocchi <paolo.ciarrocchi@gmail.com> Signed-off-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com>
This commit is contained in:
parent
f94e00847c
commit
441e92dae0
|
@ -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;
|
||||
|
@ -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;
|
||||
|
@ -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");
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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 }
|
||||
};
|
||||
|
||||
|
@ -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)
|
||||
|
@ -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…
Reference in New Issue