Re: [PATCH] Drivers:firewire: fix style errors in core-card.c This is a patch in the core-card.c file which fixes up 2 warnings found by the checkpatch.pl tool Signed-off-by: Sander Nemvalts <snemvalts@xxxxxxxxx>

From: Paul Bolle
Date: Mon Sep 01 2014 - 18:17:58 EST


Quite a crowded subject line!

On Mon, 2014-09-01 at 23:56 +0200, Stefan Richter wrote:
> On Sep 01 Sander Nemvalts wrote:
> > @@ -132,7 +133,7 @@ static void generate_config_rom(struct fw_card *card, __be32 *config_rom)
> > j = 7 + descriptor_count;
> >
> > /* Generate root directory entries for descriptors. */
> > - list_for_each_entry (desc, &descriptor_list, link) {
> > + list_for_each_entry(desc, &descriptor_list, link) {
> > if (desc->immediate > 0)
> > config_rom[i++] = cpu_to_be32(desc->immediate);
> > config_rom[i] = cpu_to_be32(desc->key | (j - i));
>
> We are writing
> for (a; b; c);
> not
> for(a; b; c);
> and thus a space after list_for_each and friends makes sense.

$ git grep "list_for_each_entry (" | wc -l
52
$ git grep "list_for_each_entry(" | wc -l
5991

So "list_for_each_entry(" (without space) seems to be the preferred
style.


Paul Bolle

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