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] [day] [month] [year] [list]
Date:	Thu, 15 Jan 2009 19:38:00 +0900
From:	"Magnus Damm" <magnus.damm@...il.com>
To:	"roel kluin" <roel.kluin@...il.com>
Cc:	linux-kernel@...r.kernel.org, akpm@...ux-foundation.org,
	lethal@...ux-sh.org, johnstul@...ibm.com, gregkh@...e.de,
	mingo@...hat.com, tglx@...utronix.de
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@...il.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
--
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