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

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

fs: 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 63779436
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -646,7 +646,7 @@ static int afs_proc_cell_vlservers_show(struct seq_file *m, void *v)
	}

	/* display one cell per line on subsequent lines */
	seq_printf(m, "%u.%u.%u.%u\n", NIPQUAD(addr->s_addr));
	seq_printf(m, "%pI4\n", &addr->s_addr);
	return 0;
}

@@ -737,7 +737,7 @@ static int afs_proc_cell_servers_show(struct seq_file *m, void *v)
	}

	/* display one cell per line on subsequent lines */
	sprintf(ipaddr, "%u.%u.%u.%u", NIPQUAD(server->addr));
	sprintf(ipaddr, "%pI4", &server->addr);
	seq_printf(m, "%3d %-15.15s %5d\n",
		   atomic_read(&server->usage), ipaddr, server->fs_state);

+4 −5
Original line number Diff line number Diff line
@@ -105,7 +105,7 @@ struct afs_server *afs_lookup_server(struct afs_cell *cell,
{
	struct afs_server *server, *candidate;

	_enter("%p,"NIPQUAD_FMT, cell, NIPQUAD(addr->s_addr));
	_enter("%p,%pI4", cell, &addr->s_addr);

	/* quick scan of the list to see if we already have the server */
	read_lock(&cell->servers_lock);
@@ -168,9 +168,8 @@ struct afs_server *afs_lookup_server(struct afs_cell *cell,
server_in_two_cells:
	write_unlock(&cell->servers_lock);
	kfree(candidate);
	printk(KERN_NOTICE "kAFS:"
	       " Server "NIPQUAD_FMT" appears to be in two cells\n",
	       NIPQUAD(*addr));
	printk(KERN_NOTICE "kAFS: Server %pI4 appears to be in two cells\n",
	       addr);
	_leave(" = -EEXIST");
	return ERR_PTR(-EEXIST);
}
@@ -184,7 +183,7 @@ struct afs_server *afs_find_server(const struct in_addr *_addr)
	struct rb_node *p;
	struct in_addr addr = *_addr;

	_enter(NIPQUAD_FMT, NIPQUAD(addr.s_addr));
	_enter("%pI4", &addr.s_addr);

	read_lock(&afs_servers_lock);

+1 −2
Original line number Diff line number Diff line
@@ -121,8 +121,7 @@ cifs_get_spnego_key(struct cifsSesInfo *sesInfo)

	/* add the server address */
	if (server->addr.sockAddr.sin_family == AF_INET)
		sprintf(dp, "ip4=" NIPQUAD_FMT,
			NIPQUAD(server->addr.sockAddr.sin_addr));
		sprintf(dp, "ip4=%pI4", &server->addr.sockAddr.sin_addr);
	else if (server->addr.sockAddr.sin_family == AF_INET6)
		sprintf(dp, "ip6=%pi6", &server->addr.sockAddr6.sin6_addr);
	else
+2 −2
Original line number Diff line number Diff line
@@ -2058,8 +2058,8 @@ cifs_mount(struct super_block *sb, struct cifs_sb_info *cifs_sb,
			rc = -ENOMEM;
		else {
			pSesInfo->server = srvTcp;
			sprintf(pSesInfo->serverName, "%u.%u.%u.%u",
				NIPQUAD(sin_server.sin_addr.s_addr));
			sprintf(pSesInfo->serverName, "%pI4",
				&sin_server.sin_addr.s_addr);
		}

		if (!rc) {
+3 −3
Original line number Diff line number Diff line
@@ -115,12 +115,12 @@ static void nlm_display_address(const struct sockaddr *sap,
		snprintf(buf, len, "unspecified");
		break;
	case AF_INET:
		snprintf(buf, len, NIPQUAD_FMT, NIPQUAD(sin->sin_addr.s_addr));
		snprintf(buf, len, "%pI4", &sin->sin_addr.s_addr);
		break;
	case AF_INET6:
		if (ipv6_addr_v4mapped(&sin6->sin6_addr))
			snprintf(buf, len, NIPQUAD_FMT,
				 NIPQUAD(sin6->sin6_addr.s6_addr32[3]));
			snprintf(buf, len, "%pI4",
				 &sin6->sin6_addr.s6_addr32[3]);
		else
			snprintf(buf, len, "%pI6", &sin6->sin6_addr);
		break;
Loading