[hail patch 3/3] Use a constant like elsewhere
Pete Zaitcev <[email protected]> Wed, 4 Aug 2010 17:13:43 -0600
| Newsgroups | org.kernel.vger.hail-devel |
|---|---|
| Message-ID | <[email protected]> |
Actually a competent compiler should replace this strlen with a constant expression, so a performance win is unlikely, but why bother if we already have this constant and use it in similar cases? Signed-off-by: Pete Zaitcev <[email protected]> --- lib/chunkdc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/chunkdc.c b/lib/chunkdc.c index 3f1994e..13f5d36 100644 --- a/lib/chunkdc.c +++ b/lib/chunkdc.c @@ -139,9 +139,9 @@ static bool net_write(struct st_client *stc, const void *data, size_t datalen) static bool resp_valid(const struct chunksrv_resp *resp) { - if (memcmp(resp->magic, CHUNKD_MAGIC, strlen(CHUNKD_MAGIC))) + if (memcmp(resp->magic, CHUNKD_MAGIC, CHD_MAGIC_SZ)) return false; - + return true; }