Skip to content

Commit

Permalink
usb: storage: fix multi-line comment style
Browse files Browse the repository at this point in the history
No functional changes here, just making sure our
storage driver uses a consistent multi-line comment
style.

Signed-off-by: Felipe Balbi <felipe.balbi@linux.intel.com>
Acked-by: Alan Stern <stern@rowland.harvard.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
  • Loading branch information
Felipe Balbi authored and Greg Kroah-Hartman committed Apr 26, 2016
1 parent 5b91dfe commit f0183a3
Show file tree
Hide file tree
Showing 42 changed files with 829 additions and 455 deletions.
22 changes: 14 additions & 8 deletions drivers/usb/storage/alauda.c
Original file line number Diff line number Diff line change
Expand Up @@ -829,8 +829,10 @@ static int alauda_write_lba(struct us_data *us, u16 lba,

pba = MEDIA_INFO(us).lba_to_pba[zone][lba_offset];
if (pba == 1) {
/* Maybe it is impossible to write to PBA 1.
Fake success, but don't do anything. */
/*
* Maybe it is impossible to write to PBA 1.
* Fake success, but don't do anything.
*/
printk(KERN_WARNING
"alauda_write_lba: avoid writing to pba 1\n");
return USB_STOR_TRANSPORT_GOOD;
Expand Down Expand Up @@ -977,10 +979,12 @@ static int alauda_read_data(struct us_data *us, unsigned long address,
usb_stor_dbg(us, "Read %d zero pages (LBA %d) page %d\n",
pages, lba, page);

/* This is not really an error. It just means
that the block has never been written.
Instead of returning USB_STOR_TRANSPORT_ERROR
it is better to return all zero data. */
/*
* This is not really an error. It just means
* that the block has never been written.
* Instead of returning USB_STOR_TRANSPORT_ERROR
* it is better to return all zero data.
*/

memset(buffer, 0, len);
} else {
Expand Down Expand Up @@ -1222,8 +1226,10 @@ static int alauda_transport(struct scsi_cmnd *srb, struct us_data *us)
}

if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
/* sure. whatever. not like we can stop the user from popping
the media out of the device (no locking doors, etc) */
/*
* sure. whatever. not like we can stop the user from popping
* the media out of the device (no locking doors, etc)
*/
return USB_STOR_TRANSPORT_GOOD;
}

Expand Down
34 changes: 20 additions & 14 deletions drivers/usb/storage/cypress_atacb.c
Original file line number Diff line number Diff line change
Expand Up @@ -110,13 +110,17 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
/* first build the ATACB command */
srb->cmd_len = 16;

srb->cmnd[0] = 0x24; /* bVSCBSignature : vendor-specific command
this value can change, but most(all ?) manufacturers
keep the cypress default : 0x24 */
srb->cmnd[0] = 0x24; /*
* bVSCBSignature : vendor-specific command
* this value can change, but most(all ?) manufacturers
* keep the cypress default : 0x24
*/
srb->cmnd[1] = 0x24; /* bVSCBSubCommand : 0x24 for ATACB */

srb->cmnd[3] = 0xff - 1; /* features, sector count, lba low, lba med
lba high, device, command are valid */
srb->cmnd[3] = 0xff - 1; /*
* features, sector count, lba low, lba med
* lba high, device, command are valid
*/
srb->cmnd[4] = 1; /* TransferBlockCount : 512 */

if (save_cmnd[0] == ATA_16) {
Expand Down Expand Up @@ -155,16 +159,16 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)

usb_stor_transparent_scsi_command(srb, us);

/* if the device doesn't support ATACB
*/
/* if the device doesn't support ATACB */
if (srb->result == SAM_STAT_CHECK_CONDITION &&
memcmp(srb->sense_buffer, usb_stor_sense_invalidCDB,
sizeof(usb_stor_sense_invalidCDB)) == 0) {
usb_stor_dbg(us, "cypress atacb not supported ???\n");
goto end;
}

/* if ck_cond flags is set, and there wasn't critical error,
/*
* if ck_cond flags is set, and there wasn't critical error,
* build the special sense
*/
if ((srb->result != (DID_ERROR << 16) &&
Expand All @@ -176,11 +180,11 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
unsigned char *desc = sb + 8;
int tmp_result;

/* build the command for
* reading the ATA registers */
/* build the command for reading the ATA registers */
scsi_eh_prep_cmnd(srb, &ses, NULL, 0, sizeof(regs));

/* we use the same command as before, but we set
/*
* we use the same command as before, but we set
* the read taskfile bit, for not executing atacb command,
* but reading register selected in srb->cmnd[4]
*/
Expand All @@ -204,10 +208,11 @@ static void cypress_atacb_passthrough(struct scsi_cmnd *srb, struct us_data *us)
sb[2] = 0; /* ATA PASS THROUGH INFORMATION AVAILABLE */
sb[3] = 0x1D;

/* XXX we should generate sk, asc, ascq from status and error
/*
* XXX we should generate sk, asc, ascq from status and error
* regs
* (see 11.1 Error translation ATA device error to SCSI error
* map, and ata_to_sense_error from libata.)
* map, and ata_to_sense_error from libata.)
*/

/* Sense data is current and format is descriptor. */
Expand Down Expand Up @@ -258,7 +263,8 @@ static int cypress_probe(struct usb_interface *intf,
if (result)
return result;

/* Among CY7C68300 chips, the A revision does not support Cypress ATACB
/*
* Among CY7C68300 chips, the A revision does not support Cypress ATACB
* Filter out this revision from EEPROM default descriptor values
*/
device = interface_to_usbdev(intf);
Expand Down
22 changes: 14 additions & 8 deletions drivers/usb/storage/datafab.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Driver for Datafab USB Compact Flash reader
/*
* Driver for Datafab USB Compact Flash reader
*
* datafab driver v0.1:
*
Expand Down Expand Up @@ -693,18 +694,23 @@ static int datafab_transport(struct scsi_cmnd *srb, struct us_data *us)
}

if (srb->cmnd[0] == ALLOW_MEDIUM_REMOVAL) {
// sure. whatever. not like we can stop the user from
// popping the media out of the device (no locking doors, etc)
//
/*
* sure. whatever. not like we can stop the user from
* popping the media out of the device (no locking doors, etc)
*/
return USB_STOR_TRANSPORT_GOOD;
}

if (srb->cmnd[0] == START_STOP) {
/* this is used by sd.c'check_scsidisk_media_change to detect
media change */
/*
* this is used by sd.c'check_scsidisk_media_change to detect
* media change
*/
usb_stor_dbg(us, "START_STOP\n");
/* the first datafab_id_device after a media change returns
an error (determined experimentally) */
/*
* the first datafab_id_device after a media change returns
* an error (determined experimentally)
*/
rc = datafab_id_device(us, info);
if (rc == USB_STOR_TRANSPORT_GOOD) {
info->sense_key = NO_SENSE;
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/storage/debug.c
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Driver for USB Mass Storage compliant devices
/*
* Driver for USB Mass Storage compliant devices
* Debugging Functions Source Code File
*
* Current development and maintenance by:
Expand Down
3 changes: 2 additions & 1 deletion drivers/usb/storage/debug.h
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
/* Driver for USB Mass Storage compliant devices
/*
* Driver for USB Mass Storage compliant devices
* Debugging Functions Header File
*
* Current development and maintenance by:
Expand Down
25 changes: 8 additions & 17 deletions drivers/usb/storage/ene_ub6250.c
Original file line number Diff line number Diff line change
Expand Up @@ -560,8 +560,10 @@ static int ene_send_scsi_cmd(struct us_data *us, u8 fDir, void *buf, int use_sg)
/* check bulk status */
residue = le32_to_cpu(bcs->Residue);

/* try to compute the actual residue, based on how much data
* was really transferred and what the device tells us */
/*
* try to compute the actual residue, based on how much data
* was really transferred and what the device tells us
*/
if (residue && !(us->fflags & US_FL_IGNORE_RESIDUE)) {
residue = min(residue, transfer_length);
if (us->srb != NULL)
Expand Down Expand Up @@ -862,9 +864,6 @@ static int ms_read_readpage(struct us_data *us, u32 PhyBlockAddr,
u8 ExtBuf[4];
u32 bn = PhyBlockAddr * 0x20 + PageNum;

/* printk(KERN_INFO "MS --- MS_ReaderReadPage,
PhyBlockAddr = %x, PageNum = %x\n", PhyBlockAddr, PageNum); */

result = ene_load_bincode(us, MS_RW_PATTERN);
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
Expand Down Expand Up @@ -1141,8 +1140,6 @@ static int ms_read_copyblock(struct us_data *us, u16 oldphy, u16 newphy,
struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
int result;

/* printk(KERN_INFO "MS_ReaderCopyBlock --- PhyBlockAddr = %x,
PageNum = %x\n", PhyBlockAddr, PageNum); */
result = ene_load_bincode(us, MS_RW_PATTERN);
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
Expand Down Expand Up @@ -1176,8 +1173,6 @@ static int ms_read_eraseblock(struct us_data *us, u32 PhyBlockAddr)
int result;
u32 bn = PhyBlockAddr;

/* printk(KERN_INFO "MS --- ms_read_eraseblock,
PhyBlockAddr = %x\n", PhyBlockAddr); */
result = ene_load_bincode(us, MS_RW_PATTERN);
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
Expand Down Expand Up @@ -1255,8 +1250,6 @@ static int ms_lib_overwrite_extra(struct us_data *us, u32 PhyBlockAddr,
struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
int result;

/* printk("MS --- MS_LibOverwriteExtra,
PhyBlockAddr = %x, PageNum = %x\n", PhyBlockAddr, PageNum); */
result = ene_load_bincode(us, MS_RW_PATTERN);
if (result != USB_STOR_XFER_GOOD)
return USB_STOR_TRANSPORT_ERROR;
Expand Down Expand Up @@ -1342,7 +1335,6 @@ static int ms_lib_read_extra(struct us_data *us, u32 PhyBlock,
int result;
u8 ExtBuf[4];

/* printk("MS_LibReadExtra --- PhyBlock = %x, PageNum = %x\n", PhyBlock, PageNum); */
memset(bcb, 0, sizeof(struct bulk_cb_wrap));
bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
bcb->DataTransferLength = 0x4;
Expand Down Expand Up @@ -1541,9 +1533,6 @@ static int ms_lib_read_extrablock(struct us_data *us, u32 PhyBlock,
struct bulk_cb_wrap *bcb = (struct bulk_cb_wrap *) us->iobuf;
int result;

/* printk("MS_LibReadExtraBlock --- PhyBlock = %x,
PageNum = %x, blen = %x\n", PhyBlock, PageNum, blen); */

/* Read Extra Data */
memset(bcb, 0, sizeof(struct bulk_cb_wrap));
bcb->Signature = cpu_to_le32(US_BULK_CB_SIGN);
Expand Down Expand Up @@ -2390,8 +2379,10 @@ static int ene_ub6250_reset_resume(struct usb_interface *iface)
/* Report the reset to the SCSI core */
usb_stor_reset_resume(iface);

/* FIXME: Notify the subdrivers that they need to reinitialize
* the device */
/*
* FIXME: Notify the subdrivers that they need to reinitialize
* the device
*/
info->Power_IsResum = true;
/*info->SD_Status.Ready = 0; */
info->SD_Status = *(struct SD_STATUS *)&tmp;
Expand Down
Loading

0 comments on commit f0183a3

Please sign in to comment.