* [PATCH 1/6] mmc: vub300: Formatting cleanup.
@ 2011-05-16 0:21 Chris Ball
2011-05-16 0:21 ` [PATCH 2/6] mmc: vub300: add whitespace after module_param decls Chris Ball
` (4 more replies)
0 siblings, 5 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
This patch makes whitespace-only changes to vub300 to bring it more in
line with MMC/kernel codingstyle. No difference in generated code.
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 372 ++++++++++++++++++++-------------------------
1 files changed, 163 insertions(+), 209 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 5762709..04d445b 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -460,7 +460,7 @@ static void irqpoll_out_completed(struct urb *urb)
} else {
int ret;
unsigned int pipe =
- usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep);
+ usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep);
usb_fill_bulk_urb(vub300->command_res_urb, vub300->udev, pipe,
&vub300->resp, sizeof(vub300->resp),
irqpoll_res_completed, vub300);
@@ -476,9 +476,7 @@ static void irqpoll_out_completed(struct urb *urb)
static void send_irqpoll(struct vub300_mmc_host *vub300)
{
- /*
- * cmd_mutex is held by vub300_pollwork_thread
- */
+ /* cmd_mutex is held by vub300_pollwork_thread */
int retval;
int timeout = 0xFFFF & (0x0001FFFF - firmware_irqpoll_timeout);
vub300->cmnd.poll.header_size = 22;
@@ -506,9 +504,9 @@ static void new_system_port_status(struct vub300_mmc_host *vub300)
{
int old_card_present = vub300->card_present;
int new_card_present =
- (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0;
+ (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0;
vub300->read_only =
- (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
+ (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
if (new_card_present && !old_card_present) {
dev_info(&vub300->udev->dev, "card just inserted\n");
vub300->card_present = 1;
@@ -532,10 +530,9 @@ static void __add_offloaded_reg_to_fifo(struct vub300_mmc_host *vub300,
struct offload_registers_access
*register_access, u8 func)
{
- u8 r = vub300->fn[func].offload_point +
- vub300->fn[func].offload_count;
- memcpy(&vub300->fn[func].reg[MAXREGMASK & r]
- , register_access, sizeof(struct offload_registers_access));
+ u8 r = vub300->fn[func].offload_point + vub300->fn[func].offload_count;
+ memcpy(&vub300->fn[func].reg[MAXREGMASK & r], register_access,
+ sizeof(struct offload_registers_access));
vub300->fn[func].offload_count += 1;
vub300->total_offload_count += 1;
}
@@ -550,9 +547,8 @@ static void add_offloaded_reg(struct vub300_mmc_host *vub300,
u8 regs = vub300->dynamic_register_count;
u8 i = 0;
while (0 < regs-- && 1 == vub300->sdio_register[i].activate) {
- if ((vub300->sdio_register[i].func_num == func)
- && (vub300->sdio_register[i].sdio_reg == Register)
- ) {
+ if (vub300->sdio_register[i].func_num == func &&
+ vub300->sdio_register[i].sdio_reg == Register) {
if (vub300->sdio_register[i].prepared == 0)
vub300->sdio_register[i].prepared = 1;
vub300->sdio_register[i].response =
@@ -576,21 +572,18 @@ static void check_vub300_port_status(struct vub300_mmc_host *vub300)
*/
int retval;
retval =
- usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
- GET_SYSTEM_PORT_STATUS,
- USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0x0000, 0x0000, &vub300->system_port_status,
- sizeof(vub300->system_port_status), HZ);
+ usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+ GET_SYSTEM_PORT_STATUS,
+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x0000, 0x0000, &vub300->system_port_status,
+ sizeof(vub300->system_port_status), HZ);
if (sizeof(vub300->system_port_status) == retval)
new_system_port_status(vub300);
}
static void __vub300_irqpoll_response(struct vub300_mmc_host *vub300)
{
- /*
- * cmd_mutex is held by vub300_pollwork_thread
- */
-
+ /* cmd_mutex is held by vub300_pollwork_thread */
if (vub300->command_res_urb->actual_length == 0)
return;
@@ -662,15 +655,13 @@ static void __vub300_irqpoll_response(struct vub300_mmc_host *vub300)
static void __do_poll(struct vub300_mmc_host *vub300)
{
- /*
- * cmd_mutex is held by vub300_pollwork_thread
- */
+ /* cmd_mutex is held by vub300_pollwork_thread */
long commretval;
mod_timer(&vub300->inactivity_timer, jiffies + HZ);
init_completion(&vub300->irqpoll_complete);
send_irqpoll(vub300);
commretval = wait_for_completion_timeout(&vub300->irqpoll_complete,
- msecs_to_jiffies(500));
+ msecs_to_jiffies(500));
if (vub300->usb_transport_fail) {
/* no need to do anything */
} else if (commretval == 0) {
@@ -690,7 +681,7 @@ static void __do_poll(struct vub300_mmc_host *vub300)
static void vub300_pollwork_thread(struct work_struct *work)
{ /* NOT irq */
struct vub300_mmc_host *vub300 = container_of(work,
- struct vub300_mmc_host, pollwork.work);
+ struct vub300_mmc_host, pollwork.work);
if (!vub300->interface) {
kref_put(&vub300->kref, vub300_delete);
return;
@@ -721,7 +712,7 @@ static void vub300_pollwork_thread(struct work_struct *work)
static void vub300_deadwork_thread(struct work_struct *work)
{ /* NOT irq */
struct vub300_mmc_host *vub300 =
- container_of(work, struct vub300_mmc_host, deadwork);
+ container_of(work, struct vub300_mmc_host, deadwork);
if (!vub300->interface) {
kref_put(&vub300->kref, vub300_delete);
return;
@@ -805,18 +796,14 @@ static void command_res_completed(struct urb *urb)
{ /* urb completion handler - hardirq */
struct vub300_mmc_host *vub300 = (struct vub300_mmc_host *)urb->context;
if (urb->status) {
- /*
- * we have to let the initiator handle the error
- */
+ /* we have to let the initiator handle the error */
} else if (vub300->command_res_urb->actual_length == 0) {
/*
* we have seen this happen once or twice and
* we suspect a buggy USB host controller
*/
} else if (!vub300->data) {
- /*
- * this means that the command (typically CMD52) suceeded
- */
+ /* this means that the command (typically CMD52) suceeded */
} else if (vub300->resp.common.header_type != 0x02) {
/*
* this is an error response from the VUB300 chip
@@ -824,11 +811,11 @@ static void command_res_completed(struct urb *urb)
*/
} else if (vub300->urb) {
vub300->cmd->error =
- vub300_response_error(vub300->resp.error.error_code);
+ vub300_response_error(vub300->resp.error.error_code);
usb_unlink_urb(vub300->urb);
} else {
vub300->cmd->error =
- vub300_response_error(vub300->resp.error.error_code);
+ vub300_response_error(vub300->resp.error.error_code);
usb_sg_cancel(&vub300->sg_request);
}
complete(&vub300->command_complete); /* got_response_in */
@@ -842,7 +829,7 @@ static void command_out_completed(struct urb *urb)
} else {
int ret;
unsigned int pipe =
- usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep);
+ usb_rcvbulkpipe(vub300->udev, vub300->cmnd_res_ep);
usb_fill_bulk_urb(vub300->command_res_urb, vub300->udev, pipe,
&vub300->resp, sizeof(vub300->resp),
command_res_completed, vub300);
@@ -1119,31 +1106,31 @@ static void send_command(struct vub300_mmc_host *vub300)
int fn = 0x7 & (cmd->arg >> 28);
if (0x08 & vub300->cmnd.head.arguments[0]) { /* BLOCK MODE */
vub300->cmnd.head.block_count[0] =
- (data->blocks >> 8) & 0xFF;
+ (data->blocks >> 8) & 0xFF;
vub300->cmnd.head.block_count[1] =
- (data->blocks >> 0) & 0xFF;
+ (data->blocks >> 0) & 0xFF;
vub300->cmnd.head.block_size[0] =
- (data->blksz >> 8) & 0xFF;
+ (data->blksz >> 8) & 0xFF;
vub300->cmnd.head.block_size[1] =
- (data->blksz >> 0) & 0xFF;
+ (data->blksz >> 0) & 0xFF;
} else { /* BYTE MODE */
vub300->cmnd.head.block_count[0] = 0;
vub300->cmnd.head.block_count[1] = 0;
vub300->cmnd.head.block_size[0] =
- (vub300->datasize >> 8) & 0xFF;
+ (vub300->datasize >> 8) & 0xFF;
vub300->cmnd.head.block_size[1] =
- (vub300->datasize >> 0) & 0xFF;
+ (vub300->datasize >> 0) & 0xFF;
}
vub300->cmnd.head.command_type =
- (MMC_DATA_READ & data->flags) ? 0x00 : 0x80;
+ (MMC_DATA_READ & data->flags) ? 0x00 : 0x80;
vub300->cmnd.head.transfer_size[0] =
- (vub300->datasize >> 24) & 0xFF;
+ (vub300->datasize >> 24) & 0xFF;
vub300->cmnd.head.transfer_size[1] =
- (vub300->datasize >> 16) & 0xFF;
+ (vub300->datasize >> 16) & 0xFF;
vub300->cmnd.head.transfer_size[2] =
- (vub300->datasize >> 8) & 0xFF;
+ (vub300->datasize >> 8) & 0xFF;
vub300->cmnd.head.transfer_size[3] =
- (vub300->datasize >> 0) & 0xFF;
+ (vub300->datasize >> 0) & 0xFF;
if (vub300->datasize < vub300->fbs[fn]) {
vub300->cmnd.head.block_count[0] = 0;
vub300->cmnd.head.block_count[1] = 0;
@@ -1154,30 +1141,29 @@ static void send_command(struct vub300_mmc_host *vub300)
vub300->cmnd.head.block_size[0] = (data->blksz >> 8) & 0xFF;
vub300->cmnd.head.block_size[1] = (data->blksz >> 0) & 0xFF;
vub300->cmnd.head.command_type =
- (MMC_DATA_READ & data->flags) ? 0x00 : 0x80;
+ (MMC_DATA_READ & data->flags) ? 0x00 : 0x80;
vub300->cmnd.head.transfer_size[0] =
- (vub300->datasize >> 24) & 0xFF;
+ (vub300->datasize >> 24) & 0xFF;
vub300->cmnd.head.transfer_size[1] =
- (vub300->datasize >> 16) & 0xFF;
+ (vub300->datasize >> 16) & 0xFF;
vub300->cmnd.head.transfer_size[2] =
- (vub300->datasize >> 8) & 0xFF;
+ (vub300->datasize >> 8) & 0xFF;
vub300->cmnd.head.transfer_size[3] =
- (vub300->datasize >> 0) & 0xFF;
+ (vub300->datasize >> 0) & 0xFF;
if (vub300->datasize < vub300->fbs[0]) {
vub300->cmnd.head.block_count[0] = 0;
vub300->cmnd.head.block_count[1] = 0;
}
}
- if (vub300->cmnd.head.block_size[0]
- || vub300->cmnd.head.block_size[1]) {
- u16 block_size = vub300->cmnd.head.block_size[1]
- | (vub300->cmnd.head.block_size[0] << 8);
+ if (vub300->cmnd.head.block_size[0] || vub300->cmnd.head.block_size[1]) {
+ u16 block_size = vub300->cmnd.head.block_size[1] |
+ (vub300->cmnd.head.block_size[0] << 8);
u16 block_boundary = FIRMWARE_BLOCK_BOUNDARY -
- (FIRMWARE_BLOCK_BOUNDARY % block_size);
+ (FIRMWARE_BLOCK_BOUNDARY % block_size);
vub300->cmnd.head.block_boundary[0] =
- (block_boundary >> 8) & 0xFF;
+ (block_boundary >> 8) & 0xFF;
vub300->cmnd.head.block_boundary[1] =
- (block_boundary >> 0) & 0xFF;
+ (block_boundary >> 0) & 0xFF;
} else {
vub300->cmnd.head.block_boundary[0] = 0;
vub300->cmnd.head.block_boundary[1] = 0;
@@ -1257,12 +1243,12 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
size -= interrupt_size;
data += interrupt_size;
retval =
- usb_control_msg(vub300->udev,
- usb_sndctrlpipe(vub300->udev, 0),
- SET_INTERRUPT_PSEUDOCODE,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE, 0x0000, 0x0000,
- xfer_buffer, xfer_length, HZ);
+ usb_control_msg(vub300->udev,
+ usb_sndctrlpipe(vub300->udev, 0),
+ SET_INTERRUPT_PSEUDOCODE,
+ USB_DIR_OUT | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE, 0x0000, 0x0000,
+ xfer_buffer, xfer_length, HZ);
kfree(xfer_buffer);
if (retval < 0) {
strncpy(vub300->vub_name,
@@ -1304,12 +1290,12 @@ static void __download_offload_pseudocode(struct vub300_mmc_host *vub300,
size -= ts;
data += ts;
retval =
- usb_control_msg(vub300->udev,
- usb_sndctrlpipe(vub300->udev, 0),
- SET_TRANSFER_PSEUDOCODE,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE, 0x0000, 0x0000,
- xfer_buffer, xfer_length, HZ);
+ usb_control_msg(vub300->udev,
+ usb_sndctrlpipe(vub300->udev, 0),
+ SET_TRANSFER_PSEUDOCODE,
+ USB_DIR_OUT | USB_TYPE_VENDOR |
+ USB_RECIP_DEVICE, 0x0000, 0x0000,
+ xfer_buffer, xfer_length, HZ);
kfree(xfer_buffer);
if (retval < 0) {
strncpy(vub300->vub_name,
@@ -1460,8 +1446,8 @@ static int __command_read_data(struct vub300_mmc_host *vub300,
*/
int linear_length = vub300->datasize;
int padded_length = vub300->large_usb_packets ?
- ((511 + linear_length) >> 9) << 9 :
- ((63 + linear_length) >> 6) << 6;
+ ((511 + linear_length) >> 9) << 9 :
+ ((63 + linear_length) >> 6) << 6;
if ((padded_length == linear_length) || !pad_input_to_usb_pkt) {
int result;
unsigned pipe;
@@ -1477,8 +1463,8 @@ static int __command_read_data(struct vub300_mmc_host *vub300,
return 0;
} else {
vub300->sg_transfer_timer.expires =
- jiffies + msecs_to_jiffies(2000 +
- (linear_length / 16384));
+ jiffies + msecs_to_jiffies(2000 +
+ (linear_length / 16384));
add_timer(&vub300->sg_transfer_timer);
usb_sg_wait(&vub300->sg_request);
del_timer(&vub300->sg_transfer_timer);
@@ -1495,13 +1481,12 @@ static int __command_read_data(struct vub300_mmc_host *vub300,
u8 *buf = kmalloc(padded_length, GFP_KERNEL);
if (buf) {
int result;
- unsigned pipe =
- usb_rcvbulkpipe(vub300->udev, vub300->data_inp_ep);
+ unsigned pipe = usb_rcvbulkpipe(vub300->udev,
+ vub300->data_inp_ep);
int actual_length = 0;
- result =
- vub300_usb_bulk_msg(vub300, pipe, buf,
- padded_length, &actual_length,
- 2000 + (padded_length / 16384));
+ result = vub300_usb_bulk_msg(vub300, pipe, buf,
+ padded_length, &actual_length,
+ 2000 + (padded_length / 16384));
if (result < 0) {
cmd->error = result;
data->bytes_xfered = 0;
@@ -1545,13 +1530,11 @@ static int __command_write_data(struct vub300_mmc_host *vub300,
sizeof(vub300->padded_buffer));
memset(vub300->padded_buffer + linear_length, 0,
sizeof(vub300->padded_buffer) - linear_length);
- result =
- vub300_usb_bulk_msg(vub300, pipe, vub300->padded_buffer,
- sizeof(vub300->padded_buffer),
- &actual_length,
- 2000 +
- (sizeof(vub300->padded_buffer) /
- 16384));
+ result = vub300_usb_bulk_msg(vub300, pipe, vub300->padded_buffer,
+ sizeof(vub300->padded_buffer),
+ &actual_length, 2000 +
+ (sizeof(vub300->padded_buffer) /
+ 16384));
if (result < 0) {
cmd->error = result;
data->bytes_xfered = 0;
@@ -1560,7 +1543,7 @@ static int __command_write_data(struct vub300_mmc_host *vub300,
}
} else if ((!vub300->large_usb_packets && (0 < modulo_64_length))
|| (vub300->large_usb_packets && (64 > modulo_512_length))
- ) { /* don't you just love these work-rounds */
+ ) { /* don't you just love these work-rounds */
int padded_length = ((63 + linear_length) >> 6) << 6;
u8 *buf = kmalloc(padded_length, GFP_KERNEL);
if (buf) {
@@ -1571,9 +1554,9 @@ static int __command_write_data(struct vub300_mmc_host *vub300,
memset(buf + linear_length, 0,
padded_length - linear_length);
result =
- vub300_usb_bulk_msg(vub300, pipe, buf,
- padded_length, &actual_length,
- 2000 + padded_length / 16384);
+ vub300_usb_bulk_msg(vub300, pipe, buf,
+ padded_length, &actual_length,
+ 2000 + padded_length / 16384);
kfree(buf);
if (result < 0) {
cmd->error = result;
@@ -1599,8 +1582,8 @@ static int __command_write_data(struct vub300_mmc_host *vub300,
data->bytes_xfered = 0;
} else {
vub300->sg_transfer_timer.expires =
- jiffies + msecs_to_jiffies(2000 +
- linear_length / 16384);
+ jiffies + msecs_to_jiffies(2000 +
+ linear_length / 16384);
add_timer(&vub300->sg_transfer_timer);
usb_sg_wait(&vub300->sg_request);
if (cmd->error) {
@@ -1623,33 +1606,27 @@ static void __vub300_command_response(struct vub300_mmc_host *vub300,
struct mmc_command *cmd,
struct mmc_data *data, int data_length)
{
- /*
- * cmd_mutex is held by vub300_cmndwork_thread
- */
+ /* cmd_mutex is held by vub300_cmndwork_thread */
long respretval;
int msec_timeout = 1000 + data_length / 4;
respretval =
- wait_for_completion_timeout(&vub300->command_complete,
- msecs_to_jiffies(msec_timeout));
+ wait_for_completion_timeout(&vub300->command_complete,
+ msecs_to_jiffies(msec_timeout));
if (respretval == 0) { /* TIMED OUT */
- /*
- * we don't know which of "out" and "res" if any failed
- */
+ /* we don't know which of "out" and "res" if any failed */
int result;
vub300->usb_timed_out = 1;
usb_kill_urb(vub300->command_out_urb);
usb_kill_urb(vub300->command_res_urb);
cmd->error = -ETIMEDOUT;
- result =
- usb_lock_device_for_reset(vub300->udev, vub300->interface);
+ result = usb_lock_device_for_reset(vub300->udev,
+ vub300->interface);
if (result == 0) {
result = usb_reset_device(vub300->udev);
usb_unlock_device(vub300->udev);
}
} else if (respretval < 0) {
- /*
- * we don't know which of "out" and "res" if any failed
- */
+ /* we don't know which of "out" and "res" if any failed */
usb_kill_urb(vub300->command_out_urb);
usb_kill_urb(vub300->command_res_urb);
cmd->error = respretval;
@@ -1661,11 +1638,11 @@ static void __vub300_command_response(struct vub300_mmc_host *vub300,
} else if (vub300->command_out_urb->status) {
vub300->usb_transport_fail = vub300->command_out_urb->status;
cmd->error = -EPROTO == vub300->command_out_urb->status ?
- -ESHUTDOWN : vub300->command_out_urb->status;
+ -ESHUTDOWN : vub300->command_out_urb->status;
} else if (vub300->command_res_urb->status) {
vub300->usb_transport_fail = vub300->command_res_urb->status;
cmd->error = -EPROTO == vub300->command_res_urb->status ?
- -ESHUTDOWN : vub300->command_res_urb->status;
+ -ESHUTDOWN : vub300->command_res_urb->status;
} else if (vub300->resp.common.header_type == 0x00) {
/*
* the command completed successfully
@@ -1673,13 +1650,13 @@ static void __vub300_command_response(struct vub300_mmc_host *vub300,
*/
} else if (vub300->resp.common.header_type == RESPONSE_ERROR) {
cmd->error =
- vub300_response_error(vub300->resp.error.error_code);
+ vub300_response_error(vub300->resp.error.error_code);
if (vub300->data)
usb_sg_cancel(&vub300->sg_request);
} else if (vub300->resp.common.header_type == RESPONSE_PIGGYBACKED) {
int offloaded_data_length =
- vub300->resp.common.header_size -
- sizeof(struct sd_register_header);
+ vub300->resp.common.header_size -
+ sizeof(struct sd_register_header);
int register_count = offloaded_data_length >> 3;
int ri = 0;
while (register_count--) {
@@ -1687,13 +1664,13 @@ static void __vub300_command_response(struct vub300_mmc_host *vub300,
ri += 1;
}
vub300->resp.common.header_size =
- sizeof(struct sd_register_header);
+ sizeof(struct sd_register_header);
vub300->resp.common.header_type = 0x00;
cmd->error = 0;
} else if (vub300->resp.common.header_type == RESPONSE_PIG_DISABLED) {
int offloaded_data_length =
- vub300->resp.common.header_size -
- sizeof(struct sd_register_header);
+ vub300->resp.common.header_size -
+ sizeof(struct sd_register_header);
int register_count = offloaded_data_length >> 3;
int ri = 0;
while (register_count--) {
@@ -1712,13 +1689,13 @@ static void __vub300_command_response(struct vub300_mmc_host *vub300,
vub300->irq_disabled = 1;
mutex_unlock(&vub300->irq_mutex);
vub300->resp.common.header_size =
- sizeof(struct sd_register_header);
+ sizeof(struct sd_register_header);
vub300->resp.common.header_type = 0x00;
cmd->error = 0;
} else if (vub300->resp.common.header_type == RESPONSE_PIG_ENABLED) {
int offloaded_data_length =
- vub300->resp.common.header_size -
- sizeof(struct sd_register_header);
+ vub300->resp.common.header_size -
+ sizeof(struct sd_register_header);
int register_count = offloaded_data_length >> 3;
int ri = 0;
while (register_count--) {
@@ -1755,32 +1732,29 @@ static void construct_request_response(struct vub300_mmc_host *vub300,
u8 *r = vub300->resp.response.command_response;
if (bytes == 3) {
cmd->resp[words] = (r[1 + (words << 2)] << 24)
- | (r[2 + (words << 2)] << 16)
- | (r[3 + (words << 2)] << 8);
+ | (r[2 + (words << 2)] << 16)
+ | (r[3 + (words << 2)] << 8);
} else if (bytes == 2) {
cmd->resp[words] = (r[1 + (words << 2)] << 24)
- | (r[2 + (words << 2)] << 16);
+ | (r[2 + (words << 2)] << 16);
} else if (bytes == 1) {
cmd->resp[words] = (r[1 + (words << 2)] << 24);
}
while (words-- > 0) {
cmd->resp[words] = (r[1 + (words << 2)] << 24)
- | (r[2 + (words << 2)] << 16)
- | (r[3 + (words << 2)] << 8)
- | (r[4 + (words << 2)] << 0);
+ | (r[2 + (words << 2)] << 16)
+ | (r[3 + (words << 2)] << 8)
+ | (r[4 + (words << 2)] << 0);
}
if ((cmd->opcode == 53) && (0x000000FF & cmd->resp[0]))
cmd->resp[0] &= 0xFFFFFF00;
}
-/*
- * this thread runs only when there
- * is an upper level command req outstanding
- */
+/* this thread runs only when there is an upper level command req outstanding */
static void vub300_cmndwork_thread(struct work_struct *work)
{
struct vub300_mmc_host *vub300 =
- container_of(work, struct vub300_mmc_host, cmndwork);
+ container_of(work, struct vub300_mmc_host, cmndwork);
if (!vub300->interface) {
kref_put(&vub300->kref, vub300_delete);
return;
@@ -1837,26 +1811,23 @@ static void vub300_cmndwork_thread(struct work_struct *work)
static int examine_cyclic_buffer(struct vub300_mmc_host *vub300,
struct mmc_command *cmd, u8 Function)
{
- /*
- * cmd_mutex is held by vub300_mmc_request
- */
+ /* cmd_mutex is held by vub300_mmc_request */
u8 cmd0 = 0xFF & (cmd->arg >> 24);
u8 cmd1 = 0xFF & (cmd->arg >> 16);
u8 cmd2 = 0xFF & (cmd->arg >> 8);
u8 cmd3 = 0xFF & (cmd->arg >> 0);
int first = MAXREGMASK & vub300->fn[Function].offload_point;
struct offload_registers_access *rf = &vub300->fn[Function].reg[first];
- if (cmd0 == rf->command_byte[0]
- && cmd1 == rf->command_byte[1]
- && cmd2 == rf->command_byte[2]
- && cmd3 == rf->command_byte[3]
- ) {
+ if (cmd0 == rf->command_byte[0] &&
+ cmd1 == rf->command_byte[1] &&
+ cmd2 == rf->command_byte[2] &&
+ cmd3 == rf->command_byte[3]) {
u8 checksum = 0x00;
cmd->resp[1] = checksum << 24;
cmd->resp[0] = (rf->Respond_Byte[0] << 24)
- | (rf->Respond_Byte[1] << 16)
- | (rf->Respond_Byte[2] << 8)
- | (rf->Respond_Byte[3] << 0);
+ | (rf->Respond_Byte[1] << 16)
+ | (rf->Respond_Byte[2] << 8)
+ | (rf->Respond_Byte[3] << 0);
vub300->fn[Function].offload_point += 1;
vub300->fn[Function].offload_count -= 1;
vub300->total_offload_count -= 1;
@@ -1868,18 +1839,17 @@ static int examine_cyclic_buffer(struct vub300_mmc_host *vub300,
while (0 < register_count) {
int point = MAXREGMASK & register_point;
struct offload_registers_access *r =
- &vub300->fn[Function].reg[point];
- if (cmd0 == r->command_byte[0]
- && cmd1 == r->command_byte[1]
- && cmd2 == r->command_byte[2]
- && cmd3 == r->command_byte[3]
- ) {
+ &vub300->fn[Function].reg[point];
+ if (cmd0 == r->command_byte[0] &&
+ cmd1 == r->command_byte[1] &&
+ cmd2 == r->command_byte[2] &&
+ cmd3 == r->command_byte[3]) {
u8 checksum = 0x00;
cmd->resp[1] = checksum << 24;
cmd->resp[0] = (r->Respond_Byte[0] << 24)
- | (r->Respond_Byte[1] << 16)
- | (r->Respond_Byte[2] << 8)
- | (r->Respond_Byte[3] << 0);
+ | (r->Respond_Byte[1] << 16)
+ | (r->Respond_Byte[2] << 8)
+ | (r->Respond_Byte[3] << 0);
vub300->fn[Function].offload_point += delta;
vub300->fn[Function].offload_count -= delta;
vub300->total_offload_count -= delta;
@@ -1898,17 +1868,14 @@ static int examine_cyclic_buffer(struct vub300_mmc_host *vub300,
static int satisfy_request_from_offloaded_data(struct vub300_mmc_host *vub300,
struct mmc_command *cmd)
{
- /*
- * cmd_mutex is held by vub300_mmc_request
- */
+ /* cmd_mutex is held by vub300_mmc_request */
u8 regs = vub300->dynamic_register_count;
u8 i = 0;
u8 func = FUN(cmd);
u32 reg = REG(cmd);
while (0 < regs--) {
- if ((vub300->sdio_register[i].func_num == func)
- && (vub300->sdio_register[i].sdio_reg == reg)
- ) {
+ if ((vub300->sdio_register[i].func_num == func) &&
+ (vub300->sdio_register[i].sdio_reg == reg)) {
if (!vub300->sdio_register[i].prepared) {
return 0;
} else if ((0x80000000 & cmd->arg) == 0x80000000) {
@@ -1927,9 +1894,9 @@ static int satisfy_request_from_offloaded_data(struct vub300_mmc_host *vub300,
vub300->sdio_register[i].prepared = 0;
cmd->resp[1] = checksum << 24;
cmd->resp[0] = (rsp0 << 24)
- | (rsp1 << 16)
- | (rsp2 << 8)
- | (rsp3 << 0);
+ | (rsp1 << 16)
+ | (rsp2 << 8)
+ | (rsp3 << 0);
return 1;
}
} else {
@@ -2038,10 +2005,10 @@ static void __set_clock_speed(struct vub300_mmc_host *vub300, u8 buf[8],
}
}
retval =
- usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
- SET_CLOCK_SPEED,
- USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0x00, 0x00, buf, buf_array_size, HZ);
+ usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
+ SET_CLOCK_SPEED,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x00, 0x00, buf, buf_array_size, HZ);
if (retval != 8) {
dev_err(&vub300->udev->dev, "SET_CLOCK_SPEED"
" %dkHz failed with retval=%d\n", kHzClock, retval);
@@ -2060,23 +2027,17 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
mutex_lock(&vub300->cmd_mutex);
if ((ios->power_mode == MMC_POWER_OFF) && vub300->card_powered) {
vub300->card_powered = 0;
- usb_control_msg(vub300->udev,
- usb_sndctrlpipe(vub300->udev, 0),
- SET_SD_POWER,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE, 0x0000, 0x0000, NULL, 0,
- HZ);
- /*
- * must wait for the VUB300 u-proc to boot up
- */
+ usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
+ SET_SD_POWER,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x0000, 0x0000, NULL, 0, HZ);
+ /* must wait for the VUB300 u-proc to boot up */
msleep(600);
} else if ((ios->power_mode == MMC_POWER_UP) && !vub300->card_powered) {
- usb_control_msg(vub300->udev,
- usb_sndctrlpipe(vub300->udev, 0),
- SET_SD_POWER,
- USB_DIR_OUT | USB_TYPE_VENDOR |
- USB_RECIP_DEVICE, 0x0001, 0x0000, NULL, 0,
- HZ);
+ usb_control_msg(vub300->udev, usb_sndctrlpipe(vub300->udev, 0),
+ SET_SD_POWER,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x0001, 0x0000, NULL, 0, HZ);
msleep(600);
vub300->card_powered = 1;
} else if (ios->power_mode == MMC_POWER_ON) {
@@ -2086,9 +2047,7 @@ static void vub300_mmc_set_ios(struct mmc_host *mmc, struct mmc_ios *ios)
kfree(buf);
}
} else {
- /*
- * this should mean no change of state
- */
+ /* this should mean no change of state */
}
mutex_unlock(&vub300->cmd_mutex);
kref_put(&vub300->kref, vub300_delete);
@@ -2116,10 +2075,7 @@ static void vub300_enable_sdio_irq(struct mmc_host *mmc, int enable)
vub300->irq_enabled = 1;
vub300_queue_poll_work(vub300, 0);
} else if (vub300->irq_enabled) {
- /*
- * this should not happen
- * so we will just ignore it
- */
+ /* this should not happen, so we will just ignore it */
} else {
vub300->irq_enabled = 1;
vub300_queue_poll_work(vub300, 0);
@@ -2292,7 +2248,7 @@ static int vub300_probe(struct usb_interface *interface,
iface_desc = interface->cur_altsetting;
for (i = 0; i < iface_desc->desc.bNumEndpoints; ++i) {
struct usb_endpoint_descriptor *endpoint =
- &iface_desc->endpoint[i].desc;
+ &iface_desc->endpoint[i].desc;
dev_info(&vub300->udev->dev,
"vub300 testing %s EndPoint(%d) %02X\n",
usb_endpoint_is_bulk_in(endpoint) ? "BULK IN" :
@@ -2303,10 +2259,10 @@ static int vub300_probe(struct usb_interface *interface,
if (usb_endpoint_is_bulk_in(endpoint)) {
if (!vub300->cmnd_res_ep) {
vub300->cmnd_res_ep =
- endpoint->bEndpointAddress;
+ endpoint->bEndpointAddress;
} else if (!vub300->data_inp_ep) {
vub300->data_inp_ep =
- endpoint->bEndpointAddress;
+ endpoint->bEndpointAddress;
} else {
dev_warn(&vub300->udev->dev,
"ignoring"
@@ -2315,10 +2271,10 @@ static int vub300_probe(struct usb_interface *interface,
} else if (usb_endpoint_is_bulk_out(endpoint)) {
if (!vub300->cmnd_out_ep) {
vub300->cmnd_out_ep =
- endpoint->bEndpointAddress;
+ endpoint->bEndpointAddress;
} else if (!vub300->data_out_ep) {
vub300->data_out_ep =
- endpoint->bEndpointAddress;
+ endpoint->bEndpointAddress;
} else {
dev_warn(&vub300->udev->dev,
"ignoring"
@@ -2339,9 +2295,7 @@ static int vub300_probe(struct usb_interface *interface,
vub300->large_usb_packets ? "LARGE" : "SMALL",
vub300->cmnd_out_ep, vub300->cmnd_res_ep,
vub300->data_out_ep, vub300->data_inp_ep);
- /*
- * we have the expected EndPoints
- */
+ /* we have the expected EndPoints */
} else {
dev_err(&vub300->udev->dev,
"Could not find two sets of bulk-in/out endpoint pairs\n");
@@ -2349,18 +2303,18 @@ static int vub300_probe(struct usb_interface *interface,
goto error5;
}
retval =
- usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
- GET_HC_INF0,
- USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0x0000, 0x0000, &vub300->hc_info,
- sizeof(vub300->hc_info), HZ);
+ usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+ GET_HC_INF0,
+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x0000, 0x0000, &vub300->hc_info,
+ sizeof(vub300->hc_info), HZ);
if (retval < 0)
goto error5;
retval =
- usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
- SET_ROM_WAIT_STATES,
- USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
+ usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+ SET_ROM_WAIT_STATES,
+ USB_DIR_OUT | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ firmware_rom_wait_states, 0x0000, NULL, 0, HZ);
if (retval < 0)
goto error5;
dev_info(&vub300->udev->dev,
@@ -2371,18 +2325,18 @@ static int vub300_probe(struct usb_interface *interface,
pad_input_to_usb_pkt ? "padding input data to" : "with",
vub300->large_usb_packets ? 512 : 64);
retval =
- usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
- GET_SYSTEM_PORT_STATUS,
- USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
- 0x0000, 0x0000, &vub300->system_port_status,
- sizeof(vub300->system_port_status), HZ);
+ usb_control_msg(vub300->udev, usb_rcvctrlpipe(vub300->udev, 0),
+ GET_SYSTEM_PORT_STATUS,
+ USB_DIR_IN | USB_TYPE_VENDOR | USB_RECIP_DEVICE,
+ 0x0000, 0x0000, &vub300->system_port_status,
+ sizeof(vub300->system_port_status), HZ);
if (retval < 0) {
goto error4;
} else if (sizeof(vub300->system_port_status) == retval) {
vub300->card_present =
- (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0;
+ (0x0001 & vub300->system_port_status.port_flags) ? 1 : 0;
vub300->read_only =
- (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
+ (0x0010 & vub300->system_port_status.port_flags) ? 1 : 0;
} else {
goto error4;
}
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 2/6] mmc: vub300: add whitespace after module_param decls
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
@ 2011-05-16 0:21 ` Chris Ball
2011-05-16 0:21 ` [PATCH 3/6] mmc: vub300: Remove initialization of static ints to 0 Chris Ball
` (3 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 8 ++++++++
1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 04d445b..d5cff96 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -231,31 +231,39 @@ MODULE_LICENSE("GPL");
static int limit_speed_to_24_MHz = INITIALIZE_VALUE_TO_ZERO;
module_param(limit_speed_to_24_MHz, bool, 0644);
MODULE_PARM_DESC(limit_speed_to_24_MHz, "Limit Max SDIO Clock Speed to 24 MHz");
+
static int pad_input_to_usb_pkt = INITIALIZE_VALUE_TO_ZERO;
module_param(pad_input_to_usb_pkt, bool, 0644);
MODULE_PARM_DESC(pad_input_to_usb_pkt,
"Pad USB data input transfers to whole USB Packet");
+
static int disable_offload_processing = INITIALIZE_VALUE_TO_ZERO;
module_param(disable_offload_processing, bool, 0644);
MODULE_PARM_DESC(disable_offload_processing, "Disable Offload Processing");
+
static int force_1_bit_data_xfers = INITIALIZE_VALUE_TO_ZERO;
module_param(force_1_bit_data_xfers, bool, 0644);
MODULE_PARM_DESC(force_1_bit_data_xfers,
"Force SDIO Data Transfers to 1-bit Mode");
+
static int force_polling_for_irqs = INITIALIZE_VALUE_TO_ZERO;
module_param(force_polling_for_irqs, bool, 0644);
MODULE_PARM_DESC(force_polling_for_irqs, "Force Polling for SDIO interrupts");
+
static int firmware_irqpoll_timeout = 1024;
module_param(firmware_irqpoll_timeout, int, 0644);
MODULE_PARM_DESC(firmware_irqpoll_timeout, "VUB300 firmware irqpoll timeout");
+
static int force_max_req_size = 128;
module_param(force_max_req_size, int, 0644);
MODULE_PARM_DESC(force_max_req_size, "set max request size in kBytes");
+
#ifdef SMSC_DEVELOPMENT_BOARD
static int firmware_rom_wait_states = 0x04;
#else
static int firmware_rom_wait_states = 0x1C;
#endif
+
module_param(firmware_rom_wait_states, bool, 0644);
MODULE_PARM_DESC(firmware_rom_wait_states,
"ROM wait states byte=RRRIIEEE (Reserved Internal External)");
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 3/6] mmc: vub300: Remove initialization of static ints to 0.
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 2/6] mmc: vub300: add whitespace after module_param decls Chris Ball
@ 2011-05-16 0:21 ` Chris Ball
2011-05-16 0:21 ` [PATCH 4/6] mmc: vub300: loop cleanup Chris Ball
` (2 subsequent siblings)
4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
As Nicolas Pitre points out, we may omit initializing global variables
to 0 -- they are guaranteed to be automatically cleared to 0 at
run-time, and we save space in the compiled binary.
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 11 +++++------
1 files changed, 5 insertions(+), 6 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index d5cff96..ac2fa06 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -224,29 +224,28 @@ MODULE_AUTHOR("Tony Olech <tony.olech@elandigitalsystems.com>");
MODULE_DESCRIPTION("VUB300 USB to SD/MMC/SDIO adapter driver");
MODULE_LICENSE("GPL");
-#define INITIALIZE_VALUE_TO_ZERO 0
#define FUN(c) (0x000007 & (c->arg>>28))
#define REG(c) (0x01FFFF & (c->arg>>9))
-static int limit_speed_to_24_MHz = INITIALIZE_VALUE_TO_ZERO;
+static int limit_speed_to_24_MHz;
module_param(limit_speed_to_24_MHz, bool, 0644);
MODULE_PARM_DESC(limit_speed_to_24_MHz, "Limit Max SDIO Clock Speed to 24 MHz");
-static int pad_input_to_usb_pkt = INITIALIZE_VALUE_TO_ZERO;
+static int pad_input_to_usb_pkt;
module_param(pad_input_to_usb_pkt, bool, 0644);
MODULE_PARM_DESC(pad_input_to_usb_pkt,
"Pad USB data input transfers to whole USB Packet");
-static int disable_offload_processing = INITIALIZE_VALUE_TO_ZERO;
+static int disable_offload_processing;
module_param(disable_offload_processing, bool, 0644);
MODULE_PARM_DESC(disable_offload_processing, "Disable Offload Processing");
-static int force_1_bit_data_xfers = INITIALIZE_VALUE_TO_ZERO;
+static int force_1_bit_data_xfers;
module_param(force_1_bit_data_xfers, bool, 0644);
MODULE_PARM_DESC(force_1_bit_data_xfers,
"Force SDIO Data Transfers to 1-bit Mode");
-static int force_polling_for_irqs = INITIALIZE_VALUE_TO_ZERO;
+static int force_polling_for_irqs;
module_param(force_polling_for_irqs, bool, 0644);
MODULE_PARM_DESC(force_polling_for_irqs, "Force Polling for SDIO interrupts");
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 4/6] mmc: vub300: loop cleanup
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 2/6] mmc: vub300: add whitespace after module_param decls Chris Ball
2011-05-16 0:21 ` [PATCH 3/6] mmc: vub300: Remove initialization of static ints to 0 Chris Ball
@ 2011-05-16 0:21 ` Chris Ball
2011-05-16 0:21 ` [PATCH 5/6] mmc: vub300: MODULE_* cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 6/6] mmc: vub300: clean up multiline conditionals Chris Ball
4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
For loops that start with i=0, re-use a single counter int.
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 33 ++++++++++++++-------------------
1 files changed, 14 insertions(+), 19 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index ac2fa06..0463921 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -905,6 +905,7 @@ static void send_command(struct vub300_mmc_host *vub300)
struct mmc_command *cmd = vub300->cmd;
struct mmc_data *data = vub300->data;
int retval;
+ int i;
u8 response_type;
if (vub300->app_spec) {
switch (cmd->opcode) {
@@ -1014,14 +1015,11 @@ static void send_command(struct vub300_mmc_host *vub300)
vub300->resp_len = 0;
break;
case 16:
- {
- int i;
for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
vub300->fbs[i] = 0xFFFF & cmd->arg;
response_type = SDRT_1;
vub300->resp_len = 6;
break;
- }
case 17:
case 18:
case 24:
@@ -2215,33 +2213,30 @@ static int vub300_probe(struct usb_interface *interface,
vub300->command_res_urb = command_res_urb;
vub300->usb_timed_out = 0;
vub300->dynamic_register_count = 0;
- {
- int i;
- for (i = 0; i < ARRAY_SIZE(vub300->fn); i++) {
- vub300->fn[i].offload_point = 0;
- vub300->fn[i].offload_count = 0;
- }
+
+ for (i = 0; i < ARRAY_SIZE(vub300->fn); i++) {
+ vub300->fn[i].offload_point = 0;
+ vub300->fn[i].offload_count = 0;
}
+
vub300->total_offload_count = 0;
vub300->irq_enabled = 0;
vub300->irq_disabled = 0;
vub300->irqs_queued = 0;
- {
- int i;
- for (i = 0; i < ARRAY_SIZE(vub300->sdio_register); i++)
- vub300->sdio_register[i++].activate = 0;
- }
+
+ for (i = 0; i < ARRAY_SIZE(vub300->sdio_register); i++)
+ vub300->sdio_register[i++].activate = 0;
+
vub300->udev = udev;
vub300->interface = interface;
vub300->cmnd_res_ep = 0;
vub300->cmnd_out_ep = 0;
vub300->data_inp_ep = 0;
vub300->data_out_ep = 0;
- {
- int i;
- for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
- vub300->fbs[i] = 512;
- }
+
+ for (i = 0; i < ARRAY_SIZE(vub300->fbs); i++)
+ vub300->fbs[i] = 512;
+
/*
* set up the endpoint information
*
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 5/6] mmc: vub300: MODULE_* cleanup
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
` (2 preceding siblings ...)
2011-05-16 0:21 ` [PATCH 4/6] mmc: vub300: loop cleanup Chris Ball
@ 2011-05-16 0:21 ` Chris Ball
2011-05-16 0:21 ` [PATCH 6/6] mmc: vub300: clean up multiline conditionals Chris Ball
4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
Move the MODULE_* fields down to their usual space at the bottom of the
source file, and remove a duplicated MODULE_LICENSE().
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 7 +++----
1 files changed, 3 insertions(+), 4 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 0463921..656d528 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -220,10 +220,6 @@ enum SD_RESPONSE_TYPE {
#define SD_ERROR_OVERRUN 0x1B
#define SD_ERROR_PIO_TIMEOUT 0x1C
-MODULE_AUTHOR("Tony Olech <tony.olech@elandigitalsystems.com>");
-MODULE_DESCRIPTION("VUB300 USB to SD/MMC/SDIO adapter driver");
-MODULE_LICENSE("GPL");
-
#define FUN(c) (0x000007 & (c->arg>>28))
#define REG(c) (0x01FFFF & (c->arg>>9))
@@ -2514,4 +2510,7 @@ static void __exit vub300_exit(void)
module_init(vub300_init);
module_exit(vub300_exit);
+
+MODULE_AUTHOR("Tony Olech <tony.olech@elandigitalsystems.com>");
+MODULE_DESCRIPTION("VUB300 USB to SD/MMC/SDIO adapter driver");
MODULE_LICENSE("GPL");
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH 6/6] mmc: vub300: clean up multiline conditionals
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
` (3 preceding siblings ...)
2011-05-16 0:21 ` [PATCH 5/6] mmc: vub300: MODULE_* cleanup Chris Ball
@ 2011-05-16 0:21 ` Chris Ball
4 siblings, 0 replies; 6+ messages in thread
From: Chris Ball @ 2011-05-16 0:21 UTC (permalink / raw)
To: linux-mmc, Tony Olech; +Cc: Chris Ball
Kernel coding style prefers the boolean operator to end the line.
Signed-off-by: Chris Ball <cjb@laptop.org>
---
drivers/mmc/host/vub300.c | 22 ++++++++++------------
1 files changed, 10 insertions(+), 12 deletions(-)
diff --git a/drivers/mmc/host/vub300.c b/drivers/mmc/host/vub300.c
index 656d528..1b72329 100644
--- a/drivers/mmc/host/vub300.c
+++ b/drivers/mmc/host/vub300.c
@@ -730,8 +730,8 @@ static void vub300_deadwork_thread(struct work_struct *work)
*/
} else if (vub300->card_present) {
check_vub300_port_status(vub300);
- } else if (vub300->mmc && vub300->mmc->card
- && mmc_card_present(vub300->mmc->card)) {
+ } else if (vub300->mmc && vub300->mmc->card &&
+ mmc_card_present(vub300->mmc->card)) {
/*
* the MMC core must not have responded
* to the previous indication - lets
@@ -1542,8 +1542,8 @@ static int __command_write_data(struct vub300_mmc_host *vub300,
} else {
data->bytes_xfered = vub300->datasize;
}
- } else if ((!vub300->large_usb_packets && (0 < modulo_64_length))
- || (vub300->large_usb_packets && (64 > modulo_512_length))
+ } else if ((!vub300->large_usb_packets && (0 < modulo_64_length)) ||
+ (vub300->large_usb_packets && (64 > modulo_512_length))
) { /* don't you just love these work-rounds */
int padded_length = ((63 + linear_length) >> 6) << 6;
u8 *buf = kmalloc(padded_length, GFP_KERNEL);
@@ -1766,9 +1766,8 @@ static void vub300_cmndwork_thread(struct work_struct *work)
int data_length;
mutex_lock(&vub300->cmd_mutex);
init_completion(&vub300->command_complete);
- if (likely(vub300->vub_name[0])
- || !vub300->mmc->card
- || !mmc_card_present(vub300->mmc->card)) {
+ if (likely(vub300->vub_name[0]) || !vub300->mmc->card ||
+ !mmc_card_present(vub300->mmc->card)) {
/*
* the name of the EMPTY Pseudo firmware file
* is used as a flag to indicate that the file
@@ -1950,8 +1949,8 @@ static void vub300_mmc_request(struct mmc_host *mmc, struct mmc_request *req)
* for performance we have to return immediately
* if the requested data has been offloaded
*/
- if ((cmd->opcode == 52)
- && satisfy_request_from_offloaded_data(vub300, cmd)) {
+ if (cmd->opcode == 52 &&
+ satisfy_request_from_offloaded_data(vub300, cmd)) {
cmd->error = 0;
mutex_unlock(&vub300->cmd_mutex);
kref_put(&vub300->kref, vub300_delete);
@@ -2284,9 +2283,8 @@ static int vub300_probe(struct usb_interface *interface,
endpoint->bEndpointAddress);
}
}
- if (vub300->cmnd_res_ep
- && vub300->cmnd_out_ep
- && vub300->data_inp_ep && vub300->data_out_ep) {
+ if (vub300->cmnd_res_ep && vub300->cmnd_out_ep &&
+ vub300->data_inp_ep && vub300->data_out_ep) {
dev_info(&vub300->udev->dev,
"vub300 %s packets"
" using EndPoints %02X %02X %02X %02X\n",
--
1.7.0.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
end of thread, other threads:[~2011-05-16 0:19 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-05-16 0:21 [PATCH 1/6] mmc: vub300: Formatting cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 2/6] mmc: vub300: add whitespace after module_param decls Chris Ball
2011-05-16 0:21 ` [PATCH 3/6] mmc: vub300: Remove initialization of static ints to 0 Chris Ball
2011-05-16 0:21 ` [PATCH 4/6] mmc: vub300: loop cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 5/6] mmc: vub300: MODULE_* cleanup Chris Ball
2011-05-16 0:21 ` [PATCH 6/6] mmc: vub300: clean up multiline conditionals Chris Ball
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).