]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
net/mlx5: SF, use recent sysfs api
authorParav Pandit <parav@nvidia.com>
Tue, 18 May 2021 05:50:04 +0000 (08:50 +0300)
committerSaeed Mahameed <saeedm@nvidia.com>
Wed, 11 Aug 2021 18:14:32 +0000 (11:14 -0700)
Use sysfs_emit() which is aware of PAGE_SIZE buffer.

Signed-off-by: Parav Pandit <parav@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
drivers/net/ethernet/mellanox/mlx5/core/sf/dev/dev.c

index fa0288afc0dd4e42992c0a1e96f4314216432af4..871c2fbe18d39f541fd076abb2e403844c685c25 100644 (file)
@@ -39,7 +39,7 @@ static ssize_t sfnum_show(struct device *dev, struct device_attribute *attr, cha
        struct auxiliary_device *adev = container_of(dev, struct auxiliary_device, dev);
        struct mlx5_sf_dev *sf_dev = container_of(adev, struct mlx5_sf_dev, adev);
 
-       return scnprintf(buf, PAGE_SIZE, "%u\n", sf_dev->sfnum);
+       return sysfs_emit(buf, "%u\n", sf_dev->sfnum);
 }
 static DEVICE_ATTR_RO(sfnum);