Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbbBJQiq (ORCPT ); Tue, 10 Feb 2015 11:38:46 -0500 Received: from mail-la0-f49.google.com ([209.85.215.49]:45041 "EHLO mail-la0-f49.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751313AbbBJQip (ORCPT ); Tue, 10 Feb 2015 11:38:45 -0500 Message-ID: <54DA3411.3050309@cogentembedded.com> Date: Tue, 10 Feb 2015 19:38:41 +0300 From: Sergei Shtylyov Organization: Cogent Embedded User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.4.0 MIME-Version: 1.0 To: Nicholas Mc Guire , Tejun Heo CC: Nicholas Mc Guire , linux-ide@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] libata: fixup return type of wait_for_completion_timeout References: <1423557576-18984-1-git-send-email-hofrat@osadl.org> <20150210145341.GJ3220@htj.duckdns.org> <20150210155517.GB1883@opentech.at> In-Reply-To: <20150210155517.GB1883@opentech.at> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1201 Lines: 39 On 02/10/2015 06:55 PM, Nicholas Mc Guire wrote: >> On Tue, Feb 10, 2015 at 03:39:36AM -0500, Nicholas Mc Guire wrote: >>> - if (!rc) { >>> + if (irq_timeout == 0) { >> Why == 0 tho? This always bothers me. To match this style, we'd use >> != 0 to test the other direction. In what way is "if (ret != 0)" >> better than "if (ret)"? We're negating the two tests needlessly. > The == 0 seemed better to me than ! here because it would read > if (not irq_timeout) { No, 'irq_timeout == 0' isn't really better. > while it actually did time out - but this could be resolved by renaming > irq_timeout to time_left (as was suggested by Sergei Shtylyov > for a similar patch) and then it > would read: > if (time_left == 0) { > which would nicely describe the timeout state. '!time_left' also would. > if that addresses your concerns then I'll fix it up and repost. > thx! > hofrat MBR, Sergei -- 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/