Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 63779436 authored by Harvey Harrison's avatar Harvey Harrison Committed by David S. Miller
Browse files

drivers: replace NIPQUAD()



Using NIPQUAD() with NIPQUAD_FMT, %d.%d.%d.%d or %u.%u.%u.%u
can be replaced with %pI4

Signed-off-by: default avatarHarvey Harrison <harvey.harrison@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 21454aaa
Loading
Loading
Loading
Loading
+1 −2
Original line number Diff line number Diff line
@@ -284,8 +284,7 @@ static ssize_t sprintf_ipaddr(char *buf, u8 *ip)
		/*
		 * IPV4
		 */
		str += sprintf(buf, NIPQUAD_FMT, ip[12],
			       ip[13], ip[14], ip[15]);
		str += sprintf(buf, "%pI4", ip + 12);
	} else {
		/*
		 * IPv6
+9 −12
Original line number Diff line number Diff line
@@ -823,8 +823,8 @@ static struct nes_cm_node *find_node(struct nes_cm_core *cm_core,
	/* get a handle on the hte */
	hte = &cm_core->connected_nodes;

	nes_debug(NES_DBG_CM, "Searching for an owner node: " NIPQUAD_FMT ":%x from core %p->%p\n",
		  HIPQUAD(loc_addr), loc_port, cm_core, hte);
	nes_debug(NES_DBG_CM, "Searching for an owner node: %pI4:%x from core %p->%p\n",
		  &loc_addr, loc_port, cm_core, hte);

	/* walk list and find cm_node associated with this session ID */
	spin_lock_irqsave(&cm_core->ht_lock, flags);
@@ -873,8 +873,8 @@ static struct nes_cm_listener *find_listener(struct nes_cm_core *cm_core,
	}
	spin_unlock_irqrestore(&cm_core->listen_list_lock, flags);

	nes_debug(NES_DBG_CM, "Unable to find listener for " NIPQUAD_FMT ":%x\n",
		  HIPQUAD(dst_addr), dst_port);
	nes_debug(NES_DBG_CM, "Unable to find listener for %pI4:%x\n",
		  &dst_addr, dst_port);

	/* no listener */
	return NULL;
@@ -1082,10 +1082,9 @@ static struct nes_cm_node *make_cm_node(struct nes_cm_core *cm_core,
	cm_node->loc_port = cm_info->loc_port;
	cm_node->rem_port = cm_info->rem_port;
	cm_node->send_write0 = send_first;
	nes_debug(NES_DBG_CM, "Make node addresses : loc = " NIPQUAD_FMT
			":%x, rem = " NIPQUAD_FMT ":%x\n",
			HIPQUAD(cm_node->loc_addr), cm_node->loc_port,
			HIPQUAD(cm_node->rem_addr), cm_node->rem_port);
	nes_debug(NES_DBG_CM, "Make node addresses : loc = %pI4:%x, rem = %pI4:%x\n",
		  &cm_node->loc_addr, cm_node->loc_port,
		  &cm_node->rem_addr, cm_node->rem_port);
	cm_node->listener = listener;
	cm_node->netdev = nesvnic->netdev;
	cm_node->cm_id = cm_info->cm_id;
@@ -2066,10 +2065,8 @@ static void mini_cm_recv_pkt(struct nes_cm_core *cm_core,
	nfo.rem_addr = ntohl(iph->saddr);
	nfo.rem_port = ntohs(tcph->source);

	nes_debug(NES_DBG_CM, "Received packet: dest=" NIPQUAD_FMT
		  ":0x%04X src=" NIPQUAD_FMT ":0x%04X\n",
		  NIPQUAD(iph->daddr), tcph->dest,
		  NIPQUAD(iph->saddr), tcph->source);
	nes_debug(NES_DBG_CM, "Received packet: dest=%pI4:0x%04X src=%pI4:0x%04X\n",
		  &iph->daddr, tcph->dest, &iph->saddr, tcph->source);

	do {
		cm_node = find_node(cm_core,
+2 −3
Original line number Diff line number Diff line
@@ -679,9 +679,8 @@ int nes_arp_table(struct nes_device *nesdev, u32 ip_addr, u8 *mac_addr, u32 acti

	/* DELETE or RESOLVE */
	if (arp_index == nesadapter->arp_table_size) {
		nes_debug(NES_DBG_NETDEV, "MAC for " NIPQUAD_FMT " not in ARP table - cannot %s\n",
			  HIPQUAD(ip_addr),
			  action == NES_ARP_RESOLVE ? "resolve" : "delete");
		nes_debug(NES_DBG_NETDEV, "MAC for %pI4 not in ARP table - cannot %s\n",
			  &ip_addr, action == NES_ARP_RESOLVE ? "resolve" : "delete");
		return -1;
	}

+4 −4
Original line number Diff line number Diff line
@@ -515,14 +515,14 @@ int iser_connect(struct iser_conn *ib_conn,
	struct sockaddr *src, *dst;
	int err = 0;

	sprintf(ib_conn->name,"%d.%d.%d.%d:%d",
		NIPQUAD(dst_addr->sin_addr.s_addr), dst_addr->sin_port);
	sprintf(ib_conn->name, "%pI4:%d",
		&dst_addr->sin_addr.s_addr, dst_addr->sin_port);

	/* the device is known only --after-- address resolution */
	ib_conn->device = NULL;

	iser_err("connecting to: %d.%d.%d.%d, port 0x%x\n",
		 NIPQUAD(dst_addr->sin_addr), dst_addr->sin_port);
	iser_err("connecting to: %pI4, port 0x%x\n",
		 &dst_addr->sin_addr, dst_addr->sin_port);

	ib_conn->state = ISER_CONN_PENDING;

+10 −12
Original line number Diff line number Diff line
@@ -2585,8 +2585,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)
		if (rv) {
			if (net_ratelimit()) {
				printk(KERN_WARNING DRV_NAME
			     ": %s: no route to arp_ip_target %u.%u.%u.%u\n",
				       bond->dev->name, NIPQUAD(fl.fl4_dst));
			     ": %s: no route to arp_ip_target %pI4\n",
				       bond->dev->name, &fl.fl4_dst);
			}
			continue;
		}
@@ -2622,8 +2622,8 @@ static void bond_arp_send_all(struct bonding *bond, struct slave *slave)

		if (net_ratelimit()) {
			printk(KERN_WARNING DRV_NAME
	       ": %s: no path to arp_ip_target %u.%u.%u.%u via rt.dev %s\n",
			       bond->dev->name, NIPQUAD(fl.fl4_dst),
	       ": %s: no path to arp_ip_target %pI4 via rt.dev %s\n",
			       bond->dev->name, &fl.fl4_dst,
			       rt->u.dst.dev ? rt->u.dst.dev->name : "NULL");
		}
		ip_rt_put(rt);
@@ -2672,10 +2672,8 @@ static void bond_validate_arp(struct bonding *bond, struct slave *slave, __be32

	targets = bond->params.arp_targets;
	for (i = 0; (i < BOND_MAX_ARP_TARGETS) && targets[i]; i++) {
		dprintk("bva: sip %u.%u.%u.%u tip %u.%u.%u.%u t[%d] "
			"%u.%u.%u.%u bhti(tip) %d\n",
		       NIPQUAD(sip), NIPQUAD(tip), i, NIPQUAD(targets[i]),
		       bond_has_this_ip(bond, tip));
		dprintk("bva: sip %pI4 tip %pI4 t[%d] %pI4 bhti(tip) %d\n",
			&sip, &tip, i, &targets[i], bond_has_this_ip(bond, tip));
		if (sip == targets[i]) {
			if (bond_has_this_ip(bond, tip))
				slave->last_arp_rx = jiffies;
@@ -2727,10 +2725,10 @@ static int bond_arp_rcv(struct sk_buff *skb, struct net_device *dev, struct pack
	arp_ptr += 4 + dev->addr_len;
	memcpy(&tip, arp_ptr, 4);

	dprintk("bond_arp_rcv: %s %s/%d av %d sv %d sip %u.%u.%u.%u"
		" tip %u.%u.%u.%u\n", bond->dev->name, slave->dev->name,
		slave->state, bond->params.arp_validate,
		slave_do_arp_validate(bond, slave), NIPQUAD(sip), NIPQUAD(tip));
	dprintk("bond_arp_rcv: %s %s/%d av %d sv %d sip %pI4 tip %pI4\n",
		bond->dev->name, slave->dev->name, slave->state,
		bond->params.arp_validate, slave_do_arp_validate(bond, slave),
		&sip, &tip);

	/*
	 * Backup slaves won't see the ARP reply, but do come through
Loading