ide: ide-taskfile.c fix style problems
Fix trivial style problems: WARNING: Use #include <linux/uaccess.h> instead of <asm/uaccess.h> WARNING: space prohibited between function name and open parenthesis '(' WARNING: EXPORT_SYMBOL(foo); should immediately follow its function/variable ERROR: do not use C99 // comments X 2 ERROR: trailing statements should be on next line ERROR: trailing whitespace ERROR: switch and case should be at the same indent WARNING: line over 80 characters total: 5 errors, 4 warnings Also removed dead code Also used pr_err() to avoid line breaks Signed-off-by: Jaswinder Singh Rajput <jaswinderrajput@gmail.com> Acked-by: Bartlomiej Zolnierkiewicz <bzolnier@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
72db37b2c9
commit
2d5abcedeb
1 changed files with 51 additions and 58 deletions
|
@ -19,8 +19,8 @@
|
||||||
#include <linux/hdreg.h>
|
#include <linux/hdreg.h>
|
||||||
#include <linux/ide.h>
|
#include <linux/ide.h>
|
||||||
#include <linux/scatterlist.h>
|
#include <linux/scatterlist.h>
|
||||||
|
#include <linux/uaccess.h>
|
||||||
|
|
||||||
#include <asm/uaccess.h>
|
|
||||||
#include <asm/io.h>
|
#include <asm/io.h>
|
||||||
|
|
||||||
void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd)
|
void ide_tf_readback(ide_drive_t *drive, struct ide_cmd *cmd)
|
||||||
|
@ -53,7 +53,7 @@ void ide_tf_dump(const char *s, struct ide_cmd *cmd)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
int taskfile_lib_get_identify (ide_drive_t *drive, u8 *buf)
|
int taskfile_lib_get_identify(ide_drive_t *drive, u8 *buf)
|
||||||
{
|
{
|
||||||
struct ide_cmd cmd;
|
struct ide_cmd cmd;
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ ide_startstop_t do_rw_taskfile(ide_drive_t *drive, struct ide_cmd *orig_cmd)
|
||||||
if (orig_cmd->protocol == ATA_PROT_PIO &&
|
if (orig_cmd->protocol == ATA_PROT_PIO &&
|
||||||
(orig_cmd->tf_flags & IDE_TFLAG_MULTI_PIO) &&
|
(orig_cmd->tf_flags & IDE_TFLAG_MULTI_PIO) &&
|
||||||
drive->mult_count == 0) {
|
drive->mult_count == 0) {
|
||||||
printk(KERN_ERR "%s: multimode not set!\n", drive->name);
|
pr_err("%s: multimode not set!\n", drive->name);
|
||||||
return ide_stopped;
|
return ide_stopped;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -214,7 +214,7 @@ static u8 wait_drive_not_busy(ide_drive_t *drive)
|
||||||
}
|
}
|
||||||
|
|
||||||
if (stat & ATA_BUSY)
|
if (stat & ATA_BUSY)
|
||||||
printk(KERN_ERR "%s: drive still BUSY!\n", drive->name);
|
pr_err("%s: drive still BUSY!\n", drive->name);
|
||||||
|
|
||||||
return stat;
|
return stat;
|
||||||
}
|
}
|
||||||
|
@ -400,8 +400,7 @@ static ide_startstop_t pre_task_out_intr(ide_drive_t *drive,
|
||||||
|
|
||||||
if (ide_wait_stat(&startstop, drive, ATA_DRQ,
|
if (ide_wait_stat(&startstop, drive, ATA_DRQ,
|
||||||
drive->bad_wstat, WAIT_DRQ)) {
|
drive->bad_wstat, WAIT_DRQ)) {
|
||||||
printk(KERN_ERR "%s: no DRQ after issuing %sWRITE%s\n",
|
pr_err("%s: no DRQ after issuing %sWRITE%s\n", drive->name,
|
||||||
drive->name,
|
|
||||||
(cmd->tf_flags & IDE_TFLAG_MULTI_PIO) ? "MULT" : "",
|
(cmd->tf_flags & IDE_TFLAG_MULTI_PIO) ? "MULT" : "",
|
||||||
(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
|
(drive->dev_flags & IDE_DFLAG_LBA48) ? "_EXT" : "");
|
||||||
return startstop;
|
return startstop;
|
||||||
|
@ -451,7 +450,6 @@ put_req:
|
||||||
blk_put_request(rq);
|
blk_put_request(rq);
|
||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
EXPORT_SYMBOL(ide_raw_taskfile);
|
EXPORT_SYMBOL(ide_raw_taskfile);
|
||||||
|
|
||||||
int ide_no_data_taskfile(ide_drive_t *drive, struct ide_cmd *cmd)
|
int ide_no_data_taskfile(ide_drive_t *drive, struct ide_cmd *cmd)
|
||||||
|
@ -477,10 +475,9 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
|
||||||
u16 nsect = 0;
|
u16 nsect = 0;
|
||||||
char __user *buf = (char __user *)arg;
|
char __user *buf = (char __user *)arg;
|
||||||
|
|
||||||
// printk("IDE Taskfile ...\n");
|
|
||||||
|
|
||||||
req_task = kzalloc(tasksize, GFP_KERNEL);
|
req_task = kzalloc(tasksize, GFP_KERNEL);
|
||||||
if (req_task == NULL) return -ENOMEM;
|
if (req_task == NULL)
|
||||||
|
return -ENOMEM;
|
||||||
if (copy_from_user(req_task, buf, tasksize)) {
|
if (copy_from_user(req_task, buf, tasksize)) {
|
||||||
kfree(req_task);
|
kfree(req_task);
|
||||||
return -EFAULT;
|
return -EFAULT;
|
||||||
|
@ -581,8 +578,7 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
|
||||||
case TASKFILE_MULTI_OUT:
|
case TASKFILE_MULTI_OUT:
|
||||||
if (!drive->mult_count) {
|
if (!drive->mult_count) {
|
||||||
/* (hs): give up if multcount is not set */
|
/* (hs): give up if multcount is not set */
|
||||||
printk(KERN_ERR "%s: %s Multimode Write " \
|
pr_err("%s: %s Multimode Write multcount is not set\n",
|
||||||
"multcount is not set\n",
|
|
||||||
drive->name, __func__);
|
drive->name, __func__);
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
goto abort;
|
goto abort;
|
||||||
|
@ -601,8 +597,7 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
|
||||||
case TASKFILE_MULTI_IN:
|
case TASKFILE_MULTI_IN:
|
||||||
if (!drive->mult_count) {
|
if (!drive->mult_count) {
|
||||||
/* (hs): give up if multcount is not set */
|
/* (hs): give up if multcount is not set */
|
||||||
printk(KERN_ERR "%s: %s Multimode Read failure " \
|
pr_err("%s: %s Multimode Read multcount is not set\n",
|
||||||
"multcount is not set\n",
|
|
||||||
drive->name, __func__);
|
drive->name, __func__);
|
||||||
err = -EPERM;
|
err = -EPERM;
|
||||||
goto abort;
|
goto abort;
|
||||||
|
@ -631,7 +626,7 @@ int ide_taskfile_ioctl(ide_drive_t *drive, unsigned long arg)
|
||||||
nsect = (cmd.hob.nsect << 8) | cmd.tf.nsect;
|
nsect = (cmd.hob.nsect << 8) | cmd.tf.nsect;
|
||||||
|
|
||||||
if (!nsect) {
|
if (!nsect) {
|
||||||
printk(KERN_ERR "%s: in/out command without data\n",
|
pr_err("%s: in/out command without data\n",
|
||||||
drive->name);
|
drive->name);
|
||||||
err = -EFAULT;
|
err = -EFAULT;
|
||||||
goto abort;
|
goto abort;
|
||||||
|
@ -673,8 +668,6 @@ abort:
|
||||||
kfree(outbuf);
|
kfree(outbuf);
|
||||||
kfree(inbuf);
|
kfree(inbuf);
|
||||||
|
|
||||||
// printk("IDE Taskfile ioctl ended. rc = %i\n", err);
|
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue