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]
Message-ID: <20101207093229.GB29776@core2.telecom.by>
Date:	Tue, 7 Dec 2010 11:32:29 +0200
From:	Alexey Dobriyan <adobriyan@...il.com>
To:	Arnd Bergmann <arnd@...db.de>
Cc:	Jesper Juhl <jj@...osbits.net>, akpm@...ux-foundation.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 01/45] kstrtox: converting strings to integers done
 (hopefully) right

On Tue, Dec 07, 2010 at 10:04:58AM +0100, Arnd Bergmann wrote:
> On Monday 06 December 2010 16:16:36 Alexey Dobriyan wrote:
> > > <snip>
> > >> +/* Internal, do not use. */
> > >> +int _kstrtol(const char *s, unsigned int base, long *res)
> > >> +{
> > >> +     long long tmp;
> > >> +     int rv;
> > >> +
> > >> +     rv = kstrtoll(s, base, &tmp);
> > >> +     if (rv < 0)
> > >> +             return rv;
> > >> +     if (tmp != (long long)(long)tmp)
> > >> +             return -EINVAL;
> > >> +     *res = tmp;
> > >> +     return 0;
> > >> +}
> > >> +EXPORT_SYMBOL(_kstrtol);
> > >
> > > Ok, probably I'm just being dense, but the "_" prefix tells me I probably
> > > shouldn't use this function. The comment clearly tells me I shouldn't use
> > > this function.
> > > So, why is this exported? And if it is not/should not be exported, then
> > > why is it not static?
> > > (goes for other functions in this patch as well).
> > 
> > It is used by kstrtol() if "long" and "long long" aren't the same type.
> > I can't ifdef it because gcc doesn't allow "#if sizeof(long long) == ".
> > "Do not use" hints "use kstrtol()".
> 
> Can't you use #ifdef CONFIG_64BIT to see if long is 64 bit wide?

I could, but there are no defines for alignment.
--
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