Messages in this thread | | | Date | Thu, 15 Jan 2009 19:38:00 +0900 | From | "Magnus Damm" <> | Subject | Re: [RESEND][PATCH] early platform drivers V2 |
| |
Hi Roel,
Thanks for your feedback!
On Thu, Jan 15, 2009 at 7:29 PM, roel kluin <roel.kluin@gmail.com> wrote: >> + if (id != -2) /* skip previously checked device */ >> + if (match_id == epdrv->requested_id) >> + goto skip; >> + >> + if (pdev->id == match_id) >> + *match = pdev; >> + >> +skip: >> + if (pdev->id > match_id) >> + n++; > > you can replace the 10 lines above by: > > /* skip previously checked device */ > if ((id == -2 || match_id != epdrv->requested_id) && pdev->id == match_id) > *match = pdev; > else if (pdev->id > match_id) > n++;
I agree that the code looks a bit special, but are you sure your replacement is correct?
Will the "n++" happen in the case of (pdev->id == match_id)?
>> + if (epdrv->pdrv->probe(match)) { > > shouldn't this be > > if (!epdrv->pdrv->probe(match)) {
No, probe() returns 0 if things went well. Non-zero means error.
> I think k, n and i could get more descriptive names
Sure, why not! Care to give any suggestions? =)
/ magnus
| |