From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pd0-f179.google.com (mail-pd0-f179.google.com [209.85.192.179]) by kanga.kvack.org (Postfix) with ESMTP id 5F4806B0031 for ; Fri, 14 Feb 2014 18:18:05 -0500 (EST) Received: by mail-pd0-f179.google.com with SMTP id fp1so12172210pdb.38 for ; Fri, 14 Feb 2014 15:18:05 -0800 (PST) Received: from mail-pa0-x233.google.com (mail-pa0-x233.google.com [2607:f8b0:400e:c03::233]) by mx.google.com with ESMTPS id l8si7297522pao.297.2014.02.14.15.18.03 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 14 Feb 2014 15:18:03 -0800 (PST) Received: by mail-pa0-f51.google.com with SMTP id ld10so12970871pab.38 for ; Fri, 14 Feb 2014 15:18:03 -0800 (PST) Date: Fri, 14 Feb 2014 15:18:01 -0800 (PST) From: David Rientjes Subject: Re: [PATCH 2/9] slab: makes clear_obj_pfmemalloc() just return store masked value In-Reply-To: Message-ID: References: <1392361043-22420-1-git-send-email-iamjoonsoo.kim@lge.com> <1392361043-22420-3-git-send-email-iamjoonsoo.kim@lge.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-linux-mm@kvack.org List-ID: To: Christoph Lameter Cc: Joonsoo Kim , Pekka Enberg , Andrew Morton , Wanpeng Li , linux-mm@kvack.org, linux-kernel@vger.kernel.org, Joonsoo Kim On Fri, 14 Feb 2014, Christoph Lameter wrote: > > @@ -215,9 +215,9 @@ static inline void set_obj_pfmemalloc(void **objp) > > return; > > } > > > > -static inline void clear_obj_pfmemalloc(void **objp) > > +static inline void *clear_obj_pfmemalloc(void *objp) > > { > > - *objp = (void *)((unsigned long)*objp & ~SLAB_OBJ_PFMEMALLOC); > > + return (void *)((unsigned long)objp & ~SLAB_OBJ_PFMEMALLOC); > > } > > I dont think you need the (void *) cast here. > Yeah, you don't need it, but don't you think it makes the code more readable? Otherwise this is going to be just doing return (unsigned long)objp & ~SLAB_OBJ_PFMEMALLOC; and you gotta figure out the function type to understand it's returned as a pointer. -- 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/ . Don't email: email@kvack.org