diff mbox series

[v1] rtlwifi: btcoex: use %*ph to print small buffer

Message ID 20200730154026.39901-1-andriy.shevchenko@linux.intel.com (mailing list archive)
State Accepted
Commit 1751a7352b632991600c3e7e604be3920a82b386
Delegated to: Kalle Valo
Headers show
Series [v1] rtlwifi: btcoex: use %*ph to print small buffer | expand

Commit Message

Andy Shevchenko July 30, 2020, 3:40 p.m. UTC
Use %*ph format to print small buffer as hex string.

Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
 .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c   | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

Comments

Ping-Ke Shih July 31, 2020, 2:53 a.m. UTC | #1
On Thu, 2020-07-30 at 15:40 +0000, Andy Shevchenko wrote:
> Use %*ph format to print small buffer as hex string.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>

Acked-by: Ping-Ke Shih <pkshih@realtek.com>

> ---
>  .../net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c   | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> index a4940a3842de..0850c5ddad14 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
> @@ -894,11 +894,9 @@ static void halbtc_display_wifi_status(struct btc_coexist
> *btcoexist,
>  		   (low_power ? ", 32k" : ""));
>  
>  	seq_printf(m,
> -		   "\n %-35s = %02x %02x %02x %02x %02x %02x (0x%x/0x%x)",
> +		   "\n %-35s = %6ph (0x%x/0x%x)",
>  		   "Power mode cmd(lps/rpwm)",
> -		   btcoexist->pwr_mode_val[0], btcoexist->pwr_mode_val[1],
> -		   btcoexist->pwr_mode_val[2], btcoexist->pwr_mode_val[3],
> -		   btcoexist->pwr_mode_val[4], btcoexist->pwr_mode_val[5],
> +		   btcoexist->pwr_mode_val,
>  		   btcoexist->bt_info.lps_val,
>  		   btcoexist->bt_info.rpwm_val);
>  }
> -- 
> 2.27.0
>
Kalle Valo Aug. 2, 2020, 2:55 p.m. UTC | #2
Andy Shevchenko <andriy.shevchenko@linux.intel.com> wrote:

> Use %*ph format to print small buffer as hex string.
> 
> Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
> Acked-by: Ping-Ke Shih <pkshih@realtek.com>

Patch applied to wireless-drivers-next.git, thanks.

1751a7352b63 rtlwifi: btcoex: use %*ph to print small buffer
diff mbox series

Patch

diff --git a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
index a4940a3842de..0850c5ddad14 100644
--- a/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
+++ b/drivers/net/wireless/realtek/rtlwifi/btcoexist/halbtcoutsrc.c
@@ -894,11 +894,9 @@  static void halbtc_display_wifi_status(struct btc_coexist *btcoexist,
 		   (low_power ? ", 32k" : ""));
 
 	seq_printf(m,
-		   "\n %-35s = %02x %02x %02x %02x %02x %02x (0x%x/0x%x)",
+		   "\n %-35s = %6ph (0x%x/0x%x)",
 		   "Power mode cmd(lps/rpwm)",
-		   btcoexist->pwr_mode_val[0], btcoexist->pwr_mode_val[1],
-		   btcoexist->pwr_mode_val[2], btcoexist->pwr_mode_val[3],
-		   btcoexist->pwr_mode_val[4], btcoexist->pwr_mode_val[5],
+		   btcoexist->pwr_mode_val,
 		   btcoexist->bt_info.lps_val,
 		   btcoexist->bt_info.rpwm_val);
 }