lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <1285584868.8182.194.camel@masi.mnp.nokia.com>
Date:	Mon, 27 Sep 2010 13:54:28 +0300
From:	"Matti J. Aaltonen" <matti.j.aaltonen@...ia.com>
To:	"Onkalo Samu.P (Nokia-MS/Tampere)" <samu.p.onkalo@...ia.com>
Cc:	"rpurdie@...ux.intel.com" <rpurdie@...ux.intel.com>,
	"linux-i2c@...r.kernel.org" <linux-i2c@...r.kernel.org>,
	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] leds: Driver for National Semiconductors LP5523
 chip

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.



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ