On 2/12/2025 9:58 AM, Jie Gan wrote:
+static int qcom_ppe_probe(struct platform_device *pdev)
+{
+ struct device *dev = &pdev->dev;
+ struct ppe_device *ppe_dev;
+ void __iomem *base;
+ int ret, num_icc;
I think it's better with:
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.)
Got your point here. So there may have multiple definitions like
ppe_icc_data here, right? But the num_icc here is hardcoded.
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
Yes, the num_icc will be moved the SoC specific .data area of struct
of_device_id, when this driver is extended to support multiple SoCs.