Commit 0ea8a165 authored by Johannes Schilling's avatar Johannes Schilling Committed by Greg Kroah-Hartman

keucr: fix some alignment- and whitespace-problems

resolves checkpatch errors and warnings regarding whitespace around
operators, line lengths and indentation.
Signed-off-by: default avatarLaura Lawniczak <laura.lawniczak@googlemail.com>
Signed-off-by: default avatarJohannes Schilling <of82ecuq@cip.cs.fau.de>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent eecb3c07
......@@ -98,11 +98,16 @@ int ENE_SMInit(struct us_data *us)
us->SM_CardID = buf[2];
if (us->SM_Status.Insert && us->SM_Status.Ready) {
dev_info(&us->pusb_dev->dev, "Insert = %x\n", us->SM_Status.Insert);
dev_info(&us->pusb_dev->dev, "Ready = %x\n", us->SM_Status.Ready);
dev_info(&us->pusb_dev->dev, "WtP = %x\n", us->SM_Status.WtP);
dev_info(&us->pusb_dev->dev, "DeviceID = %x\n", us->SM_DeviceID);
dev_info(&us->pusb_dev->dev, "CardID = %x\n", us->SM_CardID);
dev_info(&us->pusb_dev->dev, "Insert = %x\n",
us->SM_Status.Insert);
dev_info(&us->pusb_dev->dev, "Ready = %x\n",
us->SM_Status.Ready);
dev_info(&us->pusb_dev->dev, "WtP = %x\n",
us->SM_Status.WtP);
dev_info(&us->pusb_dev->dev, "DeviceID = %x\n",
us->SM_DeviceID);
dev_info(&us->pusb_dev->dev, "CardID = %x\n",
us->SM_CardID);
MediaChange = 1;
Check_D_MediaFmt(us);
} else {
......@@ -174,7 +179,8 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg)
result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
bcb, US_BULK_CB_WRAP_LEN, NULL);
if (result != USB_STOR_XFER_GOOD) {
dev_err(&us->pusb_dev->dev, "send cmd to out endpoint fail ---\n");
dev_err(&us->pusb_dev->dev,
"send cmd to out endpoint fail ---\n");
return USB_STOR_TRANSPORT_ERROR;
}
......@@ -203,14 +209,16 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg)
US_BULK_CS_WRAP_LEN, &cswlen);
if (result == USB_STOR_XFER_SHORT && cswlen == 0) {
dev_warn(&us->pusb_dev->dev, "Received 0-length CSW; retrying...\n");
dev_warn(&us->pusb_dev->dev,
"Received 0-length CSW; retrying...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, &cswlen);
}
if (result == USB_STOR_XFER_STALLED) {
/* get the status again */
dev_warn(&us->pusb_dev->dev, "Attempting to get CSW (2nd try)...\n");
dev_warn(&us->pusb_dev->dev,
"Attempting to get CSW (2nd try)...\n");
result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, NULL);
}
......
......@@ -322,8 +322,9 @@ static ssize_t store_max_sectors(struct device *dev,
static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
store_max_sectors);
static struct device_attribute *sysfs_device_attr_list[] =
{&dev_attr_max_sectors, NULL, };
static struct device_attribute *sysfs_device_attr_list[] = {
&dev_attr_max_sectors, NULL,
};
/* this defines our host template, with which we'll allocate hosts */
......
......@@ -302,7 +302,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
return ERROR;
#ifdef RDERR_REASSIGN
if (Ssfdc.Attribute &MWP) {
if (Ssfdc.Attribute & MWP) {
if (ErrCode == ERR_CorReadErr)
return SMSUCCESS;
return ERROR;
......@@ -675,7 +675,6 @@ int Make_D_LogTable(struct us_data *us)
Media.Sector = 0;
{
/* pr_info("Make_D_LogTable --- MediaZone = 0x%x\n",
Media.Zone); */
for (Media.LogBlock = 0; Media.LogBlock < Ssfdc.MaxLogBlocks;
......@@ -688,8 +687,7 @@ int Make_D_LogTable(struct us_data *us)
for (Media.PhyBlock = 0; Media.PhyBlock < Ssfdc.MaxBlocks;
Media.PhyBlock++) {
if ((!Media.Zone) &&
(Media.PhyBlock <= CisArea.PhyBlock)) {
if ((!Media.Zone) && (Media.PhyBlock <= CisArea.PhyBlock)) {
Set_D_Bit(Assign[Media.Zone], Media.PhyBlock);
continue;
}
......@@ -714,8 +712,7 @@ int Make_D_LogTable(struct us_data *us)
continue;
if (Log2Phy[Media.Zone][Media.LogBlock] == NO_ASSIGN) {
Log2Phy[Media.Zone][Media.LogBlock] =
Media.PhyBlock;
Log2Phy[Media.Zone][Media.LogBlock] = Media.PhyBlock;
continue;
}
......@@ -728,13 +725,11 @@ int Make_D_LogTable(struct us_data *us)
return ERROR;
}
if (!Load_D_LogBlockAddr(Redundant)) {
if (Media.LogBlock == logblock) {
Media.PhyBlock =
Log2Phy[Media.Zone][logblock];
if (!Load_D_LogBlockAddr(Redundant) &&
(Media.LogBlock == logblock)) {
Media.PhyBlock = Log2Phy[Media.Zone][logblock];
if (Ssfdc_D_ReadRedtData(us,
Redundant)) {
if (Ssfdc_D_ReadRedtData(us, Redundant)) {
Ssfdc_D_Reset(us);
return ERROR;
}
......@@ -743,21 +738,20 @@ int Make_D_LogTable(struct us_data *us)
if (!Load_D_LogBlockAddr(Redundant)) {
if (Media.LogBlock != logblock) {
Media.PhyBlock = Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock] = phyblock;
Media.PhyBlock =
Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock] =
phyblock;
}
} else {
Media.PhyBlock = Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock] = phyblock;
}
}
}
Media.Sector = 0;
Media.PhyBlock = phyblock;
} /* End for (Media.PhyBlock<Ssfdc.MaxBlocks) */
AssignStart[Media.Zone] = 0;
} /* End for (Media.Zone<MAX_ZONENUM) */
......
......@@ -93,33 +93,38 @@ static void usb_stor_print_cmd(struct us_data *us, struct scsi_cmnd *srb)
switch (cmd) {
case TEST_UNIT_READY:
/* dev_dbg(
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */
/* dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */
break;
case INQUIRY:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_INQUIRY\n", cmd);
dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_INQUIRY\n", cmd);
break;
case MODE_SENSE:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd);
dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_MODE_SENSE\n", cmd);
break;
case START_STOP:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_START_STOP\n", cmd);
dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_START_STOP\n", cmd);
break;
case READ_CAPACITY:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd);
dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_READ_CAPACITY\n", cmd);
break;
case READ_10:
/* dev_dbg(
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n"
/* dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n"
cmd, bn, blen); */
break;
case WRITE_10:
/* dev_dbg(
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_WRITE,
bn = %X, blen = %X\n" , cmd, bn, blen); */
/* dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_WRITE, bn = %X, blen = %X\n",
cmd, bn, blen); */
break;
case ALLOW_MEDIUM_REMOVAL:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd);
dev_dbg(&us->pusb_dev->dev,
"scsi cmd %X --- SCSIOP_ALLOW_MEDIUM_REMOVAL\n", cmd);
break;
default:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- Other cmd\n", cmd);
......
......@@ -150,7 +150,7 @@ void fill_inquiry_response(struct us_data *us, unsigned char *data,
usb_stor_set_xfer_buf(us, data, data_len, us->srb, TO_XFER_BUF);
}
static int usb_stor_control_thread(void * __us)
static int usb_stor_control_thread(void *__us)
{
struct us_data *us = (struct us_data *)__us;
struct Scsi_Host *host = us_to_host(us);
......@@ -493,7 +493,7 @@ static void release_everything(struct us_data *us)
scsi_host_put(us_to_host(us));
}
static int usb_stor_scan_thread(void * __us)
static int usb_stor_scan_thread(void *__us)
{
struct us_data *us = (struct us_data *)__us;
......@@ -604,9 +604,9 @@ static int eucr_probe(struct usb_interface *intf,
if (!(MiscReg03 & 0x02)) {
result = -ENODEV;
quiesce_and_remove_host(us);
pr_info("keucr: The driver only supports SM/MS card.\
To use SD card, \
please build driver/usb/storage/ums-eneub6250.ko\n");
pr_info("keucr: The driver only supports SM/MS card. "
"To use SD card, "
"please build driver/usb/storage/ums-eneub6250.ko\n");
goto BadDevice;
}
......
......@@ -19,8 +19,8 @@ struct scsi_cmnd;
*/
struct us_unusual_dev {
const char* vendorName;
const char* productName;
const char *vendorName;
const char *productName;
__u8 useProtocol;
__u8 useTransport;
int (*initFunction)(struct us_data *);
......@@ -108,9 +108,9 @@ struct keucr_sm_status {
#define US_IOBUF_SIZE 64 /* Size of the DMA-mapped I/O buffer */
#define US_SENSE_SIZE 18 /* Size of the autosense data buffer */
typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data*);
typedef int (*trans_reset)(struct us_data*);
typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*);
typedef int (*trans_cmnd)(struct scsi_cmnd *, struct us_data *);
typedef int (*trans_reset)(struct us_data *);
typedef void (*proto_cmnd)(struct scsi_cmnd *, struct us_data *);
typedef void (*extra_data_destructor)(void *); /* extra data destructor */
typedef void (*pm_hook)(struct us_data *, int); /* power management hook */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment