Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S964782AbcJ0Nvg (ORCPT ); Thu, 27 Oct 2016 09:51:36 -0400 Received: from bombadil.infradead.org ([198.137.202.9]:52466 "EHLO bombadil.infradead.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936504AbcJ0Nvd (ORCPT ); Thu, 27 Oct 2016 09:51:33 -0400 Date: Thu, 27 Oct 2016 14:54:41 +0200 From: Peter Zijlstra To: David Herrmann Cc: linux-kernel@vger.kernel.org, Andy Lutomirski , Jiri Kosina , Greg KH , Hannes Reinecke , Steven Rostedt , Arnd Bergmann , Tom Gundersen , Josh Triplett , Linus Torvalds , Andrew Morton Subject: Re: [RFC v1 05/14] bus1: util - pool utility library Message-ID: <20161027125441.GE3175@twins.programming.kicks-ass.net> References: <20161026191810.12275-1-dh.herrmann@gmail.com> <20161026191810.12275-6-dh.herrmann@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20161026191810.12275-6-dh.herrmann@gmail.com> User-Agent: Mutt/1.5.23.1 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 466 Lines: 21 On Wed, Oct 26, 2016 at 09:18:01PM +0200, David Herrmann wrote: > +static struct bus1_pool_slice * > +bus1_pool_slice_free(struct bus1_pool_slice *slice) > +{ > + if (!slice) > + return NULL; > + > + kfree(slice); > + > + return NULL; > +} The return value is never used. Which reduces the entire thing to: kfree(slice); since kfree() already accepts a NULL. > + bus1_pool_slice_free(slice); > + bus1_pool_slice_free(slice); > + bus1_pool_slice_free(ps);