MIME-Version: 1.0 X-RT-Original-Encoding: utf-8 X-RT-Interface: Web Content-Disposition: inline References: <20170802031131.GA63960@isc.org> Content-Transfer-Encoding: binary X-Mailer: MIME-tools 5.508 (Entity 5.508) Message-ID: Content-Type: text/plain; charset="utf-8" In-Reply-To: RT-Send-CC: Content-Length: 2732 > - Consider this function: > > 7187 static isc_result_t > 7188 rctx_scanauth(respctx_t *rctx) { > 7189 fetchctx_t *fctx = rctx->fctx; > 7190 isc_boolean_t done = ISC_FALSE; > 7191 isc_result_t result; > 7192 > 7193 result = dns_message_firstname(fctx->rmessage, DNS_SECTION_AUTHORITY); > 7194 while (!done && result == ISC_R_SUCCESS) { > ... > 7247 result = dns_message_nextname(fctx->rmessage, > 7248 DNS_SECTION_AUTHORITY); > 7249 } > 7250 > 7251 if (result == ISC_R_NOMORE) { > 7252 result = ISC_R_SUCCESS; > 7253 } > 7254 > 7255 return (result); > 7256 } > > Given that dns_message_firstname() and dns_message_nextname() can > only return ISC_R_NOMORE or ISC_R_SUCCESS and the result variable is > not assigned to anything else than the return value of these two > functions, lines 7251-7255 can simply be replaced with: > > return (ISC_R_SUCCESS); In fact, we can go a step further: as this function always returns ISC_R_SUCCESS, there is no point in expecting any return value from it at all. How about making rctx_scanauth() return void and thus dropping the assignment to result on line 7315 and making rctx_answer() return ISC_R_SUCCESS instead of result on line 7326?