Commit 3674d053 authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'hinic-cleanups'



Daode Huang says:

====================
net: hinic; make some cleanup for hinic

This set try to remove the unnecessary output message, add a blank line,
remove the dupliate word and change the deprecated strlcp functions in
hinic driver, for details, please refer to each patch.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents a9d6df64 79d65cab
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -543,8 +543,8 @@ static void hinic_get_drvinfo(struct net_device *netdev,
	struct hinic_hwif *hwif = hwdev->hwif;
	int err;

	strlcpy(info->driver, HINIC_DRV_NAME, sizeof(info->driver));
	strlcpy(info->bus_info, pci_name(hwif->pdev), sizeof(info->bus_info));
	strscpy(info->driver, HINIC_DRV_NAME, sizeof(info->driver));
	strscpy(info->bus_info, pci_name(hwif->pdev), sizeof(info->bus_info));

	err = hinic_get_mgmt_version(nic_dev, mgmt_ver);
	if (err)
+2 −6
Original line number Diff line number Diff line
@@ -629,10 +629,8 @@ static int alloc_cmd_buf(struct hinic_api_cmd_chain *chain,

	cmd_vaddr = dma_alloc_coherent(&pdev->dev, API_CMD_BUF_SIZE,
				       &cmd_paddr, GFP_KERNEL);
	if (!cmd_vaddr) {
		dev_err(&pdev->dev, "Failed to allocate API CMD DMA memory\n");
	if (!cmd_vaddr)
		return -ENOMEM;
	}

	cell_ctxt = &chain->cell_ctxt[cell_idx];

@@ -679,10 +677,8 @@ static int api_cmd_create_cell(struct hinic_api_cmd_chain *chain,

	node = dma_alloc_coherent(&pdev->dev, chain->cell_size, &node_paddr,
				  GFP_KERNEL);
	if (!node) {
		dev_err(&pdev->dev, "Failed to allocate dma API CMD cell\n");
	if (!node)
		return -ENOMEM;
	}

	node->read.hw_wb_resp_paddr = 0;

+1 −1
Original line number Diff line number Diff line
@@ -334,7 +334,7 @@ static void set_dma_attr(struct hinic_hwif *hwif, u32 entry_idx,
}

/**
 * dma_attr_table_init - initialize the the default dma attributes
 * dma_attr_table_init - initialize the default dma attributes
 * @hwif: the HW interface of a pci function device
 **/
static void dma_attr_init(struct hinic_hwif *hwif)
+1 −4
Original line number Diff line number Diff line
@@ -443,15 +443,12 @@ static void mgmt_recv_msg_handler(struct hinic_pf_to_mgmt *pf_to_mgmt,
	struct pci_dev *pdev = pf_to_mgmt->hwif->pdev;

	mgmt_work = kzalloc(sizeof(*mgmt_work), GFP_KERNEL);
	if (!mgmt_work) {
		dev_err(&pdev->dev, "Allocate mgmt work memory failed\n");
	if (!mgmt_work)
		return;
	}

	if (recv_msg->msg_len) {
		mgmt_work->msg = kzalloc(recv_msg->msg_len, GFP_KERNEL);
		if (!mgmt_work->msg) {
			dev_err(&pdev->dev, "Allocate mgmt msg memory failed\n");
			kfree(mgmt_work);
			return;
		}
+0 −1
Original line number Diff line number Diff line
@@ -414,7 +414,6 @@ int hinic_init_rq(struct hinic_rq *rq, struct hinic_hwif *hwif,
	rq->pi_virt_addr = dma_alloc_coherent(&pdev->dev, pi_size,
					      &rq->pi_dma_addr, GFP_KERNEL);
	if (!rq->pi_virt_addr) {
		dev_err(&pdev->dev, "Failed to allocate PI address\n");
		err = -ENOMEM;
		goto err_pi_virt;
	}
Loading