From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1759576AbdENTiF (ORCPT ); Sun, 14 May 2017 15:38:05 -0400 Received: from mail-wm0-f66.google.com ([74.125.82.66]:35854 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754259AbdENTiD (ORCPT ); Sun, 14 May 2017 15:38:03 -0400 Date: Sun, 14 May 2017 22:37:56 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org Subject: [PATCH 1/2] kstrtox: delete end-of-string test Message-ID: <20170514193756.GA32563@avx2> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Standard "while (*s)" test is unnecessary because NUL won't pass valid-digit test anyway. Save one branch per parsed character. Signed-off-by: Alexey Dobriyan --- lib/kstrtox.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/lib/kstrtox.c +++ b/lib/kstrtox.c @@ -51,7 +51,7 @@ unsigned int _parse_integer(const char *s, unsigned int base, unsigned long long res = 0; rv = 0; - while (*s) { + while (1) { unsigned int val; if ('0' <= *s && *s <= '9')