Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

bus: fsl-mc: Constify fsl_mc_device_match()

fsl_mc_device_match() does not modify caller's inputs.

To prepare for constifying API device_find_child() later.

Constify this comparison function by simply changing its
parameter types to const pointer.

Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Zijun Hu <quic_zijuhu@quicinc.com>
Link: https://lore.kernel.org/r/20241224-const_dfc_done-v5-3-6623037414d4@quicinc.com
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

authored by

Zijun Hu and committed by
Greg Kroah-Hartman
e9451ab9 064aa528

+2 -2
+2 -2
drivers/bus/fsl-mc/dprc-driver.c
··· 22 22 struct fsl_mc_obj_desc *child_array; 23 23 }; 24 24 25 - static bool fsl_mc_device_match(struct fsl_mc_device *mc_dev, 26 - struct fsl_mc_obj_desc *obj_desc) 25 + static bool fsl_mc_device_match(const struct fsl_mc_device *mc_dev, 26 + const struct fsl_mc_obj_desc *obj_desc) 27 27 { 28 28 return mc_dev->obj_desc.id == obj_desc->id && 29 29 strcmp(mc_dev->obj_desc.type, obj_desc->type) == 0;