mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: bongsu.jeon2@gmail.com
To: shuah@kernel.org, krzysztof.kozlowski@canonical.com
Cc: netdev@vger.kernel.org, linux-nfc@lists.01.org,
	linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org,
	Bongsu Jeon <bongsu.jeon@samsung.com>
Subject: [PATCH v2 net-next 3/8] selftests: nci: Fix the typo
Date: Tue, 17 Aug 2021 06:28:13 -0700	[thread overview]
Message-ID: <20210817132818.8275-4-bongsu.jeon2@gmail.com> (raw)
In-Reply-To: <20210817132818.8275-1-bongsu.jeon2@gmail.com>

From: Bongsu Jeon <bongsu.jeon@samsung.com>

Fix typo: rep_len -> resp_len

Signed-off-by: Bongsu Jeon <bongsu.jeon@samsung.com>
---
 tools/testing/selftests/nci/nci_dev.c | 24 ++++++++++++------------
 1 file changed, 12 insertions(+), 12 deletions(-)

diff --git a/tools/testing/selftests/nci/nci_dev.c b/tools/testing/selftests/nci/nci_dev.c
index 34e76c7fa1fe..b4d85eeb5fd1 100644
--- a/tools/testing/selftests/nci/nci_dev.c
+++ b/tools/testing/selftests/nci/nci_dev.c
@@ -158,7 +158,7 @@ static int get_family_id(int sd, __u32 pid)
 		char buf[512];
 	} ans;
 	struct nlattr *na;
-	int rep_len;
+	int resp_len;
 	__u16 id;
 	int rc;
 
@@ -167,10 +167,10 @@ static int get_family_id(int sd, __u32 pid)
 	if (rc < 0)
 		return 0;
 
-	rep_len = recv(sd, &ans, sizeof(ans), 0);
+	resp_len = recv(sd, &ans, sizeof(ans), 0);
 
-	if (ans.n.nlmsg_type == NLMSG_ERROR || rep_len < 0 ||
-	    !NLMSG_OK(&ans.n, rep_len))
+	if (ans.n.nlmsg_type == NLMSG_ERROR || resp_len < 0 ||
+	    !NLMSG_OK(&ans.n, resp_len))
 		return 0;
 
 	na = (struct nlattr *)GENLMSG_DATA(&ans);
@@ -194,7 +194,7 @@ static int send_cmd_with_idx(int sd, __u16 nlmsg_type, __u32 nlmsg_pid,
 
 static int get_nci_devid(int sd, __u16 fid, __u32 pid, int dev_id, struct msgtemplate *msg)
 {
-	int rc, rep_len;
+	int rc, resp_len;
 
 	rc = send_cmd_with_idx(sd, fid, pid, NFC_CMD_GET_DEVICE, dev_id);
 	if (rc < 0) {
@@ -202,14 +202,14 @@ static int get_nci_devid(int sd, __u16 fid, __u32 pid, int dev_id, struct msgtem
 		goto error;
 	}
 
-	rep_len = recv(sd, msg, sizeof(*msg), 0);
-	if (rep_len < 0) {
+	resp_len = recv(sd, msg, sizeof(*msg), 0);
+	if (resp_len < 0) {
 		rc = -2;
 		goto error;
 	}
 
 	if (msg->n.nlmsg_type == NLMSG_ERROR ||
-	    !NLMSG_OK(&msg->n, rep_len)) {
+	    !NLMSG_OK(&msg->n, resp_len)) {
 		rc = -3;
 		goto error;
 	}
@@ -222,21 +222,21 @@ static int get_nci_devid(int sd, __u16 fid, __u32 pid, int dev_id, struct msgtem
 static __u8 get_dev_enable_state(struct msgtemplate *msg)
 {
 	struct nlattr *na;
-	int rep_len;
+	int resp_len;
 	int len;
 
-	rep_len = GENLMSG_PAYLOAD(&msg->n);
+	resp_len = GENLMSG_PAYLOAD(&msg->n);
 	na = (struct nlattr *)GENLMSG_DATA(msg);
 	len = 0;
 
-	while (len < rep_len) {
+	while (len < resp_len) {
 		len += NLA_ALIGN(na->nla_len);
 		if (na->nla_type == NFC_ATTR_DEVICE_POWERED)
 			return *(char *)NLA_DATA(na);
 		na = (struct nlattr *)(GENLMSG_DATA(msg) + len);
 	}
 
-	return rep_len;
+	return resp_len;
 }
 
 FIXTURE(NCI) {
-- 
2.32.0


  parent reply	other threads:[~2021-08-17 13:29 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-17 13:28 [PATCH v2 net-next 0/8] Update the virtual NCI device driver and add the NCI testcase bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 1/8] nfc: virtual_ncidev: Use wait queue instead of polling bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 2/8] selftests: nci: Remove the polling code to read a NCI frame bongsu.jeon2
2021-08-17 13:28 ` bongsu.jeon2 [this message]
2021-08-17 13:28 ` [PATCH v2 net-next 4/8] selftests: nci: Fix the code for next nlattr offset bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 5/8] selftests: nci: Fix the wrong condition bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 6/8] selftests: nci: Add the flags parameter for the send_cmd_mt_nla bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 7/8] selftests: nci: Extract the start/stop discovery function bongsu.jeon2
2021-08-17 13:28 ` [PATCH v2 net-next 8/8] selftests: nci: Add the NCI testcase reading T4T Tag bongsu.jeon2
2021-08-18  9:40 ` [PATCH v2 net-next 0/8] Update the virtual NCI device driver and add the NCI testcase patchwork-bot+netdevbpf

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210817132818.8275-4-bongsu.jeon2@gmail.com \
    --to=bongsu.jeon2@gmail.com \
    --cc=bongsu.jeon@samsung.com \
    --cc=krzysztof.kozlowski@canonical.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-kselftest@vger.kernel.org \
    --cc=linux-nfc@lists.01.org \
    --cc=netdev@vger.kernel.org \
    --cc=shuah@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®