mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Magnus Damm" <magnus.damm@gmail.com>
To: "roel kluin" <roel.kluin@gmail.com>
Cc: linux-kernel@vger.kernel.org, akpm@linux-foundation.org,
	lethal@linux-sh.org, johnstul@us.ibm.com, gregkh@suse.de,
	mingo@redhat.com, tglx@linutronix.de
Subject: Re: [RESEND][PATCH] early platform drivers V2
Date: Thu, 15 Jan 2009 19:38:00 +0900	[thread overview]
Message-ID: <aec7e5c30901150238j7c065574u789d85f25739098e@mail.gmail.com> (raw)
In-Reply-To: <25e057c00901150229g35d8e9bdn6a19585cbc9d15bd@mail.gmail.com>

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

      reply	other threads:[~2009-01-15 10:38 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-14 10:54 Magnus Damm
2009-01-14 22:36 ` Andrew Morton
2009-01-15 10:11   ` Magnus Damm
2009-01-14 22:47 ` Andrew Morton
2009-01-15 10:29 ` roel kluin
2009-01-15 10:38   ` Magnus Damm [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=aec7e5c30901150238j7c065574u789d85f25739098e@mail.gmail.com \
    --to=magnus.damm@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=gregkh@suse.de \
    --cc=johnstul@us.ibm.com \
    --cc=lethal@linux-sh.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=roel.kluin@gmail.com \
    --cc=tglx@linutronix.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®