Skip to content

Commit

Permalink
ALSA: ac97: Replace sprintf() with sysfs_emit()
Browse files Browse the repository at this point in the history
For sysfs outputs, it's safer to use a new helper, sysfs_emit(),
instead of the raw sprintf() & co.  This patch replaces the open code
straightforwardly with a new helper.

Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Takashi Iwai <[email protected]>
  • Loading branch information
tiwai committed Aug 2, 2022
1 parent a3b5d47 commit 7450320
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sound/ac97/bus.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static ssize_t vendor_id_show(struct device *dev,
{
struct ac97_codec_device *codec = to_ac97_device(dev);

return sprintf(buf, "%08x", codec->vendor_id);
return sysfs_emit(buf, "%08x", codec->vendor_id);
}
DEVICE_ATTR_RO(vendor_id);

Expand Down

0 comments on commit 7450320

Please sign in to comment.