mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-30 11:41:38 -04:00
PM / OPP: Use snprintf() to avoid kasprintf() and kfree()
Use snprintf() to avoid unnecessary initializations, avoid calling kfree(). Signed-off-by: Arvind Yadav <[email protected]> Acked-by: Viresh Kumar <[email protected]> Reviewed-by: Stephen Boyd <[email protected]> Signed-off-by: Rafael J. Wysocki <[email protected]>
This commit is contained in:
parent
7813dd6fc7
commit
d741029a23
1 changed files with 3 additions and 4 deletions
|
|
@ -41,16 +41,15 @@ static bool opp_debug_create_supplies(struct dev_pm_opp *opp,
|
|||
{
|
||||
struct dentry *d;
|
||||
int i;
|
||||
char *name;
|
||||
|
||||
for (i = 0; i < opp_table->regulator_count; i++) {
|
||||
name = kasprintf(GFP_KERNEL, "supply-%d", i);
|
||||
char name[15];
|
||||
|
||||
snprintf(name, sizeof(name), "supply-%d", i);
|
||||
|
||||
/* Create per-opp directory */
|
||||
d = debugfs_create_dir(name, pdentry);
|
||||
|
||||
kfree(name);
|
||||
|
||||
if (!d)
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue