@@ -2716,7 +2716,7 @@ static ssize_t device_id_show(struct device *dev,
2716
2716
if (rv )
2717
2717
return rv ;
2718
2718
2719
- return snprintf (buf , 10 , "%u\n" , id .device_id );
2719
+ return sysfs_emit (buf , "%u\n" , id .device_id );
2720
2720
}
2721
2721
static DEVICE_ATTR_RO (device_id );
2722
2722
@@ -2732,7 +2732,7 @@ static ssize_t provides_device_sdrs_show(struct device *dev,
2732
2732
if (rv )
2733
2733
return rv ;
2734
2734
2735
- return snprintf (buf , 10 , "%u\n" , (id .device_revision & 0x80 ) >> 7 );
2735
+ return sysfs_emit (buf , "%u\n" , (id .device_revision & 0x80 ) >> 7 );
2736
2736
}
2737
2737
static DEVICE_ATTR_RO (provides_device_sdrs );
2738
2738
@@ -2747,7 +2747,7 @@ static ssize_t revision_show(struct device *dev, struct device_attribute *attr,
2747
2747
if (rv )
2748
2748
return rv ;
2749
2749
2750
- return snprintf (buf , 20 , "%u\n" , id .device_revision & 0x0F );
2750
+ return sysfs_emit (buf , "%u\n" , id .device_revision & 0x0F );
2751
2751
}
2752
2752
static DEVICE_ATTR_RO (revision );
2753
2753
@@ -2763,7 +2763,7 @@ static ssize_t firmware_revision_show(struct device *dev,
2763
2763
if (rv )
2764
2764
return rv ;
2765
2765
2766
- return snprintf (buf , 20 , "%u.%x\n" , id .firmware_revision_1 ,
2766
+ return sysfs_emit (buf , "%u.%x\n" , id .firmware_revision_1 ,
2767
2767
id .firmware_revision_2 );
2768
2768
}
2769
2769
static DEVICE_ATTR_RO (firmware_revision );
@@ -2780,7 +2780,7 @@ static ssize_t ipmi_version_show(struct device *dev,
2780
2780
if (rv )
2781
2781
return rv ;
2782
2782
2783
- return snprintf (buf , 20 , "%u.%u\n" ,
2783
+ return sysfs_emit (buf , "%u.%u\n" ,
2784
2784
ipmi_version_major (& id ),
2785
2785
ipmi_version_minor (& id ));
2786
2786
}
@@ -2798,7 +2798,7 @@ static ssize_t add_dev_support_show(struct device *dev,
2798
2798
if (rv )
2799
2799
return rv ;
2800
2800
2801
- return snprintf (buf , 10 , "0x%02x\n" , id .additional_device_support );
2801
+ return sysfs_emit (buf , "0x%02x\n" , id .additional_device_support );
2802
2802
}
2803
2803
static DEVICE_ATTR (additional_device_support , S_IRUGO , add_dev_support_show ,
2804
2804
NULL) ;
@@ -2815,7 +2815,7 @@ static ssize_t manufacturer_id_show(struct device *dev,
2815
2815
if (rv )
2816
2816
return rv ;
2817
2817
2818
- return snprintf (buf , 20 , "0x%6.6x\n" , id .manufacturer_id );
2818
+ return sysfs_emit (buf , "0x%6.6x\n" , id .manufacturer_id );
2819
2819
}
2820
2820
static DEVICE_ATTR_RO (manufacturer_id );
2821
2821
@@ -2831,7 +2831,7 @@ static ssize_t product_id_show(struct device *dev,
2831
2831
if (rv )
2832
2832
return rv ;
2833
2833
2834
- return snprintf (buf , 10 , "0x%4.4x\n" , id .product_id );
2834
+ return sysfs_emit (buf , "0x%4.4x\n" , id .product_id );
2835
2835
}
2836
2836
static DEVICE_ATTR_RO (product_id );
2837
2837
@@ -2847,7 +2847,7 @@ static ssize_t aux_firmware_rev_show(struct device *dev,
2847
2847
if (rv )
2848
2848
return rv ;
2849
2849
2850
- return snprintf (buf , 21 , "0x%02x 0x%02x 0x%02x 0x%02x\n" ,
2850
+ return sysfs_emit (buf , "0x%02x 0x%02x 0x%02x 0x%02x\n" ,
2851
2851
id .aux_firmware_revision [3 ],
2852
2852
id .aux_firmware_revision [2 ],
2853
2853
id .aux_firmware_revision [1 ],
@@ -2869,7 +2869,7 @@ static ssize_t guid_show(struct device *dev, struct device_attribute *attr,
2869
2869
if (!guid_set )
2870
2870
return - ENOENT ;
2871
2871
2872
- return snprintf (buf , UUID_STRING_LEN + 1 + 1 , "%pUl\n" , & guid );
2872
+ return sysfs_emit (buf , "%pUl\n" , & guid );
2873
2873
}
2874
2874
static DEVICE_ATTR_RO (guid );
2875
2875
0 commit comments