Thread (9 messages) 9 messages, 4 authors, 2021-04-08

Re: [PATCH net-next] net: mana: Add a driver for Microsoft Azure Network Adapter (MANA)

From: Andrew Lunn <andrew@lunn.ch>
Date: 2021-04-07 01:07:59
Also in: lkml, netdev

+static int gdma_query_max_resources(struct pci_dev *pdev)
+{
+	struct gdma_context *gc = pci_get_drvdata(pdev);
+	struct gdma_general_req req = { 0 };
+	struct gdma_query_max_resources_resp resp = { 0 };
+	int err;
Network drivers need to use reverse christmas tree. I spotted a number
of functions getting this wrong. Please review the whole driver.

+
+	gdma_init_req_hdr(&req.hdr, GDMA_QUERY_MAX_RESOURCES,
+			  sizeof(req), sizeof(resp));
+
+	err = gdma_send_request(gc, sizeof(req), &req, sizeof(resp), &resp);
+	if (err || resp.hdr.status) {
+		pr_err("%s, line %d: err=%d, err=0x%x\n", __func__, __LINE__,
+		       err, resp.hdr.status);
I expect checkpatch complained about this. Don't use pr_err(), use
dev_err(pdev->dev, ...  of netdev_err(ndev, ... You should always have
access to dev or ndev, so please change all pr_ calls.
+static unsigned int num_queues = ANA_DEFAULT_NUM_QUEUE;
+module_param(num_queues, uint, 0444);
No module parameters please.

   Andrew
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help