From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755895Ab1G1VF5 (ORCPT ); Thu, 28 Jul 2011 17:05:57 -0400 Received: from swampdragon.chaosbits.net ([90.184.90.115]:13887 "EHLO swampdragon.chaosbits.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754611Ab1G1VFx (ORCPT ); Thu, 28 Jul 2011 17:05:53 -0400 Date: Thu, 28 Jul 2011 23:05:51 +0200 (CEST) From: Jesper Juhl To: linux-kernel@vger.kernel.org cc: linux-mm@kvack.org, Rik van Riel , KOSAKI Motohiro , Minchan Kim , Mel Gorman , Andrew Morton , kanoj@sgi.com, sct@redhat.com Subject: [PATCH] vmscan: Remove if statement that will never trigger Message-ID: User-Agent: Alpine 2.00 (LNX 1167 2008-08-23) MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org We have this code in mm/vmscan.c:shrink_slab() : ... if (total_scan < 0) { printk(KERN_ERR "shrink_slab: %pF negative objects to " "delete nr=%ld\n", shrinker->shrink, total_scan); total_scan = max_pass; } ... but since 'total_scan' is of type 'unsigned long' it will never be less than zero, so there is no way we'll ever enter the true branch of this if statement - so let's just remove it. Signed-off-by: Jesper Juhl --- mm/vmscan.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) Compile tested only. diff --git a/mm/vmscan.c b/mm/vmscan.c index 7ef6912..c07d9b1 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -271,12 +271,6 @@ unsigned long shrink_slab(struct shrink_control *shrink, delta *= max_pass; do_div(delta, lru_pages + 1); total_scan += delta; - if (total_scan < 0) { - printk(KERN_ERR "shrink_slab: %pF negative objects to " - "delete nr=%ld\n", - shrinker->shrink, total_scan); - total_scan = max_pass; - } /* * We need to avoid excessive windup on filesystem shrinkers -- 1.7.6 -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please. From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail6.bemta12.messagelabs.com (mail6.bemta12.messagelabs.com [216.82.250.247]) by kanga.kvack.org (Postfix) with ESMTP id 1BAC16B0169 for ; Thu, 28 Jul 2011 17:05:55 -0400 (EDT) Date: Thu, 28 Jul 2011 23:05:51 +0200 (CEST) From: Jesper Juhl Subject: [PATCH] vmscan: Remove if statement that will never trigger Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: linux-kernel@vger.kernel.org Cc: linux-mm@kvack.org, Rik van Riel , KOSAKI Motohiro , Minchan Kim , Mel Gorman , Andrew Morton , kanoj@sgi.com, sct@redhat.com We have this code in mm/vmscan.c:shrink_slab() : ... if (total_scan < 0) { printk(KERN_ERR "shrink_slab: %pF negative objects to " "delete nr=%ld\n", shrinker->shrink, total_scan); total_scan = max_pass; } ... but since 'total_scan' is of type 'unsigned long' it will never be less than zero, so there is no way we'll ever enter the true branch of this if statement - so let's just remove it. Signed-off-by: Jesper Juhl --- mm/vmscan.c | 6 ------ 1 files changed, 0 insertions(+), 6 deletions(-) Compile tested only. diff --git a/mm/vmscan.c b/mm/vmscan.c index 7ef6912..c07d9b1 100644 --- a/mm/vmscan.c +++ b/mm/vmscan.c @@ -271,12 +271,6 @@ unsigned long shrink_slab(struct shrink_control *shrink, delta *= max_pass; do_div(delta, lru_pages + 1); total_scan += delta; - if (total_scan < 0) { - printk(KERN_ERR "shrink_slab: %pF negative objects to " - "delete nr=%ld\n", - shrinker->shrink, total_scan); - total_scan = max_pass; - } /* * We need to avoid excessive windup on filesystem shrinkers -- 1.7.6 -- Jesper Juhl http://www.chaosbits.net/ Don't top-post http://www.catb.org/jargon/html/T/top-post.html Plain text mails only, please. -- To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to majordomo@kvack.org. For more info on Linux MM, see: http://www.linux-mm.org/ . Fight unfair telecom internet charges in Canada: sign http://stopthemeter.ca/ Don't email: email@kvack.org