diff options
author | Sascha Hauer <s.hauer@pengutronix.de> | 2017-11-20 23:05:06 +0100 |
---|---|---|
committer | Sascha Hauer <s.hauer@pengutronix.de> | 2017-12-14 14:29:48 +0100 |
commit | 6b4a38d00255149c63277100ed1a3f5f95ab2e75 (patch) | |
tree | 0d224cb6b9972a7767ea5071ebf4cbe6d110ac55 | |
parent | 170060110e58238d49f5e59da7b23a77ac2e48e1 (diff) | |
download | barebox-6b4a38d00255149c63277100ed1a3f5f95ab2e75.tar.gz barebox-6b4a38d00255149c63277100ed1a3f5f95ab2e75.tar.xz |
net: dhcp: Coding style fixes
Fix some spaces-before-function-opening-brackets and duplicate empty
lines.
Signed-off-by: Sascha Hauer <s.hauer@pengutronix.de>
-rw-r--r-- | net/dhcp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/dhcp.c b/net/dhcp.c index ffb3842882..08eb407d22 100644 --- a/net/dhcp.c +++ b/net/dhcp.c @@ -389,7 +389,7 @@ static void bootp_copy_net_params(struct bootp *bp) /* * Initialize BOOTP extension fields in the request. */ -static int dhcp_extended (u8 *e, int message_type, IPaddr_t ServerID, +static int dhcp_extended(u8 *e, int message_type, IPaddr_t ServerID, IPaddr_t RequestedIP) { struct dhcp_opt *opt; @@ -411,7 +411,6 @@ static int dhcp_extended (u8 *e, int message_type, IPaddr_t ServerID, *e++ = (576 - 312 + OPT_SIZE) >> 8; *e++ = (576 - 312 + OPT_SIZE) & 0xff; - e += dhcp_set_ip_options(50, e, RequestedIP); e += dhcp_set_ip_options(54, e, ServerID); @@ -467,7 +466,7 @@ static int bootp_request(void) bfile = getenv("bootfile"); if (bfile) - safe_strncpy (bp->bp_file, bfile, sizeof(bp->bp_file)); + safe_strncpy(bp->bp_file, bfile, sizeof(bp->bp_file)); /* Request additional information from the BOOTP/DHCP server */ ext_len = dhcp_extended(bp->bp_vend, DHCP_DISCOVER, 0, 0); @@ -523,8 +522,8 @@ static int dhcp_message_type(unsigned char *popt) return -1; popt += 4; - while ( *popt != 0xff ) { - if ( *popt == 53 ) /* DHCP Message Type */ + while (*popt != 0xff) { + if (*popt == 53) /* DHCP Message Type */ return *(popt + 2); popt += *(popt + 1) + 2; /* Scan through all options */ } @@ -596,7 +595,7 @@ static void dhcp_handler(void *ctx, char *packet, unsigned int len) * If filename is in format we recognize, assume it is a valid * OFFER from a server we want. */ - debug ("%s: state SELECTING, bp_file: \"%s\"\n", __func__, bp->bp_file); + debug("%s: state SELECTING, bp_file: \"%s\"\n", __func__, bp->bp_file); dhcp_state = REQUESTING; if (net_read_uint32(&bp->bp_vend[0]) == htonl(BOOTP_VENDOR_MAGIC)) @@ -609,7 +608,7 @@ static void dhcp_handler(void *ctx, char *packet, unsigned int len) break; case REQUESTING: - debug ("%s: State REQUESTING\n", __func__); + debug("%s: State REQUESTING\n", __func__); if (dhcp_message_type((u8 *)bp->bp_vend) == DHCP_ACK ) { IPaddr_t ip; |