mirror of
https://github.com/LineageOS/android_kernel_fxtec_sm6115.git
synced 2026-08-18 10:51:49 +00:00
modpost: Do not discard const qualifier in match()
match() receives 'sym' as RO string. But strstr() does not return non-const
char, which here implicitly casts away the const qualifier. Declare 'here'
as 'const char *' to fix the following warning by Clang:
../scripts/mod/modpost.c:870:10: warning: initializing 'char *' with an expression of type 'const char *' discards qualifiers [-Wincompatible-pointer-types-discards-qualifiers]
870 | char *here = strstr(sym, bare);
| ^ ~~~~~~~~~~~~~~~~~
Change-Id: I3df77d2cd975ff965517b9319ea8013cc6ce2561
Signed-off-by: Tashfin Shakeer Rhythm <tashfinshakeerrhythm@gmail.com>
This commit is contained in:
committed by
Flicker372
parent
96ff985949
commit
662289eeb3
@ -804,7 +804,7 @@ static int match(const char *sym, const char * const pat[])
|
||||
/* "*foo*" */
|
||||
if (*p == '*' && *endp == '*') {
|
||||
char *bare = NOFAIL(strndup(p + 1, strlen(p) - 2));
|
||||
char *here = strstr(sym, bare);
|
||||
const char *here = strstr(sym, bare);
|
||||
|
||||
free(bare);
|
||||
if (here != NULL)
|
||||
|
||||
Reference in New Issue
Block a user