From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758166AbcIHM1A (ORCPT ); Thu, 8 Sep 2016 08:27:00 -0400 Received: from atlantic540.startdedicated.de ([188.138.9.77]:54748 "EHLO atlantic540.startdedicated.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751260AbcIHM07 (ORCPT ); Thu, 8 Sep 2016 08:26:59 -0400 Subject: Re: [PATCH v4 2/4] firmware: encapsulate firmware loading status To: Ming Lei References: <1473237908-20989-1-git-send-email-wagi@monom.org> <1473237908-20989-3-git-send-email-wagi@monom.org> Cc: Linux Kernel Mailing List , Daniel Wagner , "Luis R . Rodriguez" , Greg Kroah-Hartman From: Daniel Wagner Message-ID: Date: Thu, 8 Sep 2016 14:26:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Ming, On 09/08/2016 01:26 PM, Ming Lei wrote: > On Wed, Sep 7, 2016 at 4:45 PM, Daniel Wagner wrote: >> From: Daniel Wagner >> +static int fw_status_wait_timeout(struct fw_status *fw_st, long timeout) >> +{ >> + int ret; >> + >> + ret = wait_for_completion_interruptible_timeout(&fw_st->completion, >> + timeout); >> + if (ret == 0 && test_bit(FW_STATUS_ABORTED, &fw_st->status)) >> + return -ENOENT; > > I guess the check should have been OR instead of AND, right? Good catch. It should be if (ret != 0 && test_bit(...)) return -ENOENT; in case where we abort the operation instead of timing out. cheers, daniel