Commit 2e030910 authored by Sergey Shtylyov's avatar Sergey Shtylyov Committed by Rob Herring (Arm)
Browse files

of: module: remove strlen() call in of_modalias()



In of_modalias(), there's no dire need to call strlen() (and then add 1
to its result to account for the 'C' char preceding the compat string).
Replace that strlen() with snprintf() (currently below it) -- this way,
we always try to print the compat string but then only advance the str
and len parameters iff the compat string fit into the remaining buffer
space...

Signed-off-by: default avatarSergey Shtylyov <s.shtylyov@omp.ru>
Link: https://lore.kernel.org/r/471418be-5d2f-4d14-bd9e-9e8f0526241f@omp.ru


Signed-off-by: default avatarRob Herring (Arm) <robh@kernel.org>
parent 00c9a452
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment