lkml.org 
[lkml]   [2010]   [Sep]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/4] leds: Driver for National Semiconductors LP5523 chip
From
Date
Moi.

On Thu, 2010-09-16 at 12:12 +0200, Onkalo Samu.P (Nokia-MS/Tampere)
wrote:
> +
> + for (i = 0; i < LP5523_ENGINES; i++) {
> + if (chip->engines[i].mode == LP5523_CMD_LOAD)
> + sysfs_remove_group(&dev->kobj, &lp5523_engine_group[i]);
> + }
> +
> + for (i = 0; i < chip->num_leds; i++)
> + sysfs_remove_group(&chip->leds[i].cdev.dev->kobj,
> + &lp5523_led_attribute_group);
> +}

Tossa ylla on se asia, josta puhuttiin, style guide sanoo:

Do not unnecessarily use braces where a single statement will do.

if (condition)
action();

Tossa ylla on kummankin for:in jalkeen single statement joista kumpikaan
ei mahdu yhdelle riville... Mun nakemyksen mukaan ne molemmat olis yhta
selkeita ilman sulkuja...


> + if (mode == LP5523_CMD_RUN)
> + ret = lp5523_run_program(engine);
> +
> + else if (mode == LP5523_CMD_LOAD) {
> +
> + lp5523_set_engine_mode(engine, LP5523_CMD_DISABLED);
> + lp5523_set_engine_mode(engine, LP5523_CMD_LOAD);
> +
> + ret = sysfs_create_group(&dev->kobj, engine->attributes);
> + if (ret)
> + return ret;
> + }
> +

Aaltosulut myos if:n jalkeiseen statementtiin....

t.m.a.





\
 
 \ /
  Last update: 2010-09-27 20:11    [W:0.118 / U:0.372 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site