@@ -177,7 +177,7 @@ static ssize_t post_reset_wdog_show(struct device *dev,
177
177
if (ret < 0 )
178
178
return ret ;
179
179
180
- return sprintf (buf , "%d\n" , ret );
180
+ return sysfs_emit (buf , "%d\n" , ret );
181
181
}
182
182
183
183
static ssize_t post_reset_wdog_store (struct device * dev ,
@@ -206,7 +206,7 @@ static ssize_t mlxbf_bootctl_show(int smc_op, char *buf)
206
206
if (action < 0 )
207
207
return action ;
208
208
209
- return sprintf (buf , "%s\n" , mlxbf_bootctl_action_to_string (action ));
209
+ return sysfs_emit (buf , "%s\n" , mlxbf_bootctl_action_to_string (action ));
210
210
}
211
211
212
212
static int mlxbf_bootctl_store (int smc_op , const char * buf , size_t count )
@@ -274,14 +274,14 @@ static ssize_t lifecycle_state_show(struct device *dev,
274
274
* due to using the test bits.
275
275
*/
276
276
if (test_state ) {
277
- return sprintf (buf , "%s(test)\n" ,
277
+ return sysfs_emit (buf , "%s(test)\n" ,
278
278
mlxbf_bootctl_lifecycle_states [lc_state ]);
279
279
} else if (use_dev_key &&
280
280
(lc_state == MLXBF_BOOTCTL_SB_LIFECYCLE_GA_SECURE )) {
281
- return sprintf (buf , "Secured (development)\n" );
281
+ return sysfs_emit (buf , "Secured (development)\n" );
282
282
}
283
283
284
- return sprintf (buf , "%s\n" , mlxbf_bootctl_lifecycle_states [lc_state ]);
284
+ return sysfs_emit (buf , "%s\n" , mlxbf_bootctl_lifecycle_states [lc_state ]);
285
285
}
286
286
287
287
static ssize_t secure_boot_fuse_state_show (struct device * dev ,
@@ -332,9 +332,9 @@ static ssize_t secure_boot_fuse_state_show(struct device *dev,
332
332
else
333
333
status = valid ? "Invalid" : "Free" ;
334
334
}
335
- buf_len += sprintf (buf + buf_len , "%d:%s " , key , status );
335
+ buf_len += sysfs_emit (buf + buf_len , "%d:%s " , key , status );
336
336
}
337
- buf_len += sprintf (buf + buf_len , "\n" );
337
+ buf_len += sysfs_emit (buf + buf_len , "\n" );
338
338
339
339
return buf_len ;
340
340
}
0 commit comments