Commit 30b8817f authored by David S. Miller's avatar David S. Miller
Browse files

Merge branch 'net-coding-style'



Weihang Li says:

====================
net: fix some coding style issues

Do some cleanups according to the coding style of kernel, including wrong
print type, redundant and missing spaces and so on.
====================

Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parents 3cbf7530 44d043b5
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -863,7 +863,7 @@ static u32 ena_com_reg_bar_read32(struct ena_com_dev *ena_dev, u16 offset)

	if (unlikely(i == timeout)) {
		netdev_err(ena_dev->net_device,
			   "Reading reg failed for timeout. expected: req id[%hu] offset[%hu] actual: req id[%hu] offset[%hu]\n",
			   "Reading reg failed for timeout. expected: req id[%u] offset[%u] actual: req id[%u] offset[%u]\n",
			   mmio_read->seq_num, offset, read_resp->req_id,
			   read_resp->reg_off);
		ret = ENA_MMIO_READ_TIMEOUT;
@@ -2396,7 +2396,7 @@ int ena_com_fill_hash_function(struct ena_com_dev *ena_dev,
		if (key) {
			if (key_len != sizeof(hash_key->key)) {
				netdev_err(ena_dev->net_device,
					   "key len (%hu) doesn't equal the supported size (%zu)\n",
					   "key len (%u) doesn't equal the supported size (%zu)\n",
					   key_len, sizeof(hash_key->key));
				return -EINVAL;
			}
+1 −1
Original line number Diff line number Diff line
@@ -3975,7 +3975,7 @@ static u32 ena_calc_max_io_queue_num(struct pci_dev *pdev,
	max_num_io_queues = min_t(u32, max_num_io_queues, io_rx_num);
	max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_sq_num);
	max_num_io_queues = min_t(u32, max_num_io_queues, io_tx_cq_num);
	/* 1 IRQ for for mgmnt and 1 IRQs for each IO direction */
	/* 1 IRQ for mgmnt and 1 IRQs for each IO direction */
	max_num_io_queues = min_t(u32, max_num_io_queues, pci_msix_vec_count(pdev) - 1);
	if (unlikely(!max_num_io_queues)) {
		dev_err(&pdev->dev, "The device doesn't have io queues\n");
+177 −185
Original line number Diff line number Diff line
@@ -381,8 +381,8 @@ static int amd8111e_set_coalesce(struct net_device *dev, enum coal_mode cmod)

			timeout = timeout * DELAY_TIMER_CONV;
			writel(VAL0|STINTEN, mmio+INTEN0);
			writel((u32)DLY_INT_A_R0|( event_count<< 16 )|timeout,
							mmio+DLY_INT_A);
			writel((u32)DLY_INT_A_R0 | (event_count << 16) |
				timeout, mmio + DLY_INT_A);
			break;

		case TX_INTR_COAL:
@@ -395,8 +395,8 @@ static int amd8111e_set_coalesce(struct net_device *dev, enum coal_mode cmod)

			timeout = timeout * DELAY_TIMER_CONV;
			writel(VAL0 | STINTEN, mmio + INTEN0);
			writel((u32)DLY_INT_B_T0|( event_count<< 16 )|timeout,
							 mmio+DLY_INT_B);
			writel((u32)DLY_INT_B_T0 | (event_count << 16) |
				timeout, mmio + DLY_INT_B);
			break;

		case DISABLE_COAL:
@@ -821,8 +821,7 @@ static int amd8111e_link_change(struct net_device *dev)
							"Full" : "Half");

		netif_carrier_on(dev);
	}
	else{
	} else {
		lp->link_config.speed = SPEED_INVALID;
		lp->link_config.duplex = DUPLEX_INVALID;
		lp->link_config.autoneg = AUTONEG_INVALID;
@@ -982,8 +981,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
			amd8111e_set_coalesce(dev, RX_INTR_COAL);
			coal_conf->rx_coal_type = NO_COALESCE;
		}
	}
	else{
	} else {

		rx_pkt_size = rx_data_rate/rx_pkt_rate;
		if (rx_pkt_size < 128) {
@@ -995,8 +993,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
				coal_conf->rx_coal_type = NO_COALESCE;
			}

		}
		else if ( (rx_pkt_size >= 128) && (rx_pkt_size < 512) ){
		} else if ((rx_pkt_size >= 128) && (rx_pkt_size < 512)) {

			if (coal_conf->rx_coal_type !=  LOW_COALESCE) {
				coal_conf->rx_timeout = 1;
@@ -1004,8 +1001,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
				amd8111e_set_coalesce(dev, RX_INTR_COAL);
				coal_conf->rx_coal_type = LOW_COALESCE;
			}
		}
		else if ((rx_pkt_size >= 512) && (rx_pkt_size < 1024)){
		} else if ((rx_pkt_size >= 512) && (rx_pkt_size < 1024)) {

			if (coal_conf->rx_coal_type != MEDIUM_COALESCE) {
				coal_conf->rx_timeout = 1;
@@ -1014,8 +1010,8 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
				coal_conf->rx_coal_type = MEDIUM_COALESCE;
			}

		}
		else if(rx_pkt_size >= 1024){
		} else if (rx_pkt_size >= 1024) {

			if (coal_conf->rx_coal_type !=  HIGH_COALESCE) {
				coal_conf->rx_timeout = 2;
				coal_conf->rx_event_count = 3;
@@ -1033,8 +1029,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
			amd8111e_set_coalesce(dev, TX_INTR_COAL);
			coal_conf->tx_coal_type = NO_COALESCE;
		}
	}
	else{
	} else {

		tx_pkt_size = tx_data_rate/tx_pkt_rate;
		if (tx_pkt_size < 128) {
@@ -1047,8 +1042,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
				coal_conf->tx_coal_type = NO_COALESCE;
			}

		}
		else if ( (tx_pkt_size >= 128) && (tx_pkt_size < 512) ){
		} else if ((tx_pkt_size >= 128) && (tx_pkt_size < 512)) {

			if (coal_conf->tx_coal_type != LOW_COALESCE) {
				coal_conf->tx_timeout = 1;
@@ -1057,8 +1051,7 @@ static int amd8111e_calc_coalesce(struct net_device *dev)
				coal_conf->tx_coal_type = LOW_COALESCE;

			}
		}
		else if ((tx_pkt_size >= 512) && (tx_pkt_size < 1024)){
		} else if ((tx_pkt_size >= 512) && (tx_pkt_size < 1024)) {

			if (coal_conf->tx_coal_type != MEDIUM_COALESCE) {
				coal_conf->tx_timeout = 2;
@@ -1200,8 +1193,8 @@ static int amd8111e_open(struct net_device *dev)
{
	struct amd8111e_priv *lp = netdev_priv(dev);

	if(dev->irq ==0 || request_irq(dev->irq, amd8111e_interrupt, IRQF_SHARED,
					 dev->name, dev))
	if (dev->irq == 0 || request_irq(dev->irq, amd8111e_interrupt,
					 IRQF_SHARED, dev->name, dev))
		return -EAGAIN;

	napi_enable(&lp->napi);
@@ -1619,8 +1612,7 @@ static int __maybe_unused amd8111e_suspend(struct device *dev_d)

		device_set_wakeup_enable(dev_d, 1);

	}
	else{
	} else {
		device_set_wakeup_enable(dev_d, 0);
	}

+3 −0
Original line number Diff line number Diff line
@@ -170,6 +170,7 @@ static void hplance_init(struct net_device *dev, struct dio_dev *d)
static void hplance_writerap(void *priv, unsigned short value)
{
	struct lance_private *lp = (struct lance_private *)priv;

	do {
		out_be16(lp->base + HPLANCE_REGOFF + LANCE_RAP, value);
	} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
@@ -178,6 +179,7 @@ static void hplance_writerap(void *priv, unsigned short value)
static void hplance_writerdp(void *priv, unsigned short value)
{
	struct lance_private *lp = (struct lance_private *)priv;

	do {
		out_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP, value);
	} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
@@ -187,6 +189,7 @@ static unsigned short hplance_readrdp(void *priv)
{
	struct lance_private *lp = (struct lance_private *)priv;
	__u16 value;

	do {
		value = in_be16(lp->base + HPLANCE_REGOFF + LANCE_RDP);
	} while ((in_8(lp->base + HPLANCE_STATUS) & LE_ACK) == 0);
+2 −1
Original line number Diff line number Diff line
@@ -484,7 +484,8 @@ void ocelot_adjust_link(struct ocelot *ocelot, int port,
			   DEV_MAC_ENA_CFG_TX_ENA, DEV_MAC_ENA_CFG);

	/* Take MAC, Port, Phy (intern) and PCS (SGMII/Serdes) clock out of
	 * reset */
	 * reset
	 */
	ocelot_port_writel(ocelot_port, DEV_CLOCK_CFG_LINK_SPEED(speed),
			   DEV_CLOCK_CFG);

Loading