lkml.org 
[lkml]   [2023]   [Oct]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH] net: phy: tja11xx: replace deprecated strncpy with ethtool_sprintf
> -	for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++) {
> - strncpy(data + i * ETH_GSTRING_LEN,
> - tja11xx_hw_stats[i].string, ETH_GSTRING_LEN);
> - }
> + for (i = 0; i < ARRAY_SIZE(tja11xx_hw_stats); i++)
> + ethtool_sprintf(&data, "%s", tja11xx_hw_stats[i].string);
> }

I assume you are using "%s" because tja11xx_hw_stats[i].string cannot
be trusted as a format string? Is this indicating we need an
ethtool_puts() ?

Andrew

\
 
 \ /
  Last update: 2023-10-13 14:23    [W:0.085 / U:1.228 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site