From patchwork Fri Sep 5 14:30:16 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andy Shevchenko X-Patchwork-Id: 4852561 Return-Path: X-Original-To: patchwork-linux-wireless@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 103C99F2EC for ; Fri, 5 Sep 2014 14:30:30 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id CCFC220256 for ; Fri, 5 Sep 2014 14:30:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A6F3A201CE for ; Fri, 5 Sep 2014 14:30:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932504AbaIEOaY (ORCPT ); Fri, 5 Sep 2014 10:30:24 -0400 Received: from mga09.intel.com ([134.134.136.24]:25359 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751379AbaIEOaY (ORCPT ); Fri, 5 Sep 2014 10:30:24 -0400 Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga102.jf.intel.com with ESMTP; 05 Sep 2014 07:24:19 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.04,473,1406617200"; d="scan'208";a="568889822" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.168]) by orsmga001.jf.intel.com with ESMTP; 05 Sep 2014 07:30:19 -0700 Received: from andy by smile with local (Exim 4.84) (envelope-from ) id 1XPuWn-00073m-Ih; Fri, 05 Sep 2014 17:30:17 +0300 From: Andy Shevchenko To: Jouni Malinen , linux-wireless@vger.kernel.org Cc: Andy Shevchenko Subject: [PATCH] hostap: proc: substitute loops by %*phN Date: Fri, 5 Sep 2014 17:30:16 +0300 Message-Id: <1409927416-27101-1-git-send-email-andriy.shevchenko@linux.intel.com> X-Mailer: git-send-email 2.1.0 Sender: linux-wireless-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-wireless@vger.kernel.org X-Spam-Status: No, score=-8.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP For dumping small buffers we may use %*phN specifier instead of custom approach.. Signed-off-by: Andy Shevchenko --- drivers/net/wireless/hostap/hostap_proc.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/drivers/net/wireless/hostap/hostap_proc.c b/drivers/net/wireless/hostap/hostap_proc.c index 16a06b6..4e2a7dd9 100644 --- a/drivers/net/wireless/hostap/hostap_proc.c +++ b/drivers/net/wireless/hostap/hostap_proc.c @@ -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; }