Skip to content

Commit 69701d5

Browse files
author
JerryWang
committed
Build error fixed
1 parent 25d6e90 commit 69701d5

File tree

2 files changed

+3
-4
lines changed

2 files changed

+3
-4
lines changed

plugins/transcend/transcend-nvme.c

+2-3
Original file line numberDiff line numberDiff line change
@@ -33,8 +33,7 @@ static const __u32 DW10_ID = 0x01;
3333
static const int iDis = 20;
3434
static const double fullValue = 170;
3535

36-
enum PLPErrorCode
37-
{
36+
enum PLPErrorCode {
3837
PLP_ERROR_NO_MATCH = -1,
3938
PLP_ERROR_DATA_EXPIRED = -2
4039
};
@@ -58,7 +57,7 @@ const char *string_list[] = {
5857
"SSD420P",
5958
"MSA470P",
6059
"MSA452P"};
61-
const int list_size = sizeof(string_list) / sizeof(string_list[0]);
60+
const int list_size = ARRAY_SIZE(string_list) / sizeof(string_list[0]);
6261

6362
static int getPLPHealth(int argc, char **argv, struct command *cmd, struct plugin *plugin);
6463
static int readUsefulPLPValue(const char *device);

plugins/transcend/transcend-nvme.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44

55
#if !defined(TRANSCEND_NVME) || defined(CMD_HEADER_MULTI_READ)
66
#define TRANSCEND_NVME
7-
7+
#define ARRAY_SIZE(arr) (sizeof(arr) / sizeof((arr)[0]))
88
#include "cmd.h"
99

1010

0 commit comments

Comments
 (0)