@@ -1721,8 +1721,8 @@ show_in_reg(struct device *dev, struct device_attribute *attr, char *buf)
17211721 if (IS_ERR (data ))
17221722 return PTR_ERR (data );
17231723
1724- return sprintf (buf , "%ld\n" ,
1725- in_from_reg (data -> in [nr ][index ], nr , data -> scale_in ));
1724+ return sysfs_emit (buf , "%ld\n" ,
1725+ in_from_reg (data -> in [nr ][index ], nr , data -> scale_in ));
17261726}
17271727
17281728static ssize_t
@@ -1757,8 +1757,8 @@ nct6775_show_alarm(struct device *dev, struct device_attribute *attr, char *buf)
17571757 return PTR_ERR (data );
17581758
17591759 nr = data -> ALARM_BITS [sattr -> index ];
1760- return sprintf (buf , "%u\n" ,
1761- (unsigned int )((data -> alarms >> nr ) & 0x01 ));
1760+ return sysfs_emit (buf , "%u\n" ,
1761+ (unsigned int )((data -> alarms >> nr ) & 0x01 ));
17621762}
17631763EXPORT_SYMBOL_GPL (nct6775_show_alarm );
17641764
@@ -1800,7 +1800,7 @@ show_temp_alarm(struct device *dev, struct device_attribute *attr, char *buf)
18001800
18011801 alarm = (data -> alarms >> bit ) & 0x01 ;
18021802 }
1803- return sprintf (buf , "%u\n" , alarm );
1803+ return sysfs_emit (buf , "%u\n" , alarm );
18041804}
18051805
18061806ssize_t
@@ -1815,8 +1815,8 @@ nct6775_show_beep(struct device *dev, struct device_attribute *attr, char *buf)
18151815
18161816 nr = data -> BEEP_BITS [sattr -> index ];
18171817
1818- return sprintf (buf , "%u\n" ,
1819- (unsigned int )((data -> beeps >> nr ) & 0x01 ));
1818+ return sysfs_emit (buf , "%u\n" ,
1819+ (unsigned int )((data -> beeps >> nr ) & 0x01 ));
18201820}
18211821EXPORT_SYMBOL_GPL (nct6775_show_beep );
18221822
@@ -1870,7 +1870,7 @@ show_temp_beep(struct device *dev, struct device_attribute *attr, char *buf)
18701870
18711871 beep = (data -> beeps >> bit ) & 0x01 ;
18721872 }
1873- return sprintf (buf , "%u\n" , beep );
1873+ return sysfs_emit (buf , "%u\n" , beep );
18741874}
18751875
18761876static ssize_t
@@ -1960,7 +1960,7 @@ show_fan(struct device *dev, struct device_attribute *attr, char *buf)
19601960 if (IS_ERR (data ))
19611961 return PTR_ERR (data );
19621962
1963- return sprintf (buf , "%d\n" , data -> rpm [nr ]);
1963+ return sysfs_emit (buf , "%d\n" , data -> rpm [nr ]);
19641964}
19651965
19661966static ssize_t
@@ -1973,9 +1973,9 @@ show_fan_min(struct device *dev, struct device_attribute *attr, char *buf)
19731973 if (IS_ERR (data ))
19741974 return PTR_ERR (data );
19751975
1976- return sprintf (buf , "%d\n" ,
1977- data -> fan_from_reg_min (data -> fan_min [nr ],
1978- data -> fan_div [nr ]));
1976+ return sysfs_emit (buf , "%d\n" ,
1977+ data -> fan_from_reg_min (data -> fan_min [nr ],
1978+ data -> fan_div [nr ]));
19791979}
19801980
19811981static ssize_t
@@ -1988,7 +1988,7 @@ show_fan_div(struct device *dev, struct device_attribute *attr, char *buf)
19881988 if (IS_ERR (data ))
19891989 return PTR_ERR (data );
19901990
1991- return sprintf (buf , "%u\n" , div_from_reg (data -> fan_div [nr ]));
1991+ return sysfs_emit (buf , "%u\n" , div_from_reg (data -> fan_div [nr ]));
19921992}
19931993
19941994static ssize_t
@@ -2098,7 +2098,7 @@ show_fan_pulses(struct device *dev, struct device_attribute *attr, char *buf)
20982098 return PTR_ERR (data );
20992099
21002100 p = data -> fan_pulses [sattr -> index ];
2101- return sprintf (buf , "%d\n" , p ? : 4 );
2101+ return sysfs_emit (buf , "%d\n" , p ? : 4 );
21022102}
21032103
21042104static ssize_t
@@ -2197,7 +2197,7 @@ show_temp_label(struct device *dev, struct device_attribute *attr, char *buf)
21972197 if (IS_ERR (data ))
21982198 return PTR_ERR (data );
21992199
2200- return sprintf (buf , "%s\n" , data -> temp_label [data -> temp_src [nr ]]);
2200+ return sysfs_emit (buf , "%s\n" , data -> temp_label [data -> temp_src [nr ]]);
22012201}
22022202
22032203static ssize_t
@@ -2211,7 +2211,8 @@ show_temp(struct device *dev, struct device_attribute *attr, char *buf)
22112211 if (IS_ERR (data ))
22122212 return PTR_ERR (data );
22132213
2214- return sprintf (buf , "%d\n" , LM75_TEMP_FROM_REG (data -> temp [index ][nr ]));
2214+ return sysfs_emit (buf , "%d\n" ,
2215+ LM75_TEMP_FROM_REG (data -> temp [index ][nr ]));
22152216}
22162217
22172218static ssize_t
@@ -2245,7 +2246,7 @@ show_temp_offset(struct device *dev, struct device_attribute *attr, char *buf)
22452246 if (IS_ERR (data ))
22462247 return PTR_ERR (data );
22472248
2248- return sprintf (buf , "%d\n" , data -> temp_offset [sattr -> index ] * 1000 );
2249+ return sysfs_emit (buf , "%d\n" , data -> temp_offset [sattr -> index ] * 1000 );
22492250}
22502251
22512252static ssize_t
@@ -2282,7 +2283,7 @@ show_temp_type(struct device *dev, struct device_attribute *attr, char *buf)
22822283 if (IS_ERR (data ))
22832284 return PTR_ERR (data );
22842285
2285- return sprintf (buf , "%d\n" , (int )data -> temp_type [nr ]);
2286+ return sysfs_emit (buf , "%d\n" , (int )data -> temp_type [nr ]);
22862287}
22872288
22882289static ssize_t
@@ -2468,7 +2469,7 @@ show_pwm_mode(struct device *dev, struct device_attribute *attr, char *buf)
24682469 if (IS_ERR (data ))
24692470 return PTR_ERR (data );
24702471
2471- return sprintf (buf , "%d\n" , data -> pwm_mode [sattr -> index ]);
2472+ return sysfs_emit (buf , "%d\n" , data -> pwm_mode [sattr -> index ]);
24722473}
24732474
24742475static ssize_t
@@ -2535,7 +2536,7 @@ show_pwm(struct device *dev, struct device_attribute *attr, char *buf)
25352536 pwm = data -> pwm [index ][nr ];
25362537 }
25372538
2538- return sprintf (buf , "%d\n" , pwm );
2539+ return sysfs_emit (buf , "%d\n" , pwm );
25392540}
25402541
25412542static ssize_t
@@ -2667,7 +2668,7 @@ show_pwm_enable(struct device *dev, struct device_attribute *attr, char *buf)
26672668 if (IS_ERR (data ))
26682669 return PTR_ERR (data );
26692670
2670- return sprintf (buf , "%d\n" , data -> pwm_enable [sattr -> index ]);
2671+ return sysfs_emit (buf , "%d\n" , data -> pwm_enable [sattr -> index ]);
26712672}
26722673
26732674static ssize_t
@@ -2736,7 +2737,7 @@ show_pwm_temp_sel_common(struct nct6775_data *data, char *buf, int src)
27362737 }
27372738 }
27382739
2739- return sprintf (buf , "%d\n" , sel );
2740+ return sysfs_emit (buf , "%d\n" , sel );
27402741}
27412742
27422743static ssize_t
@@ -2861,7 +2862,7 @@ show_target_temp(struct device *dev, struct device_attribute *attr, char *buf)
28612862 if (IS_ERR (data ))
28622863 return PTR_ERR (data );
28632864
2864- return sprintf (buf , "%d\n" , data -> target_temp [sattr -> index ] * 1000 );
2865+ return sysfs_emit (buf , "%d\n" , data -> target_temp [sattr -> index ] * 1000 );
28652866}
28662867
28672868static ssize_t
@@ -2897,9 +2898,9 @@ show_target_speed(struct device *dev, struct device_attribute *attr, char *buf)
28972898 if (IS_ERR (data ))
28982899 return PTR_ERR (data );
28992900
2900- return sprintf (buf , "%d\n" ,
2901- fan_from_reg16 (data -> target_speed [nr ],
2902- data -> fan_div [nr ]));
2901+ return sysfs_emit (buf , "%d\n" ,
2902+ fan_from_reg16 (data -> target_speed [nr ],
2903+ data -> fan_div [nr ]));
29032904}
29042905
29052906static ssize_t
@@ -2939,7 +2940,7 @@ show_temp_tolerance(struct device *dev, struct device_attribute *attr,
29392940 if (IS_ERR (data ))
29402941 return PTR_ERR (data );
29412942
2942- return sprintf (buf , "%d\n" , data -> temp_tolerance [index ][nr ] * 1000 );
2943+ return sysfs_emit (buf , "%d\n" , data -> temp_tolerance [index ][nr ] * 1000 );
29432944}
29442945
29452946static ssize_t
@@ -3006,7 +3007,7 @@ show_speed_tolerance(struct device *dev, struct device_attribute *attr,
30063007 - fan_from_reg16 (high , data -> fan_div [nr ])) / 2 ;
30073008 }
30083009
3009- return sprintf (buf , "%d\n" , tolerance );
3010+ return sysfs_emit (buf , "%d\n" , tolerance );
30103011}
30113012
30123013static ssize_t
@@ -3066,7 +3067,7 @@ show_weight_temp(struct device *dev, struct device_attribute *attr, char *buf)
30663067 if (IS_ERR (data ))
30673068 return PTR_ERR (data );
30683069
3069- return sprintf (buf , "%d\n" , data -> weight_temp [index ][nr ] * 1000 );
3070+ return sysfs_emit (buf , "%d\n" , data -> weight_temp [index ][nr ] * 1000 );
30703071}
30713072
30723073static ssize_t
@@ -3115,9 +3116,9 @@ show_fan_time(struct device *dev, struct device_attribute *attr, char *buf)
31153116 if (IS_ERR (data ))
31163117 return PTR_ERR (data );
31173118
3118- return sprintf (buf , "%d\n" ,
3119- step_time_from_reg (data -> fan_time [index ][nr ],
3120- data -> pwm_mode [nr ]));
3119+ return sysfs_emit (buf , "%d\n" ,
3120+ step_time_from_reg (data -> fan_time [index ][nr ],
3121+ data -> pwm_mode [nr ]));
31213122}
31223123
31233124static ssize_t
@@ -3152,7 +3153,8 @@ show_auto_pwm(struct device *dev, struct device_attribute *attr, char *buf)
31523153 if (IS_ERR (data ))
31533154 return PTR_ERR (data );
31543155
3155- return sprintf (buf , "%d\n" , data -> auto_pwm [sattr -> nr ][sattr -> index ]);
3156+ return sysfs_emit (buf , "%d\n" ,
3157+ data -> auto_pwm [sattr -> nr ][sattr -> index ]);
31563158}
31573159
31583160static ssize_t
@@ -3244,7 +3246,7 @@ show_auto_temp(struct device *dev, struct device_attribute *attr, char *buf)
32443246 * We don't know for sure if the temperature is signed or unsigned.
32453247 * Assume it is unsigned.
32463248 */
3247- return sprintf (buf , "%d\n" , data -> auto_temp [nr ][point ] * 1000 );
3249+ return sysfs_emit (buf , "%d\n" , data -> auto_temp [nr ][point ] * 1000 );
32483250}
32493251
32503252static ssize_t
0 commit comments