Fixes to make version 0.8 available in Debian#96
Fixes to make version 0.8 available in Debian#96keithbusch merged 3 commits intolinux-nvme:masterfrom
Conversation
|
Hi @leitao I believe one should use platform independent format specifier, but not cast a variable to match the format specifier. You propose to change The PRIu64 macro exists in C since C99 and is defined in inttypes.h. Regards, |
|
Hello Maksim, |
|
Hi Breno, Since log->genctr is little-endian, but host can be either big- or little-endian, we should use the le64toh() macro to convert the value first. Regards, |
|
Yes, I think Maksim has the right pattern to fix this. Thanks for bringing this up. |
…dependent.
This code fails to compile on a ppc64le architecture due to the
following errors:
format ‘%lld’ expects argument of type ‘long long int’, but
argument 3 has type ‘__le64 {aka long unsigned int}’
This patch just uses PRIu64 to print 64 uint64_t types.
The current bash completion file is being installed on the old /etc/bash_completion.d. This is the legacy directory, and the new rules ask to include all the completion files at /usr/share/bash-completion/completions This patch is required to fix debian lintian errors.
Currently, nvme-cli is enabled on all Debian and Ubuntu architectures,
which includes 64 and 32 bits architecture.
Version 0.8 does not compile in any 32 bits architecture, as it shows:
cc -Wdate-time -D_FORTIFY_SOURCE=2 -D_GNU_SOURCE -g -O2 -fPIE
-fstack-protector-strong -Wformat -Werror=format-security -std=gnu99 -O2
-g -Wall -Werror -DLIBUDEV_EXISTS -DNVME_VERSION='"0.8"' -c intel-nvme.c
intel-nvme.c: In function ‘get_internal_log’:
intel-nvme.c:310:13: error: cast from pointer to integer of different
size [-Werror=pointer-to-int-cast]
cmd.addr = (__u64)(void *)buf;
^
cc1: all warnings being treated as errors
The cmd.addr field is defined as __u64 on all architectures, but a
pointer is not always 64-bit, making this an error. Cast to 'unsigned
long' instead, which is safe on all supported architectures, and let the
compiler take it from there.
Patch created by Steve Langasek <steve.langasek@ubuntu.com>
|
Thanks Keith and Maksim, I followed your suggestion and now this pull request is updated. Thank you, |
|
Thanks! |
|
Hi @leitao and @keithbusch The 'Fix cast to enable nvme to compile on 64-bits architecture' commit has a change I believe C99 has a type for that purpose too:
The type is optional, but is defined in GCC. Best regards, |
There are current 2 issues on version 0.8 that blocks it to be integrated in Debian.
Both of them are fixed in this pull request.