Skip to contentSkip to conversation

hostap: proc: substitute loops by %*phN

PATCH In review Andy Shevchenko 2 participants 4 messages Sep 5, 2014 – Sep 15, 2014 Networking drivers (wireless)

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 hostap: proc: substitute loops by %*phN

For dumping small buffers we may use %*phN specifier instead of custom approach..

---
 drivers/net/wireless/hostap/hostap_proc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/hostap/hostap_proc.c +2 -4
index 16a06b6..4e2a7dd9 100644
@@ -184,11 +184,9 @@ static int prism2_bss_list_proc_show(struct seq_file *m, void *v)
 	seq_printf(m, "%*pE", bss->ssid_len, bss->ssid);
 
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->ssid_len; i++)
-		seq_printf(m, "%02x", bss->ssid[i]);
+	seq_printf(m, "%*phN", (int)bss->ssid_len, bss->ssid);
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->wpa_ie_len; i++)
-		seq_printf(m, "%02x", bss->wpa_ie[i]);
+	seq_printf(m, "%*phN", (int)bss->wpa_ie_len, bss->wpa_ie);
 	seq_putc(m, '\n');
 	return 0;
 }
Signature · 1 line
2.1.0
#1 lore raw

Applying: hostap: proc: substitute loops by %*phN
error: patch failed: drivers/net/wireless/hostap/hostap_proc.c:184
error: drivers/net/wireless/hostap/hostap_proc.c: patch does not apply

Quoted 34 lines · Andy Shevchenko

For dumping small buffers we may use %*phN specifier instead of custom approach..

---
 drivers/net/wireless/hostap/hostap_proc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/hostap/hostap_proc.c +2 -4
index 16a06b6..4e2a7dd9 100644
@@ -184,11 +184,9 @@ static int prism2_bss_list_proc_show(struct seq_file *m, void *v)
 	seq_printf(m, "%*pE", bss->ssid_len, bss->ssid);
 
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->ssid_len; i++)
-		seq_printf(m, "%02x", bss->ssid[i]);
+	seq_printf(m, "%*phN", (int)bss->ssid_len, bss->ssid);
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->wpa_ie_len; i++)
-		seq_printf(m, "%02x", bss->wpa_ie[i]);
+	seq_printf(m, "%*phN", (int)bss->wpa_ie_len, bss->wpa_ie);
 	seq_putc(m, '\n');
 	return 0;
 }
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.
#2 lore raw
Quoted 3 lines · John W. Linville

Applying: hostap: proc: substitute loops by %*phN
error: patch failed: drivers/net/wireless/hostap/hostap_proc.c:184
error: drivers/net/wireless/hostap/hostap_proc.c: patch does not apply

Hmm... Originally it was applied on top of linux-next (few days ago).

Just checking with current origin/master. Applied correctly.

Moreover, took recent wireless-next. No issues.
Which tree you are trying?

Quoted 37 lines · Andy Shevchenko
Quoted 34 lines

For dumping small buffers we may use %*phN specifier instead of custom approach..

---
 drivers/net/wireless/hostap/hostap_proc.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)
drivers/net/wireless/hostap/hostap_proc.c +2 -4
index 16a06b6..4e2a7dd9 100644
@@ -184,11 +184,9 @@ static int prism2_bss_list_proc_show(struct seq_file *m, void *v)
 	seq_printf(m, "%*pE", bss->ssid_len, bss->ssid);
 
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->ssid_len; i++)
-		seq_printf(m, "%02x", bss->ssid[i]);
+	seq_printf(m, "%*phN", (int)bss->ssid_len, bss->ssid);
 	seq_putc(m, '\t');
-	for (i = 0; i < bss->wpa_ie_len; i++)
-		seq_printf(m, "%02x", bss->wpa_ie[i]);
+	seq_printf(m, "%*phN", (int)bss->wpa_ie_len, bss->wpa_ie);
 	seq_putc(m, '\n');
 	return 0;
 }
Signature · 6 lines
2.1.0

--
To unsubscribe from this list: send the line "unsubscribe linux-wireless" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Signature · 2 lines
Andy Shevchenko <[email protected]>
Intel Finland Oy
#3 lore raw
Quoted 11 lines · Andy Shevchenko
Quoted 3 lines · John W. Linville

Applying: hostap: proc: substitute loops by %*phN
error: patch failed: drivers/net/wireless/hostap/hostap_proc.c:184
error: drivers/net/wireless/hostap/hostap_proc.c: patch does not apply

Hmm... Originally it was applied on top of linux-next (few days ago).

Just checking with current origin/master. Applied correctly.

Moreover, took recent wireless-next. No issues.
Which tree you are trying?

It only to wireless-next with some fuzz. I think I have it sorted now.

John

Signature · 2 lines
John W. Linville		Someday the world will need a hero, and you
[email protected]			might be all we have.  Be ready.