Skip to contentSkip to conversation

nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA

PATCH In review Ing. Alfonso Kuen Arroyo 3 participants 3 messages Sep 23 – Sep 25

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 nvmet-tcp: fix stale comment on NVMET_TCP_MAXH2CDATA

The constant is 0x400000, 4 MiB, but the comment next to it said 16M. Use SZ_4M instead of a value and a comment that can drift out of sync with each other, as suggested by Christoph Hellwig.

Noticed by Maurizio Lombardi while reviewing "nvmet-tcp: report a bounded MDTS instead of "no limit"".

v2: use SZ_4M instead of the raw hex value + comment (Christoph
Hellwig). The file did not pull in linux/sizes.h yet and had no other SZ_ user, so the include is added.

Signed-off-by Alfonso Kuen
---
 drivers/nvme/target/tcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/target/tcp.c +2 -1
index e598101..000000 100644
@@ -18,12 +18,13 @@
 #include <net/handshake.h>
 #include <linux/inet.h>
 #include <linux/llist.h>
+#include <linux/sizes.h>
 #include <trace/events/sock.h>
 
 #include "nvmet.h"
 
 #define NVMET_TCP_DEF_INLINE_DATA_SIZE	(4 * PAGE_SIZE)
-#define NVMET_TCP_MAXH2CDATA		0x400000 /* 16M arbitrary limit */
+#define NVMET_TCP_MAXH2CDATA		SZ_4M
 #define NVMET_TCP_BACKLOG 128
 
 static int param_store_val(const char *str, int *val, int min, int max)

--
2.53.0

Reviewed-by on v2 1/1
#1 lore raw
Quoted 10 lines · Ing. Alfonso Kuen Arroyo

The constant is 0x400000, 4 MiB, but the comment next to it said 16M. Use SZ_4M instead of a value and a comment that can drift out of sync with each other, as suggested by Christoph Hellwig.

Noticed by Maurizio Lombardi while reviewing "nvmet-tcp: report a bounded MDTS instead of "no limit"".

v2: use SZ_4M instead of the raw hex value + comment (Christoph
Hellwig). The file did not pull in linux/sizes.h yet and had no other SZ_ user, so the include is added.

version differences should be put after the '---' separator, they are not part of the commit message

Quoted 2 lines
Signed-off-by Alfonso Kuen

The mail is missing, this should be:

Quoted 24 lines
---
 drivers/nvme/target/tcp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
drivers/nvme/target/tcp.c +2 -2
index e598101..000000 100644
@@ -18,12 +18,13 @@
 #include <net/handshake.h>
 #include <linux/inet.h>
 #include <linux/llist.h>
+#include <linux/sizes.h>
 #include <trace/events/sock.h>
 
 #include "nvmet.h"
 
 #define NVMET_TCP_DEF_INLINE_DATA_SIZE	(4 * PAGE_SIZE)
-#define NVMET_TCP_MAXH2CDATA		0x400000 /* 16M arbitrary limit */
+#define NVMET_TCP_MAXH2CDATA		SZ_4M
 #define NVMET_TCP_BACKLOG 128
 
 static int param_store_val(const char *str, int *val, int min, int max)
--
Quoted 1 line

2.53.0

The change looks ok to me

#2 lore raw
Quoted 12 lines · Maurizio Lombardi
Quoted 10 lines · Ing. Alfonso Kuen Arroyo

The constant is 0x400000, 4 MiB, but the comment next to it said 16M. Use SZ_4M instead of a value and a comment that can drift out of sync with each other, as suggested by Christoph Hellwig.

Noticed by Maurizio Lombardi while reviewing "nvmet-tcp: report a bounded MDTS instead of "no limit"".

v2: use SZ_4M instead of the raw hex value + comment (Christoph
Hellwig). The file did not pull in linux/sizes.h yet and had no other SZ_ user, so the include is added.

Quoted 8 lines

version differences should be put after the '---' separator, they are not part of the commit message

Quoted 2 lines
Signed-off-by Alfonso Kuen

The mail is missing, this should be:

Agreed on both. Otherwise this looks great, thanks.