With latest glibc (Fedora Rawhide):
../drivers/net/enetfec/enet_uio.c: In function 'file_name_match_extract':
../drivers/net/enetfec/enet_uio.c:37:16: warning: assignment discards
        'const' qualifier from pointer target type [-Wdiscarded-qualifiers]
   37 |         substr = strstr(filename, match);
      |                ^

Fixes: b84fdd39638b ("net/enetfec: support UIO")
Cc: [email protected]

Signed-off-by: David Marchand <[email protected]>
---
 drivers/net/enetfec/enet_uio.c | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/drivers/net/enetfec/enet_uio.c b/drivers/net/enetfec/enet_uio.c
index f32d5e1b1e..c3917cd9df 100644
--- a/drivers/net/enetfec/enet_uio.c
+++ b/drivers/net/enetfec/enet_uio.c
@@ -32,13 +32,7 @@ static int enetfec_count;
 static bool
 file_name_match_extract(const char filename[], const char match[])
 {
-       char *substr = NULL;
-
-       substr = strstr(filename, match);
-       if (substr == NULL)
-               return false;
-
-       return true;
+       return strstr(filename, match) != NULL;
 }
 
 /*
-- 
2.51.1

Reply via email to