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) ...@@ -98,11 +98,16 @@ int ENE_SMInit(struct us_data *us)
us->SM_CardID = buf[2]; us->SM_CardID = buf[2];
if (us->SM_Status.Insert && us->SM_Status.Ready) { 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, "Insert = %x\n",
dev_info(&us->pusb_dev->dev, "Ready = %x\n", us->SM_Status.Ready); us->SM_Status.Insert);
dev_info(&us->pusb_dev->dev, "WtP = %x\n", us->SM_Status.WtP); dev_info(&us->pusb_dev->dev, "Ready = %x\n",
dev_info(&us->pusb_dev->dev, "DeviceID = %x\n", us->SM_DeviceID); us->SM_Status.Ready);
dev_info(&us->pusb_dev->dev, "CardID = %x\n", us->SM_CardID); 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; MediaChange = 1;
Check_D_MediaFmt(us); Check_D_MediaFmt(us);
} else { } else {
...@@ -174,7 +179,8 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg) ...@@ -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, result = usb_stor_bulk_transfer_buf(us, us->send_bulk_pipe,
bcb, US_BULK_CB_WRAP_LEN, NULL); bcb, US_BULK_CB_WRAP_LEN, NULL);
if (result != USB_STOR_XFER_GOOD) { 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; return USB_STOR_TRANSPORT_ERROR;
} }
...@@ -203,14 +209,16 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg) ...@@ -203,14 +209,16 @@ int ENE_SendScsiCmd(struct us_data *us, BYTE fDir, void *buf, int use_sg)
US_BULK_CS_WRAP_LEN, &cswlen); US_BULK_CS_WRAP_LEN, &cswlen);
if (result == USB_STOR_XFER_SHORT && cswlen == 0) { 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, result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, &cswlen); bcs, US_BULK_CS_WRAP_LEN, &cswlen);
} }
if (result == USB_STOR_XFER_STALLED) { if (result == USB_STOR_XFER_STALLED) {
/* get the status again */ /* 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, result = usb_stor_bulk_transfer_buf(us, us->recv_bulk_pipe,
bcs, US_BULK_CS_WRAP_LEN, NULL); bcs, US_BULK_CS_WRAP_LEN, NULL);
} }
......
...@@ -322,8 +322,9 @@ static ssize_t store_max_sectors(struct device *dev, ...@@ -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, static DEVICE_ATTR(max_sectors, S_IRUGO | S_IWUSR, show_max_sectors,
store_max_sectors); store_max_sectors);
static struct device_attribute *sysfs_device_attr_list[] = static struct device_attribute *sysfs_device_attr_list[] = {
{&dev_attr_max_sectors, NULL, }; &dev_attr_max_sectors, NULL,
};
/* this defines our host template, with which we'll allocate hosts */ /* 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) ...@@ -302,7 +302,7 @@ int Media_D_ReadOneSect(struct us_data *us, WORD count, BYTE *buf)
return ERROR; return ERROR;
#ifdef RDERR_REASSIGN #ifdef RDERR_REASSIGN
if (Ssfdc.Attribute &MWP) { if (Ssfdc.Attribute & MWP) {
if (ErrCode == ERR_CorReadErr) if (ErrCode == ERR_CorReadErr)
return SMSUCCESS; return SMSUCCESS;
return ERROR; return ERROR;
...@@ -675,90 +675,84 @@ int Make_D_LogTable(struct us_data *us) ...@@ -675,90 +675,84 @@ int Make_D_LogTable(struct us_data *us)
Media.Sector = 0; Media.Sector = 0;
{ /* pr_info("Make_D_LogTable --- MediaZone = 0x%x\n",
/* pr_info("Make_D_LogTable --- MediaZone = 0x%x\n", Media.Zone); */
Media.Zone); */ for (Media.LogBlock = 0; Media.LogBlock < Ssfdc.MaxLogBlocks;
for (Media.LogBlock = 0; Media.LogBlock < Ssfdc.MaxLogBlocks; Media.LogBlock++)
Media.LogBlock++) Log2Phy[Media.Zone][Media.LogBlock] = NO_ASSIGN;
Log2Phy[Media.Zone][Media.LogBlock] = NO_ASSIGN;
for (Media.PhyBlock = 0; Media.PhyBlock < (MAX_BLOCKNUM / 8);
Media.PhyBlock++)
Assign[Media.Zone][Media.PhyBlock] = 0x00;
for (Media.PhyBlock = 0; Media.PhyBlock < Ssfdc.MaxBlocks;
Media.PhyBlock++) {
if ((!Media.Zone) &&
(Media.PhyBlock <= CisArea.PhyBlock)) {
Set_D_Bit(Assign[Media.Zone], Media.PhyBlock);
continue;
}
if (Ssfdc_D_ReadRedtData(us, Redundant)) { for (Media.PhyBlock = 0; Media.PhyBlock < (MAX_BLOCKNUM / 8);
Ssfdc_D_Reset(us); Media.PhyBlock++)
return ERROR; Assign[Media.Zone][Media.PhyBlock] = 0x00;
}
if (!Check_D_DataBlank(Redundant))
continue;
for (Media.PhyBlock = 0; Media.PhyBlock < Ssfdc.MaxBlocks;
Media.PhyBlock++) {
if ((!Media.Zone) && (Media.PhyBlock <= CisArea.PhyBlock)) {
Set_D_Bit(Assign[Media.Zone], Media.PhyBlock); Set_D_Bit(Assign[Media.Zone], Media.PhyBlock);
continue;
}
if (Check_D_FailBlock(Redundant)) if (Ssfdc_D_ReadRedtData(us, Redundant)) {
continue; Ssfdc_D_Reset(us);
return ERROR;
}
if (!Check_D_DataBlank(Redundant))
continue;
if (Load_D_LogBlockAddr(Redundant)) Set_D_Bit(Assign[Media.Zone], Media.PhyBlock);
continue;
if (Media.LogBlock >= Ssfdc.MaxLogBlocks) if (Check_D_FailBlock(Redundant))
continue; continue;
if (Log2Phy[Media.Zone][Media.LogBlock] == NO_ASSIGN) { if (Load_D_LogBlockAddr(Redundant))
Log2Phy[Media.Zone][Media.LogBlock] = continue;
Media.PhyBlock;
continue;
}
phyblock = Media.PhyBlock; if (Media.LogBlock >= Ssfdc.MaxLogBlocks)
logblock = Media.LogBlock; continue;
Media.Sector = (BYTE)(Ssfdc.MaxSectors - 1);
if (Log2Phy[Media.Zone][Media.LogBlock] == NO_ASSIGN) {
Log2Phy[Media.Zone][Media.LogBlock] = Media.PhyBlock;
continue;
}
phyblock = Media.PhyBlock;
logblock = Media.LogBlock;
Media.Sector = (BYTE)(Ssfdc.MaxSectors - 1);
if (Ssfdc_D_ReadRedtData(us, Redundant)) {
Ssfdc_D_Reset(us);
return ERROR;
}
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); Ssfdc_D_Reset(us);
return ERROR; return ERROR;
} }
Media.PhyBlock = phyblock;
if (!Load_D_LogBlockAddr(Redundant)) { if (!Load_D_LogBlockAddr(Redundant)) {
if (Media.LogBlock == logblock) { if (Media.LogBlock != logblock) {
Media.PhyBlock = Media.PhyBlock =
Log2Phy[Media.Zone][logblock]; Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock] =
if (Ssfdc_D_ReadRedtData(us, phyblock;
Redundant)) {
Ssfdc_D_Reset(us);
return ERROR;
}
Media.PhyBlock = phyblock;
if (!Load_D_LogBlockAddr(Redundant)) {
if (Media.LogBlock != logblock) {
Media.PhyBlock = Log2Phy[Media.Zone][logblock];
Log2Phy[Media.Zone][logblock] = phyblock;
}
} else {
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.Sector = 0;
Media.PhyBlock = phyblock; Media.PhyBlock = phyblock;
} /* End for (Media.PhyBlock<Ssfdc.MaxBlocks) */
AssignStart[Media.Zone] = 0; AssignStart[Media.Zone] = 0;
} /* End for (Media.Zone<MAX_ZONENUM) */ } /* End for (Media.Zone<MAX_ZONENUM) */
......
...@@ -93,33 +93,38 @@ static void usb_stor_print_cmd(struct us_data *us, struct scsi_cmnd *srb) ...@@ -93,33 +93,38 @@ static void usb_stor_print_cmd(struct us_data *us, struct scsi_cmnd *srb)
switch (cmd) { switch (cmd) {
case TEST_UNIT_READY: case TEST_UNIT_READY:
/* dev_dbg( /* dev_dbg(&us->pusb_dev->dev,
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */ "scsi cmd %X --- SCSIOP_TEST_UNIT_READY\n", cmd); */
break; break;
case INQUIRY: 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; break;
case MODE_SENSE: 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; break;
case START_STOP: 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; break;
case READ_CAPACITY: 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; break;
case READ_10: case READ_10:
/* dev_dbg( /* dev_dbg(&us->pusb_dev->dev,
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n" "scsi cmd %X --- SCSIOP_READ,bn = %X, blen = %X\n"
cmd, bn, blen); */ cmd, bn, blen); */
break; break;
case WRITE_10: case WRITE_10:
/* dev_dbg( /* dev_dbg(&us->pusb_dev->dev,
&us->pusb_dev->dev, "scsi cmd %X --- SCSIOP_WRITE, "scsi cmd %X --- SCSIOP_WRITE, bn = %X, blen = %X\n",
bn = %X, blen = %X\n" , cmd, bn, blen); */ cmd, bn, blen); */
break; break;
case ALLOW_MEDIUM_REMOVAL: 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; break;
default: default:
dev_dbg(&us->pusb_dev->dev, "scsi cmd %X --- Other cmd\n", cmd); 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, ...@@ -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); 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 us_data *us = (struct us_data *)__us;
struct Scsi_Host *host = us_to_host(us); struct Scsi_Host *host = us_to_host(us);
...@@ -493,7 +493,7 @@ static void release_everything(struct us_data *us) ...@@ -493,7 +493,7 @@ static void release_everything(struct us_data *us)
scsi_host_put(us_to_host(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; struct us_data *us = (struct us_data *)__us;
...@@ -604,9 +604,9 @@ static int eucr_probe(struct usb_interface *intf, ...@@ -604,9 +604,9 @@ static int eucr_probe(struct usb_interface *intf,
if (!(MiscReg03 & 0x02)) { if (!(MiscReg03 & 0x02)) {
result = -ENODEV; result = -ENODEV;
quiesce_and_remove_host(us); quiesce_and_remove_host(us);
pr_info("keucr: The driver only supports SM/MS card.\ pr_info("keucr: The driver only supports SM/MS card. "
To use SD card, \ "To use SD card, "
please build driver/usb/storage/ums-eneub6250.ko\n"); "please build driver/usb/storage/ums-eneub6250.ko\n");
goto BadDevice; goto BadDevice;
} }
......
...@@ -19,8 +19,8 @@ struct scsi_cmnd; ...@@ -19,8 +19,8 @@ struct scsi_cmnd;
*/ */
struct us_unusual_dev { struct us_unusual_dev {
const char* vendorName; const char *vendorName;
const char* productName; const char *productName;
__u8 useProtocol; __u8 useProtocol;
__u8 useTransport; __u8 useTransport;
int (*initFunction)(struct us_data *); int (*initFunction)(struct us_data *);
...@@ -108,9 +108,9 @@ struct keucr_sm_status { ...@@ -108,9 +108,9 @@ struct keucr_sm_status {
#define US_IOBUF_SIZE 64 /* Size of the DMA-mapped I/O buffer */ #define US_IOBUF_SIZE 64 /* Size of the DMA-mapped I/O buffer */
#define US_SENSE_SIZE 18 /* Size of the autosense data 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_cmnd)(struct scsi_cmnd *, struct us_data *);
typedef int (*trans_reset)(struct us_data*); typedef int (*trans_reset)(struct us_data *);
typedef void (*proto_cmnd)(struct scsi_cmnd*, struct us_data*); typedef void (*proto_cmnd)(struct scsi_cmnd *, struct us_data *);
typedef void (*extra_data_destructor)(void *); /* extra data destructor */ typedef void (*extra_data_destructor)(void *); /* extra data destructor */
typedef void (*pm_hook)(struct us_data *, int); /* power management hook */ typedef void (*pm_hook)(struct us_data *, int); /* power management hook */
...@@ -215,7 +215,7 @@ struct us_data { ...@@ -215,7 +215,7 @@ struct us_data {
int SrbStatus; int SrbStatus;
/* ------Power Managerment --------------- */ /* ------Power Managerment --------------- */
BOOLEAN Power_IsResum; BOOLEAN Power_IsResum;
}; };
/* Convert between us_data and the corresponding Scsi_Host */ /* Convert between us_data and the corresponding Scsi_Host */
......
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