Thread (41 messages) 41 messages, 5 authors, 2025-03-11

Re: [PATCH net-next v3 03/14] net: ethernet: qualcomm: Add PPE driver for IPQ9574 SoC

From: Jie Luo <quic_luoj@quicinc.com>
Date: 2025-02-14 06:09:58
Also in: linux-arm-msm, linux-devicetree, linux-doc, linux-hardening, lkml


On 2/12/2025 9:58 AM, Jie Gan wrote:
quoted
quoted
quoted
+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.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help