Got your point here. So there may have multiple definitions like ppe_icc_data here, right? But the num_icc here is hardcoded.+static int qcom_ppe_probe(struct platform_device *pdev)I think it's better with:
+{
+ struct device *dev = &pdev->dev;
+ struct ppe_device *ppe_dev;
+ void __iomem *base;
+ int ret, num_icc;
int num_icc = ARRAY_SIZE(ppe_icc_data);
This will impact the “reverse xmas tree” rule for local variable
definitions. Also, the num_icc will vary as per the different SoC,
so we will need to initialize the num_icc in a separate statement.
(Note: This driver will be extended to support different SoC in
the future.)
Maybe it would be better defined within the ppe_icc_data, if possible?
Then just directly use ppe_icc_data->num_icc?
Never mind, that's just my thought on the flexibility.
Jie