From: Reinhard Meyer Date: Thu, 21 Oct 2010 22:37:13 +0200 Subject: [U-Boot] [PATCH] net: Add labels to endifs and remove impossible conditional code block In-Reply-To: <20101021202257.DF79A1359B7@gemini.denx.de> References: <4CC09695.6070702@rocketmail.com> <20101021202257.DF79A1359B7@gemini.denx.de> Message-ID: <4CC0A479.4040900@emk-elektronik.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear Wolfgang Denk, > In message<4CC09695.6070702@rocketmail.com> you wrote: >> Labels added to endifs to aid readability of the net/bootp.c file. >> A block of code was marked for conditional compilation but the condition >> could never arise, the ifdef\endif code block has been deleted. > ... > >> -#if defined(CONFIG_CMD_DHCP) >> - *e++ = 53; /* DHCP Message Type */ >> - *e++ = 1; >> - *e++ = DHCP_DISCOVER; >> - >> - *e++ = 57; /* Maximum DHCP Message Size */ >> - *e++ = 2; >> - *e++ = (576 - 312 + OPT_SIZE)>> 16; >> - *e++ = (576 - 312 + OPT_SIZE)& 0xff; >> -#endif > > What makes you think CONFIG_CMD_DHCP was never used? There are 270+ > boards that use this! Its in the ELSE part like this: #if defined(CONFIG_CMD_DHCP) ... #else ... #if defined(CONFIG_CMD_DHCP) ... #endif ... #endif Perhaps it should be investigated how it happened to become such dead code? Best Regards, Reinhard