Re: [PATCH] Fix implicit cast warning in test_klp_state.c

From: Nicolai Stange
Date: Wed Feb 21 2024 - 07:44:15 EST


Shresth Prasad <shresthprasad7@xxxxxxxxx> writes:

> I checked the source code and yes I am on the latest Linux next repo.
>
> Here's the warning:
> /home/shresthp/dev/linux_work/linux_next/tools/testing/selftests/livepatch/test_modules/test_klp_state.c:38:24: warning: assignment to ‘struct klp_state *’ from ‘int’ makes pointer from integer without a cast [-Wint-conversion]
>    38 |         loglevel_state = klp_get_state(&patch, CONSOLE_LOGLEVEL_STATE);
>       |                        ^


Is the declaration of klp_get_state() visible at that point, i.e. is
there perhaps any warning about missing declarations above that?

Otherwise C rules would default to assume an 'int' return type.

Thanks,

Nicolai

--
SUSE Software Solutions Germany GmbH, Frankenstraße 146, 90461 Nürnberg, Germany
GF: Ivo Totev, Andrew McDonald, Werner Knoblich
(HRB 36809, AG Nürnberg)