Re: [PATCH v3 01/11] rust: bindings: Support some inline static functions
From: Andreas Hindborg
Date: Mon Nov 11 2024 - 06:47:25 EST
"Alistair Francis" <alistair@xxxxxxxxxxxxx> writes:
> The kernel includes a large number of static inline functions that are
> defined in header files. One example is the crypto_shash_descsize()
> function which is defined in hash.h as
>
> static inline unsigned int crypto_shash_descsize(struct crypto_shash *tfm)
> {
> return tfm->descsize;
> }
>
> bindgen is currently unable to generate bindings to these functions as
> they are not publically exposed (they are static after all).
Very cool!
What does this mean for our minimum bindgen version? Is the feature safe
to use in our current required version of 0.65.1? Did the feature change
in significant ways between 0.65.1 and whatever version it will be
stable in?
> diff --git a/rust/bindgen_static_functions b/rust/bindgen_static_functions
> new file mode 100644
> index 000000000000..1f24360daeb3
> --- /dev/null
> +++ b/rust/bindgen_static_functions
> @@ -0,0 +1,6 @@
> +# SPDX-License-Identifier: GPL-2.0
> +
> +# Don't generate structs
> +--blocklist-type '.*'
> +
> +--allowlist-function blk_mq_rq_to_pdu
Should this be moved to the "Remove blk helper" patch?
Best regards,
Andreas Hindborg