Re: [PATCH] Add qword read/write support.

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Wed, Jul 1, 2009 at 14:25, Martin Mares<mj@xxxxxx> wrote:
> Hello!
>
>>  #elif defined(PCI_HAVE_STDINT_H) || (defined(__STDC_VERSION__) && __STDC_VERSION__ >= 199901L)
>>  #include <stdint.h>
>>  typedef uint8_t u8;
>>  typedef uint16_t u16;
>>  typedef uint32_t u32;
>> +typedef uint64_t u64;
>>  #else
>>  typedef u_int8_t u8;
>>  typedef u_int16_t u16;
>>  typedef u_int32_t u32;
>> +typedef u_int64_t u64;
>>  #endif
>>
>>  #ifdef PCI_HAVE_64BIT_ADDRESS
>>  #include <limits.h>
>>  #if ULONG_MAX > 0xffffffff
>> -typedef unsigned long u64;
>>  #define PCI_U64_FMT "l"
>>  #else
>> -typedef unsigned long long u64;
>>  #define PCI_U64_FMT "ll"
>>  #endif
>>  #endif
>
> This is unfortunately wrong -- you cannot use the "ll" modifier on uint64_t.

Is that due to the fact that "long long" could be something other than
64-bit width?

Do you have a suggestion for fixing it? I usually am not working on
the C level. :)

>> +  const char * const formats[] = { NULL, " %02x", " %04x", NULL, " %08x", NULL, NULL, NULL, " %016llx"};
>> +  const char * const mask_formats[] = { NULL, " %02x->(%02x:%02x)->%02x", " %04x->(%04x:%04x)->%04x", NULL, " %08x->(%08x:%08x)->%08x", NULL, NULL, NULL, " %016llx->(%016llx:%016llx)->%016llx"};
>
> The same here.

Thanks for pointing these out,
wt
--
To unsubscribe from this list: send the line "unsubscribe linux-pci" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [DMA Engine]     [Linux Coverity]     [Linux USB]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Greybus]

  Powered by Linux