Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756035AbbESR6p (ORCPT ); Tue, 19 May 2015 13:58:45 -0400 Received: from mail-pd0-f173.google.com ([209.85.192.173]:34972 "EHLO mail-pd0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755942AbbESR6l (ORCPT ); Tue, 19 May 2015 13:58:41 -0400 Date: Tue, 19 May 2015 10:58:37 -0700 From: Brian Norris To: Boaz Harrosh Cc: Jens Axboe , linux-kernel@vger.kernel.org, Christoph Hellwig Subject: Re: [RFC] block: remove never-modified global variable Message-ID: <20150519175837.GX11598@ld-irv-0074> References: <1431990532-7999-1-git-send-email-computersforpeace@gmail.com> <555AE3F0.5010109@plexistor.com> <555AE7A0.9040505@plexistor.com> <20150519175532.GW11598@ld-irv-0074> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20150519175532.GW11598@ld-irv-0074> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1118 Lines: 35 On Tue, May 19, 2015 at 10:55:32AM -0700, Brian Norris wrote: > On Tue, May 19, 2015 at 10:34:56AM +0300, Boaz Harrosh wrote: > > boaz> So by this stage res can only be == 0. So we should just do: > > > > if (err) > > /* The partition is unrecognized. So report I/O errors if there were any */ > > - res = err; > > ^^ You don't want to kill this line, since we still return ERR_PRT(res). > But otherwise, I think you're right. > > > - if (res) { > > - strlcat(state->pp_buf, > > - " unable to read partition table\n", PAGE_SIZE); > > - printk(KERN_INFO "%s", state->pp_buf); > > - } > > + printk(KERN_INFO "%s unable to read partition table\n", > > + state->pp_buf); > > > > free_page((unsigned long)state->pp_buf); > > free_partitions(state); > > return ERR_PTR(res); Or rather, just make the above line: return ERR_PTR(err); > > } Brian -- 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/