diff options
| author | Lucas De Marchi <[email protected]> | 2022-01-26 09:39:41 +0000 |
|---|---|---|
| committer | Lucas De Marchi <[email protected]> | 2022-02-07 21:03:07 +0000 |
| commit | ea4692c75e1c63926e4fb0728f5775ef0d733888 (patch) | |
| tree | 59fa8aedd9b1e70cdcf5c25a2197ace105a43ab8 /drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c | |
| parent | Merge remote-tracking branch 'drm/drm-next' into drm-misc-next (diff) | |
| download | kernel-ea4692c75e1c63926e4fb0728f5775ef0d733888.tar.gz kernel-ea4692c75e1c63926e4fb0728f5775ef0d733888.zip | |
lib/string_helpers: Consolidate string helpers implementation
There are a few implementations of string helpers in the tree like yesno()
that just returns "yes" or "no" depending on a boolean argument. Those
are helpful to output strings to the user or log.
In order to consolidate them, prefix all of them str_ prefix to make it
clear what they are about and avoid symbol clashes.
Taking the commoon `val ? "yes" : "no"` implementation, quite a few
users of open coded yesno() could later be converted to the new
function:
$ git grep '?\s*"yes"\s*' | wc -l
286
$ git grep '?\s*"no"\s*' | wc -l
20
The inlined function should keep the const strings local to each
compilation unit, the same way it's now, thus not changing the current
behavior.
Signed-off-by: Lucas De Marchi <[email protected]>
Reviewed-by: Andy Shevchenko <[email protected]>
Acked-by: Jani Nikula <[email protected]>
Acked-by: Daniel Vetter <[email protected]>
Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu_sync.c')
0 files changed, 0 insertions, 0 deletions
