Thread (26 messages) 26 messages, 5 authors, 2025-09-26

Re: [External] : [PATCH net-next v2 5/6] bnxt_fwctl: Add bnxt fwctl device

From: ALOK TIWARI <hidden>
Date: 2025-09-23 20:01:36


On 9/23/2025 3:28 PM, Pavan Chebbi wrote:
+static int bnxt_fw_setup_input_dma(struct bnxtctl_dev *bnxt_dev,
+				   struct device *dev,
+				   int num_dma,
+				   struct fwctl_dma_info_bnxt *msg,
+				   struct bnxt_fw_msg *fw_msg)
+{
+	u8 i, num_allocated = 0;
+	void *dma_ptr;
+	int rc = 0;
+
+	for (i = 0; i < num_dma; i++) {
The driver caps num_dma at 10 and rejects values greater than that.
It would be clearer and more consistent to use u8 num_dma here instead 
of int.
+		if (msg->len == 0 || msg->len > MAX_DMA_MEM_SIZE) {
+			rc = -EINVAL;
+			goto err;
+		}
+		bnxt_dev->dma_virt_addr[i] = dma_alloc_coherent(dev->parent,
+								msg->len,
+								&bnxt_dev->dma_addr[i],
+								GFP_KERNEL);
+		if (!bnxt_dev->dma_virt_addr[i]) {
+			rc = -ENOMEM;
+			goto err;
+		}
+		num
Thanks,
Alok
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help