]> www.infradead.org Git - users/sagi/nvme-cli.git/commitdiff
[NVMe-CLI] Review comment changes to wdc plugin vs-internal-log fix for SN730
authorJeff Lien <jeff.lien@wdc.com>
Mon, 19 Oct 2020 21:10:15 +0000 (16:10 -0500)
committerKeith Busch <kbusch@kernel.org>
Mon, 26 Oct 2020 20:49:23 +0000 (14:49 -0600)
plugins/wdc/wdc-nvme.c

index 11c1956ca15f6690d3808fbc9cbfe78e60e416ea..c99821dacdbe28765e32fda9d0f054226a35f931 100644 (file)
@@ -2280,6 +2280,7 @@ static int wdc_do_cap_dui(int fd, char *file, __u32 xfer_size, int data_area, in
                struct wdc_dui_log_hdr_v4 *log_hdr_v4;
                log_hdr_v4 = (struct wdc_dui_log_hdr_v4 *)log_hdr;
                __s64 xfer_size_long = (__s64)xfer_size;
+               __s64 section_size_bytes = 0;
 
                cap_dui_length_v4 = le64_to_cpu(log_hdr_v4->log_size_sectors) * WDC_NVME_SN730_SECTOR_SIZE;
 
@@ -2288,7 +2289,7 @@ static int wdc_do_cap_dui(int fd, char *file, __u32 xfer_size, int data_area, in
                        fprintf(stderr, "INFO : WDC : DUI Header Version = 0x%x\n", log_hdr_v4->hdr_version);
                        fprintf(stderr, "INFO : WDC : DUI Product ID = 0x%x/%c\n", log_hdr_v4->product_id, log_hdr_v4->product_id);
                        fprintf(stderr, "INFO : WDC : DUI log size sectors = 0x%x\n", log_hdr_v4->log_size_sectors);
-                       fprintf(stderr, "INFO : WDC : DUI cap_dui_length = 0x%lx\n", (unsigned long int)cap_dui_length_v4);
+                       fprintf(stderr, "INFO : WDC : DUI cap_dui_length = 0x%llX\n", cap_dui_length_v4);
                }
 
                if (cap_dui_length_v4 == 0) {
@@ -2299,16 +2300,16 @@ static int wdc_do_cap_dui(int fd, char *file, __u32 xfer_size, int data_area, in
                                for(j = 0; j < WDC_NVME_DUI_MAX_SECTION; j++) {
                                        if (log_hdr_v4->log_section[j].data_area_id <= data_area &&
                                                        log_hdr_v4->log_section[j].data_area_id != 0) {
-                                               log_size += ((__s64)log_hdr_v4->log_section[j].section_size_sectors * WDC_NVME_SN730_SECTOR_SIZE);
+                                               section_size_bytes = ((__s64)log_hdr_v4->log_section[j].section_size_sectors * WDC_NVME_SN730_SECTOR_SIZE);
+                                               log_size += section_size_bytes;
                                                if (verbose)
-                                                       fprintf(stderr, "%s: Data area ID %d : section size 0x%x sectors, section size 0x%lx bytes, total size = 0x%lx\n",
-                                                                       __func__, log_hdr_v4->log_section[j].data_area_id, log_hdr_v4->log_section[j].section_size_sectors, ((unsigned long int)log_hdr_v4->log_section[j].section_size_sectors * WDC_NVME_SN730_SECTOR_SIZE),
-                                                                       (unsigned long int)log_size);
-
+                                                       fprintf(stderr, "%s: Data area ID %d : section size 0x%x sectors, section size 0x%llX bytes, total size = 0x%llX\n",
+                                                                       __func__, log_hdr_v4->log_section[j].data_area_id, log_hdr_v4->log_section[j].section_size_sectors, section_size_bytes,
+                                                                       log_size);
                                        }
                                        else {
                                                if (verbose)
-                                                       fprintf(stderr, "%s: break, total size = 0x%lx\n",      __func__, (unsigned long int)log_size);
+                                                       fprintf(stderr, "%s: break, total size = 0x%llX\n",     __func__, log_size);
                                                break;
                                        }
                                }