Fix:strlcpy() is deprecated in kernel 6.8.0+, using strscpy instead
This commit is contained in:
parent
c9d5e15b09
commit
5824e03748
@ -1760,8 +1760,14 @@ static void ql_net_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *i
|
|||||||
{
|
{
|
||||||
/* Inherit standard device info */
|
/* Inherit standard device info */
|
||||||
usbnet_get_drvinfo(net, info);
|
usbnet_get_drvinfo(net, info);
|
||||||
|
/* strlcpy() is deprecated in kernel 6.8.0+, using strscpy instead */
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0))
|
||||||
strlcpy(info->driver, driver_name, sizeof(info->driver));
|
strlcpy(info->driver, driver_name, sizeof(info->driver));
|
||||||
strlcpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
strlcpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
||||||
|
#else
|
||||||
|
strscpy(info->driver, driver_name, sizeof(info->driver));
|
||||||
|
strscpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ethtool_ops ql_net_ethtool_ops;
|
static struct ethtool_ops ql_net_ethtool_ops;
|
||||||
|
@ -1949,8 +1949,14 @@ static void ql_net_get_drvinfo(struct net_device *net, struct ethtool_drvinfo *i
|
|||||||
{
|
{
|
||||||
/* Inherit standard device info */
|
/* Inherit standard device info */
|
||||||
usbnet_get_drvinfo(net, info);
|
usbnet_get_drvinfo(net, info);
|
||||||
|
/* strlcpy() is deprecated in kernel 6.8.0+, using strscpy instead */
|
||||||
|
#if (LINUX_VERSION_CODE < KERNEL_VERSION(6,8,0))
|
||||||
strlcpy(info->driver, driver_name, sizeof(info->driver));
|
strlcpy(info->driver, driver_name, sizeof(info->driver));
|
||||||
strlcpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
strlcpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
||||||
|
#else
|
||||||
|
strscpy(info->driver, driver_name, sizeof(info->driver));
|
||||||
|
strscpy(info->version, VERSION_NUMBER, sizeof(info->version));
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
static struct ethtool_ops ql_net_ethtool_ops;
|
static struct ethtool_ops ql_net_ethtool_ops;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user