[RFC PATCH v1 06/12] omap: Replace strstarts() by str_has_prefix().

From: laniel_francis
Date: Fri Dec 04 2020 - 12:05:27 EST


From: Francis Laniel <laniel_francis@xxxxxxxxxxxxxxxxxxx>

The two functions indicates if a string begins with a given prefix.
The only difference is that strstarts() returns a bool while str_has_prefix()
returns the length of the prefix if the string begins with it or 0 otherwise.

Signed-off-by: Francis Laniel <laniel_francis@xxxxxxxxxxxxxxxxxxx>
---
drivers/gpu/drm/omapdrm/dss/base.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/gpu/drm/omapdrm/dss/base.c b/drivers/gpu/drm/omapdrm/dss/base.c
index c7650a7c155d..dd3d466293d1 100644
--- a/drivers/gpu/drm/omapdrm/dss/base.c
+++ b/drivers/gpu/drm/omapdrm/dss/base.c
@@ -350,7 +350,7 @@ static bool omapdss_component_is_loaded(struct omapdss_comp_node *comp)
{
if (comp->dss_core_component)
return true;
- if (!strstarts(comp->compat, "omapdss,"))
+ if (!str_has_prefix(comp->compat, "omapdss,"))
return true;
if (omapdss_device_is_registered(comp->node))
return true;
--
2.20.1