Re: [PATCH v5 2/4] misc: fastrpc: Replace hardcoded ctxid mask with GENMASK

From: Konrad Dybcio

Date: Tue Dec 30 2025 - 08:28:51 EST


On 12/30/25 7:28 AM, Ekansh Gupta wrote:
> Replace the hardcoded context ID mask (0xFF0) with GENMASK(11, 4) to
> improve readability and follow kernel bitfield conventions. Use
> FIELD_PREP and FIELD_GET instead of manual shifts for setting and
> extracting ctxid values.
>
> Signed-off-by: Ekansh Gupta <ekansh.gupta@xxxxxxxxxxxxxxxx>
> ---
> drivers/misc/fastrpc.c | 9 +++++----
> 1 file changed, 5 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/misc/fastrpc.c b/drivers/misc/fastrpc.c
> index 679cd8997a00..f7fb44a8e9c0 100644
> --- a/drivers/misc/fastrpc.c
> +++ b/drivers/misc/fastrpc.c
> @@ -22,6 +22,7 @@
> #include <linux/firmware/qcom/qcom_scm.h>
> #include <uapi/misc/fastrpc.h>
> #include <linux/of_reserved_mem.h>
> +#include <linux/bitfield.h>

nit: these are best when sorted

Reviewed-by: Konrad Dybcio <konrad.dybcio@xxxxxxxxxxxxxxxx>

Konrad