[PATCH] selftests: nci: use int replace unsigned int

Subsystems: kernel selftest framework, nfc subsystem, nfc virtual nci device driver, the rest

STALE1786d

3 messages, 2 authors, 2021-09-16 · open the first message on its own page

[PATCH] selftests: nci: use int replace unsigned int

From: Xiang wangx <hidden>
Date: 2021-09-16 05:51:14

Should not use unsigned expression compared with zero

Signed-off-by: Xiang wangx <redacted>
---
 tools/testing/selftests/nci/nci_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index e1bf55dabdf6..162c41e9bcae 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -746,7 +746,7 @@ int read_write_nci_cmd(int nfc_sock, int virtual_fd, const __u8 *cmd, __u32 cmd_
 		       const __u8 *rsp, __u32 rsp_len)
 {
 	char buf[256];
-	unsigned int len;
+	int len;
 
 	send(nfc_sock, &cmd[3], cmd_len - 3, 0);
 	len = read(virtual_fd, buf, cmd_len);
-- 
2.20.1

Re: [PATCH] selftests: nci: use int replace unsigned int

From: Bongsu Jeon <hidden>
Date: 2021-09-16 07:18:10

On Thu, Sep 16, 2021 at 2:55 PM Xiang wangx [off-list ref] wrote:
quoted hunk
Should not use unsigned expression compared with zero

Signed-off-by: Xiang wangx <redacted>
---
 tools/testing/selftests/nci/nci_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index e1bf55dabdf6..162c41e9bcae 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -746,7 +746,7 @@ int read_write_nci_cmd(int nfc_sock, int virtual_fd, const __u8 *cmd, __u32 cmd_
                       const __u8 *rsp, __u32 rsp_len)
 {
        char buf[256];
-       unsigned int len;
+       int len;

        send(nfc_sock, &cmd[3], cmd_len - 3, 0);
        len = read(virtual_fd, buf, cmd_len);
--
2.20.1
Thanks for fixing it.

Reviewed-by: Bongsu Jeon

Best regards,
Bongsu

Re: [PATCH] selftests: nci: use int replace unsigned int

From: Bongsu Jeon <hidden>
Date: 2021-09-16 08:05:45

Sorry for missing a few comments about this commit message.
Please change the subject to fix grammatical errors.

On Thu, Sep 16, 2021 at 4:17 PM Bongsu Jeon [off-list ref] wrote:
On Thu, Sep 16, 2021 at 2:55 PM Xiang wangx [off-list ref] wrote:
quoted
Should not use unsigned expression compared with zero
Please put a period at the end of the sentence.
quoted
Signed-off-by: Xiang wangx <redacted>
---
 tools/testing/selftests/nci/nci_dev.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index e1bf55dabdf6..162c41e9bcae 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -746,7 +746,7 @@ int read_write_nci_cmd(int nfc_sock, int virtual_fd, const __u8 *cmd, __u32 cmd_
                       const __u8 *rsp, __u32 rsp_len)
 {
        char buf[256];
-       unsigned int len;
+       int len;

        send(nfc_sock, &cmd[3], cmd_len - 3, 0);
        len = read(virtual_fd, buf, cmd_len);
--
2.20.1
Thanks for fixing it.

Reviewed-by: Bongsu Jeon

Best regards,
Bongsu
Sorry for missing the comment for
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help