Commit 222debb2 authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman

[PATCH] W1: fix some improper '{' style code.

Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 7c82709d
......@@ -122,15 +122,13 @@ static int __devinit ds_w1_init(void)
int err;
ds_bus_master = kmalloc(sizeof(*ds_bus_master), GFP_KERNEL);
if (!ds_bus_master)
{
if (!ds_bus_master) {
printk(KERN_ERR "Failed to allocate DS9490R USB<->W1 bus_master structure.\n");
return -ENOMEM;
}
ds_dev = ds_get_device();
if (!ds_dev)
{
if (!ds_dev) {
printk(KERN_ERR "DS9490R is not registered.\n");
err = -ENODEV;
goto err_out_free_bus_master;
......
......@@ -164,8 +164,7 @@ int ds_recv_status(struct ds_device *dev, struct ds_status *st)
printk("%02x ", buf[i]);
printk("\n");
if (count >= 16)
{
if (count >= 16) {
ds_dump_status(buf, "enable flag", 0);
ds_dump_status(buf, "1-wire speed", 1);
ds_dump_status(buf, "strong pullup duration", 2);
......@@ -186,8 +185,7 @@ int ds_recv_status(struct ds_device *dev, struct ds_status *st)
memcpy(st, buf, sizeof(*st));
if (st->status & ST_EPOF)
{
if (st->status & ST_EPOF) {
printk(KERN_INFO "Resetting device after ST_EPOF.\n");
err = ds_send_control_cmd(dev, CTL_RESET_DEVICE, 0);
if (err)
......@@ -197,8 +195,7 @@ int ds_recv_status(struct ds_device *dev, struct ds_status *st)
return err;
}
#if 0
if (st->status & ST_IDLE)
{
if (st->status & ST_IDLE) {
printk(KERN_INFO "Resetting pulse after ST_IDLE.\n");
err = ds_start_pulse(dev, PULLUP_PULSE_DURATION);
if (err)
......@@ -311,8 +308,7 @@ int ds_wait_status(struct ds_device *dev, struct ds_status *st)
do {
err = ds_recv_status_nodump(dev, st, buf, sizeof(buf));
#if 0
if (err >= 0)
{
if (err >= 0) {
int i;
printk("0x%x: count=%d, status: ", dev->ep[EP_STATUS], err);
for (i=0; i<err; ++i)
......@@ -343,8 +339,7 @@ int ds_reset(struct ds_device *dev, struct ds_status *st)
ds_wait_status(dev, st);
#if 0
if (st->command_buffer_status)
{
if (st->command_buffer_status) {
printk(KERN_INFO "Short circuit.\n");
return -EIO;
}
......
......@@ -556,8 +556,7 @@ static void w1_search(struct w1_master *dev)
if (sl->reg_num.family == tmp->family &&
sl->reg_num.id == tmp->id &&
sl->reg_num.crc == tmp->crc)
{
sl->reg_num.crc == tmp->crc) {
set_bit(W1_SLAVE_ACTIVE, (long *)&sl->flags);
break;
}
......@@ -719,8 +718,7 @@ int w1_process(void *data)
list_for_each_safe(ent, n, &dev->slist) {
sl = list_entry(ent, struct w1_slave, w1_slave_entry);
if (sl && !test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags))
{
if (sl && !test_bit(W1_SLAVE_ACTIVE, (unsigned long *)&sl->flags)) {
list_del (&sl->w1_slave_entry);
w1_slave_detach (sl);
......
......@@ -136,8 +136,7 @@ u8 w1_read_block(struct w1_master *dev, u8 *buf, int len)
if (dev->bus_master->read_block)
ret = dev->bus_master->read_block(dev->bus_master->data, buf, len);
else
{
else {
for (i = 0; i < len; ++i)
buf[i] = w1_read_8(dev);
ret = len;
......@@ -152,8 +151,7 @@ int w1_reset_bus(struct w1_master *dev)
if (dev->bus_master->reset_bus)
result = dev->bus_master->reset_bus(dev->bus_master->data) & 0x1;
else
{
else {
dev->bus_master->write_bit(dev->bus_master->data, 0);
w1_delay(480);
dev->bus_master->write_bit(dev->bus_master->data, 1);
......
......@@ -116,8 +116,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
verdict = 0;
crc = 0;
while (max_trying--)
{
while (max_trying--) {
if (!w1_reset_bus (dev)) {
int count = 0;
u8 match[9] = {W1_MATCH_ROM, };
......@@ -133,8 +132,7 @@ static ssize_t w1_therm_read_bin(struct kobject *kobj, char *buf, loff_t off, si
w1_write_block(dev, match, 9);
w1_write_8(dev, W1_READ_SCRATCHPAD);
if ((count = w1_read_block(dev, rom, 9)) != 9)
{
if ((count = w1_read_block(dev, rom, 9)) != 9) {
dev_warn(&dev->dev, "w1_read_block() returned %d instead of 9.\n", count);
}
......
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