Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751051AbbGBHXM (ORCPT ); Thu, 2 Jul 2015 03:23:12 -0400 Received: from cantor2.suse.de ([195.135.220.15]:60298 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752341AbbGBHXG (ORCPT ); Thu, 2 Jul 2015 03:23:06 -0400 Date: Thu, 2 Jul 2015 09:23:02 +0200 From: Michal Hocko To: Nicholas Krause Cc: akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, mgorman@suse.de, rientjes@google.com, vbabka@suse.cz, aneesh.kumar@linux.vnet.ibm.com, ebru.akagunduz@gmail.com, hannes@cmpxchg.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] mm:Make the function set_recommended_min_free_kbytes have a return type of void Message-ID: <20150702072302.GA12547@dhcp22.suse.cz> References: <1435772715-9534-1-git-send-email-xerofoify@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1435772715-9534-1-git-send-email-xerofoify@gmail.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1712 Lines: 58 On Wed 01-07-15 13:45:15, Nicholas Krause wrote: > This makes the function set_recommended_min_free_kbytes have a > return type of void now due to this particular function never > needing to signal it's call if it fails due to this function > always completing successfully without issue. The changelog is hard to read for me. " The function cannot possibly fail so it doesn't make much sense to have a return value. Make it void. " Would sound much easier to parse for me. I doubt this would help the compiler to generate a better code but in general it is better to have void return type when there is no failure possible - which is the case here. > Signed-off-by: Nicholas Krause Acked-by: Michal Hocko > --- > mm/huge_memory.c | 3 +-- > 1 file changed, 1 insertion(+), 2 deletions(-) > > diff --git a/mm/huge_memory.c b/mm/huge_memory.c > index c107094..914a72a 100644 > --- a/mm/huge_memory.c > +++ b/mm/huge_memory.c > @@ -104,7 +104,7 @@ static struct khugepaged_scan khugepaged_scan = { > }; > > > -static int set_recommended_min_free_kbytes(void) > +static void set_recommended_min_free_kbytes(void) > { > struct zone *zone; > int nr_zones = 0; > @@ -139,7 +139,6 @@ static int set_recommended_min_free_kbytes(void) > min_free_kbytes = recommended_min; > } > setup_per_zone_wmarks(); > - return 0; > } > > static int start_stop_khugepaged(void) > -- > 2.1.4 > -- Michal Hocko SUSE Labs -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/