drivers/input/rmi4/rmi_bus.c:295:20-21: WARNING: Use ARRAY_SIZE

 Use ARRAY_SIZE instead of dividing sizeof array with sizeof an element

Semantic patch information:
 This makes an effort to find cases where ARRAY_SIZE can be used such as
 where there is a division of sizeof the array by the sizeof its first
 element or by any indexed element or the element type. It replaces the
 division of the two sizeofs by ARRAY_SIZE.

Generated by: scripts/coccinelle/misc/array_size.cocci

CC: Andrew Duggan <[email protected]>
Signed-off-by: Fengguang Wu <[email protected]>
---

 rmi_bus.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/input/rmi4/rmi_bus.c
+++ b/drivers/input/rmi4/rmi_bus.c
@@ -292,7 +292,7 @@ static struct rmi_function_handler *fn_h
 };
 
 #define RMI_FN_HANDLER_ARRAY_SIZE \
-       (sizeof(fn_handlers) / sizeof(struct rmi_function_handler *))
+       ARRAY_SIZE(fn_handlers)
 
 static void __rmi_unregister_function_handlers(int start_idx)
 {

Reply via email to