Re: [PATCH v3 11/36] mtd: st_spi_fsm: Search for preferred FSMmessage sequence configurations

From: Lee Jones
Date: Tue Dec 17 2013 - 05:46:31 EST


> >> +/* Search for preferred configuration based on available flags */
> >> +static struct seq_rw_config *
> >> +stfsm_search_seq_rw_configs(struct stfsm *fsm,
> >> + struct seq_rw_config cfgs[])
> >> +{
> >> + struct seq_rw_config *config;
> >> + int flags = fsm->info->flags;
> >> +
> >> + for (config = cfgs; cfgs->cmd != 0; config++)
> >
> > This becomes an infinite loop if you can't find a matching config. You
> > probably meant 'config->cmd != 0':
>
> I will leave Lee to defend himself on this one ;-)

No defence necessary, I think Brian's correct.

NB: You might want to take a look at the 'dirty' implementation too. ;)

--
Lee Jones
Linaro STMicroelectronics Landing Team Lead
Linaro.org â Open source software for ARM SoCs
Follow Linaro: Facebook | Twitter | Blog
--
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/