From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 67417C433F5 for ; Thu, 19 May 2022 01:39:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232511AbiESBjo (ORCPT ); Wed, 18 May 2022 21:39:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229506AbiESBjm (ORCPT ); Wed, 18 May 2022 21:39:42 -0400 Received: from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7979666CB2; Wed, 18 May 2022 18:39:40 -0700 (PDT) Received: from kwepemi500014.china.huawei.com (unknown [172.30.72.57]) by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4L3XZZ2JwqzhZ6t; Thu, 19 May 2022 09:39:02 +0800 (CST) Received: from [10.67.111.227] (10.67.111.227) by kwepemi500014.china.huawei.com (7.221.188.232) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2375.24; Thu, 19 May 2022 09:39:38 +0800 Subject: Re: [PATCH -next] usb: host: ohci-tmio: Remove redundant if statement To: Dmitry Baryshkov CC: Alan Stern , Greg Kroah-Hartman , linux-usb , kernel list References: <20220518024347.213402-1-lizhengyu3@huawei.com> From: "lizhengyu (E)" Message-ID: Date: Thu, 19 May 2022 09:39:26 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.8.1 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.67.111.227] X-ClientProxiedBy: dggems704-chm.china.huawei.com (10.3.19.181) To kwepemi500014.china.huawei.com (7.221.188.232) X-CFilter-Loop: Reflected Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 18 May 2022 18:30:15 +0300, Dmitry Baryshkov wrote: > ср, 18 мая 2022 г. в 05:45, Li Zhengyu : >> (ret == 0) is true when (ret) is false, so remove it. >> Also remove unreachable code. >> >> Signed-off-by: Li Zhengyu >> --- >> drivers/usb/host/ohci-tmio.c | 6 +----- >> 1 file changed, 1 insertion(+), 5 deletions(-) >> >> diff --git a/drivers/usb/host/ohci-tmio.c b/drivers/usb/host/ohci-tmio.c >> index 49539b9f0e94..6bcb0cb53f7c 100644 >> --- a/drivers/usb/host/ohci-tmio.c >> +++ b/drivers/usb/host/ohci-tmio.c >> @@ -243,12 +243,8 @@ static int ohci_hcd_tmio_drv_probe(struct platform_device *dev) >> ret = usb_add_hcd(hcd, irq, 0); >> if (ret) >> goto err_add_hcd; >> - >> device_wakeup_enable(hcd->self.controller); > I think the proper patch would be to check the return value of > device_wakeup_enable(), so NAK. > >> - if (ret == 0) >> - return ret; >> - >> - usb_remove_hcd(hcd); >> + return ret; >> >> err_add_hcd: >> tmio_stop_hc(dev); >> -- >> 2.17.1 >> > Thanks, I will fix it soon.