From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932986AbbCRM32 (ORCPT ); Wed, 18 Mar 2015 08:29:28 -0400 Received: from mail-lb0-f175.google.com ([209.85.217.175]:35929 "EHLO mail-lb0-f175.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932913AbbCRM30 (ORCPT ); Wed, 18 Mar 2015 08:29:26 -0400 Message-ID: <55096FA1.9030908@cogentembedded.com> Date: Wed, 18 Mar 2015 15:29:21 +0300 From: Sergei Shtylyov User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.5.0 MIME-Version: 1.0 To: Nicholas Mc Guire , Inaky Perez-Gonzalez CC: linux-wimax@intel.com, netdev@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH RFC] wimax/i2400m: fixup completion handling for resetting a device References: <1426585774-24204-1-git-send-email-hofrat@osadl.org> In-Reply-To: <1426585774-24204-1-git-send-email-hofrat@osadl.org> 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 Hello. On 3/17/2015 12:49 PM, Nicholas Mc Guire wrote: > wait_for_completion_timeout return 0 (timeout) or >=1 (completion) so the check > for > 0 in the else branch is always true and can be dropped. The comment seems > misleading as it is always going to pass the result up. > The sync of the completion access with __i2400m_dev_reset_handle (which checks > for if (i2400m->reset_ctx) could race if i2400m_reset() returns negative so > the resetting of i2400m->reset_ctx == NULL is moved to the out: path. > As wait_for_completion_timeout returns unsigned long not int, an appropriately > named variable of type unsigned long is added and assignments fixed up. Don't try to do several things in one patch. > Signed-off-by: Nicholas Mc Guire [...] WBR, Sergei