Skip to content

Commit 54db06f

Browse files
sndk: fixed build failure
Fixed build error in sandisk-nvme.c checkpatch fixes Signed-off-by: jeff-lien-sndk <[email protected]>
1 parent 761cdf5 commit 54db06f

2 files changed

Lines changed: 9 additions & 6 deletions

File tree

plugins/sandisk/sandisk-nvme.c

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -197,6 +197,7 @@ static int sndk_do_cap_both_telemetry_log(struct nvme_global_ctx *ctx,
197197

198198
/* Remove .tar extension if present */
199199
char *tar_ext = strstr(base_name, ".tar");
200+
200201
if (tar_ext)
201202
*tar_ext = '\0';
202203

@@ -393,7 +394,7 @@ static int sndk_vs_internal_fw_log(int argc, char **argv,
393394
"Output file size. Deprecated, see man page for supported devices.";
394395
const char *offset =
395396
"Output file data offset. Deprecated, see man page for supported devices.";
396-
char f[PATH_MAX] = {0};
397+
char f[PATH_MAX-4] = {0};
397398
char fileSuffix[PATH_MAX] = {0};
398399
__u32 xfer_size = 0;
399400
int telemetry_type = 0, telemetry_data_area = 0;
@@ -463,7 +464,7 @@ static int sndk_vs_internal_fw_log(int argc, char **argv,
463464
}
464465
close(verify_file);
465466
remove(cfg.file);
466-
strncpy(f, cfg.file, PATH_MAX - 1);
467+
strncpy(f, cfg.file, PATH_MAX - 5);
467468
} else {
468469
sndk_UtilsGetTime(&timeInfo);
469470
memset(timeStamp, 0, sizeof(timeStamp));
@@ -534,11 +535,13 @@ static int sndk_vs_internal_fw_log(int argc, char **argv,
534535
if (telemetry_type == SNDK_TELEMETRY_TYPE_BOTH) {
535536
/* For BOTH type, ensure filename has .tar extension */
536537
char tar_file[PATH_MAX] = {0};
538+
537539
if (strstr(f, ".tar") == NULL) {
538540
char *bin_ext = strstr(f, ".bin");
539-
if (bin_ext) {
541+
542+
if (bin_ext)
540543
*bin_ext = '\0';
541-
}
544+
542545
snprintf(tar_file, PATH_MAX, "%s.tar", f);
543546
} else {
544547
snprintf(tar_file, PATH_MAX, "%s", f);

plugins/sandisk/sandisk-utils.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,8 +26,8 @@ static const __u8 WDC_UUID[NVME_UUID_LEN] = {
2626

2727
/* WDC_UUID value for SN640_3 devices and SN655 devices */
2828
static const __u8 WDC_UUID_SN640_3[NVME_UUID_LEN] = {
29-
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
30-
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
29+
0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11, 0x11,
30+
0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22, 0x22
3131
};
3232

3333
/* Sandisk UUID value */

0 commit comments

Comments
 (0)