Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756478Ab2JVWNv (ORCPT ); Mon, 22 Oct 2012 18:13:51 -0400 Received: from mail-wg0-f44.google.com ([74.125.82.44]:34081 "EHLO mail-wg0-f44.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756375Ab2JVWNu (ORCPT ); Mon, 22 Oct 2012 18:13:50 -0400 MIME-Version: 1.0 In-Reply-To: <508495B0.7010308@gmail.com> References: <508495B0.7010308@gmail.com> Date: Tue, 23 Oct 2012 00:13:49 +0200 Message-ID: Subject: Re: [PATCH v2] gpiolib: Refactor gpio_export From: Linus Walleij To: Ryan Mallon Cc: Grant Likely , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset=ISO-8859-1 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 861 Lines: 23 On Mon, Oct 22, 2012 at 2:39 AM, Ryan Mallon wrote: > The gpio_export function uses nested if statements and the status > variable to handle the failure cases. This makes the function logic > difficult to follow. Refactor the code to abort immediately on failure > using goto. This makes the code slightly longer, but significantly > reduces the nesting and number of split lines and makes the code easier > to read. Splendid, patch applied! > Signed-off-by: Ryan Mallon Interesting that you sign off without an email address, I just added it thinking it was a mistake. Yours, Linus Walleij -- 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/