From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753169AbdEPUmv (ORCPT ); Tue, 16 May 2017 16:42:51 -0400 Received: from mail-wm0-f67.google.com ([74.125.82.67]:36408 "EHLO mail-wm0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753087AbdEPUmu (ORCPT ); Tue, 16 May 2017 16:42:50 -0400 Date: Tue, 16 May 2017 23:42:46 +0300 From: Alexey Dobriyan To: akpm@linux-foundation.org Cc: linux-kernel@vger.kernel.org, joe@perches.com Subject: [PATCH] seq_file: delete small-value optimization Message-ID: <20170516204246.GA18123@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 num_to_str() optimizes printing small integers [0..9], so the same check higher in callchain is unnecessary. Signed-off-by: Alexey Dobriyan --- fs/seq_file.c | 10 ---------- 1 file changed, 10 deletions(-) --- a/fs/seq_file.c +++ b/fs/seq_file.c @@ -694,11 +694,6 @@ void seq_put_decimal_ull(struct seq_file *m, const char *delimiter, if (m->count + 1 >= m->size) goto overflow; - if (num < 10) { - m->buf[m->count++] = num + '0'; - return; - } - len = num_to_str(m->buf + m->count, m->size - m->count, num); if (!len) goto overflow; @@ -733,11 +728,6 @@ void seq_put_decimal_ll(struct seq_file *m, const char *delimiter, long long num num = -num; } - if (num < 10) { - m->buf[m->count++] = num + '0'; - return; - } - len = num_to_str(m->buf + m->count, m->size - m->count, num); if (!len) goto overflow;