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] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 30 Oct 2013 20:35:36 +0100
From:	Peter Hüwe <PeterHuewe@....de>
To:	Joe Perches <joe@...ches.com>,
	Jason Gunthorpe <jgunthorpe@...idianresearch.com>
Cc:	Ashley Lai <ashley@...leylai.com>, Rajiv Andrade <mail@...jiv.net>,
	Marcel Selhorst <tpmdd@...horst.net>,
	tpmdd-devel@...ts.sourceforge.net, linux-kernel@...r.kernel.org,
	Xiaoyan Zhang <xiaoyan.zhang@...el.com>,
	Gang Wei <gang.wei@...el.com>, stable@...r.kernel.org
Subject: Re: [PATCH 1/2] tpm/tpm_ppi: Do not compare strcmp(a,b) == -1

Hi Joe, Jason
> fyi: using
> 	if (strcmp(foo, bar) < 0)
> is canonical.

Yeah of course you're both right - 
    if (strcmp(foo, bar) < 0) 
is the correct version.
Sorry about the rubbish patch.


> lib/string.c:strcmp returns only -1,0,1
> so that's what the arch versions should do too.
> However, arch implementations do vary...

Joe, You are right on this one as well.

I did not pay attention to where cscope did send me 
- it was arch/x86/boot/string.c which implements it as 

        while (*s1 || *s2) {
                delta = *s2 - *s1;
                if (delta)
                        return delta;
                s1++;
                s2++;
        }

Although I know that this is not used here, 
it differs from the version in lib. (Maybe worth changing?)


In anycase 
    if (strcmp(foo, bar) < 0)
is better than
    if (strcmp(foo, bar) == -1)
so I'll resend the patch.

Thanks for reviewing!

Peter

--
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