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:	Tue, 30 Sep 2008 16:32:45 +0100
From:	"Jan Beulich" <jbeulich@...ell.com>
To:	"Joel Schopp" <jschopp@...tin.ibm.com>,
	"Andy Whitcroft" <apw@...dowen.org>,
	"Geert Uytterhoeven" <Geert.Uytterhoeven@...ycom.com>,
	"Randy Dunlap" <rdunlap@...otime.net>
Cc:	"Linux Kernel Development" <linux-kernel@...r.kernel.org>
Subject: [PATCH] checkpatch: Check for %L for all integer formats (was:
	 Re:[PATCH] fix printk format compiler warnings)

>>> Geert Uytterhoeven <Geert.Uytterhoeven@...ycom.com> 30.09.08 13:29 >>>
>On Fri, 5 Sep 2008, Jan Beulich wrote:
>> %llx and the like cannot be used on u64-derived data types - they must
>> be cast to long long explicitly for arch-es where u64 is a typedef of
>> unsigned long (ia64 is where I observed the problem).
>
>> -		printk(KERN_INFO "PCI: bridge %s io port: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
>> +		printk(KERN_INFO "PCI: bridge %s io port: [%Lx, %Lx]\n",
>
>> -		printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%llx, %llx]\n", pci_name(dev), res->start, res->end);
>> +		printk(KERN_INFO "PCI: bridge %s 32bit mmio: [%Lx, %Lx]\n",
>
>> -		printk(KERN_INFO "PCI: bridge %s %sbit mmio pref: [%llx, %llx]\n", pci_name(dev), (res->flags & PCI_PREF_RANGE_TYPE_64)?"64":"32",res->start, res->end);
>> +		printk(KERN_INFO "PCI: bridge %s %dbit mmio pref: [%Lx, %Lx]\n",
>
>> -		printk(KERN_INFO "bus: %02x index %x %s: [%llx, %llx]\n", bus->number, i, (res->flags & IORESOURCE_IO)? "io port":"mmio", res->start, res->end);
>> +		printk(KERN_INFO "bus: %02x index %x %s: [%Lx, %Lx]\n",
>
>Why did you replace `%ll' by `%L'?

Because it's one byte shorter.

>While `L' is used as an internal flag in Linux' vsnprintf() implementation and
>is still supported because of historical (pre-C99) reasons, the `L' conversion
>qualifier is meant for the `long double' floating point type, as per C99.
>The recommended conversion qualifier for the `long long' integer type is `ll'.

I understand all of this, but can't see why you would care about floating point
formats in the kernel (when specifically you know that vsnprintf() & Co aren't
able to handle it anyway).

So I think rather than widening the set of specifiers checkpatch looks for, the
check should rather be removed altogether.

Jan

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