[PATCH v2 01/11] static_call: Improve key type abstraction

Josh Poimboeuf jpoimboe at kernel.org
Tue Mar 21 21:53:23 PDT 2023


On Tue, Mar 21, 2023 at 09:00:07PM -0700, Josh Poimboeuf wrote:
> diff --git a/kernel/static_call_inline.c b/kernel/static_call_inline.c
> index 639397b5491c..41f6bda6773a 100644
> --- a/kernel/static_call_inline.c
> +++ b/kernel/static_call_inline.c
> @@ -112,15 +112,21 @@ static inline void static_call_sort_entries(struct static_call_site *start,
>  
>  static inline bool static_call_key_has_mods(struct static_call_key *key)
>  {
> -	return !(key->type & 1);
> +	return !!(key->type & 1);
>  }
>  
> -static inline struct static_call_mod *static_call_key_next(struct static_call_key *key)
> +static inline struct static_call_mod *static_call_key_mods(struct static_call_key *key)
>  {
>  	if (!static_call_key_has_mods(key))
>  		return NULL;
>  
> -	return key->mods;
> +	return (struct static_call_mod *)(key->type & ~1);
> +}
> +

Oops, these parts belonged in the next patch.

-- 
Josh



More information about the linux-arm-kernel mailing list