Re: printk and long long

From: Peter Chubb
Date: Thu Feb 12 2004 - 19:32:11 EST


>>>>> "Richard" == Richard B Johnson <root@xxxxxxxxxxxxxxxxxx> writes:

Richard> On Wed, 11 Feb 2004 wdebruij@xxxxxx wrote:
>> how about simply using a shift to output two regular longs, i.e.
>>
>> printk("%ld%ld",loff_t >> (sizeof(long) * 8), loff_t <<
>> sizeof(long) * 8 >> sizeof(long) * 8);

Why bother? printk already handles 64-bit types just fine.

Do
loff_t x;
printk("%lld\n" (long long)x)

You need the cast, because on 64-bit architectures, loff_t is long not
long long.

Peter c
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/