interconnect: qcom: osm-l3: Replace custom implementation of COUNT_ARGS()
authorAndy Shevchenko <andriy.shevchenko@linux.intel.com>
Wed, 20 Sep 2023 15:49:27 +0000 (18:49 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 20 Nov 2023 10:59:27 +0000 (11:59 +0100)
[ Upstream commit 577a3c5af1fe87b65931ea94d5515266da301f56 ]

Replace custom and non-portable implementation of COUNT_ARGS().

Fixes: 5bc9900addaf ("interconnect: qcom: Add OSM L3 interconnect provider support")
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Link: https://lore.kernel.org/r/20230920154927.2090732-1-andriy.shevchenko@linux.intel.com
Signed-off-by: Georgi Djakov <djakov@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/interconnect/qcom/osm-l3.c

index dc321bb..e97478b 100644 (file)
@@ -3,6 +3,7 @@
  * Copyright (c) 2020-2021, The Linux Foundation. All rights reserved.
  */
 
+#include <linux/args.h>
 #include <linux/bitfield.h>
 #include <linux/clk.h>
 #include <linux/interconnect-provider.h>
@@ -78,7 +79,7 @@ enum {
                .name = #_name,                                         \
                .id = _id,                                              \
                .buswidth = _buswidth,                                  \
-               .num_links = ARRAY_SIZE(((int[]){ __VA_ARGS__ })),      \
+               .num_links = COUNT_ARGS(__VA_ARGS__),                   \
                .links = { __VA_ARGS__ },                               \
        }