From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754583AbbBPSue (ORCPT ); Mon, 16 Feb 2015 13:50:34 -0500 Received: from mail-wg0-f46.google.com ([74.125.82.46]:37516 "EHLO mail-wg0-f46.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753349AbbBPSud (ORCPT ); Mon, 16 Feb 2015 13:50:33 -0500 From: Anshul Garg X-Google-Original-From: Anshul Garg To: linux-kernel@vger.kernel.org Cc: aksgarg1989@gmail.com, anshul.g@samsung.com, torvalds@linux-foundation.org Subject: [PATCH] lib/vsprintf.c:Avoid extra operation in dentry_name Date: Mon, 16 Feb 2015 10:49:43 -0800 Message-Id: <1424112583-116849-1-git-send-email-aksgarg1989@gmail.com> X-Mailer: git-send-email 1.7.9.5 In-Reply-To: References: X-Antivirus: avast! (VPS 150216-0, 02/16/2015), Outbound message X-Antivirus-Status: Clean Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Anshul Garg Remove unnecessary increment and decrement operation in dentry_name function as after increment operation loop is breaked and then decrement operation is performed. So remove increment and decrement operation from the function. Signed-off-by: Anshul Garg --- lib/vsprintf.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/vsprintf.c b/lib/vsprintf.c index ec337f6..2a38105 100644 --- a/lib/vsprintf.c +++ b/lib/vsprintf.c @@ -576,11 +576,10 @@ char *dentry_name(char *buf, char *end, const struct dentry *d, struct printf_sp if (p == d) { if (i) array[i] = ""; - i++; break; } } - s = array[--i]; + s = array[i]; for (n = 0; n != spec.precision; n++, buf++) { char c = *s++; if (!c) { -- 1.7.9.5 --- This email has been checked for viruses by Avast antivirus software. http://www.avast.com