Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp875804ybk; Fri, 15 May 2020 16:24:42 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwVCeW9KTsl9B72wg8PbbipCnXlM4XQfE6H0dva5DAUwMbn3N3lF9naxQDJnjy4drmnIY7w X-Received: by 2002:a17:906:8695:: with SMTP id g21mr5342197ejx.192.1589585082159; Fri, 15 May 2020 16:24:42 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589585082; cv=none; d=google.com; s=arc-20160816; b=ry7NmkEhGcqma99RY+HfOi5Hy2PrH0MHFsYiwNm18uFWivREpiisy8SznJAJAeKSfF ORHKyuk58sRNR5sVv2reivt4xYcZvnoSJWVcPMsAEMkYEVdaUu2QXFbqHcsjVoEO4h7f o5xQQtkQKoEaIH6yuLEdMpwO+pFWovYdfA075mZTIKbYCC+Tiz5R/eNEeJ0EjQ8nvFTu jEp0+h1kNvQ2Cpw9pqapCdWpSNZh5qkkMVwJZRCbJ5wJ8jNI35Pm91D7/Mt3AXcsryfQ vZ5l/8oPcmvuxK+BusH5teo4L/klRO+krWl3uyGCFybVK4gLaA/r6Yoy/o+6BexAL2E1 YlPQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject; bh=s8VVroB3Di8DJVXpITGXhW1WQZRhiCAWGNpcQrZVFhQ=; b=OVqSpHe2NHJ+l3XJH15/VoH4gkscdoB2yZl3JJxnM3l2AJEytMlju4Kh7FMlO+jhu/ N6Bj20hsP3+AEvEEu8YPSUkVAwxAEt9IcbrazhitjoTFNQAV4fyO2nXI/ZR3yRFO3BXD aV5FJf//MoAEKhrpA1HHe3/QazFZ4k+AOEwhTSnRSXy19rI7nC4UZuJ2hqghAgKLu8ZA lVRPtsYQ6hbTxHNwzUN/GSOvwTYce6ypF/vSD90AcL86OIwf3awdeuTd7SGPx2DvKs28 EPkvEZaV/7QDALKGovoOekmvNz3akbmo8CJA550//ZfyKAAO2AmG0cTlh2C3xjvt29el EJaQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id q8si2101293ejn.176.2020.05.15.16.24.19; Fri, 15 May 2020 16:24:42 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726724AbgEOXWy (ORCPT + 99 others); Fri, 15 May 2020 19:22:54 -0400 Received: from cmccmta2.chinamobile.com ([221.176.66.80]:14157 "EHLO cmccmta2.chinamobile.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726183AbgEOXWy (ORCPT ); Fri, 15 May 2020 19:22:54 -0400 Received: from spf.mail.chinamobile.com (unknown[172.16.121.5]) by rmmx-syy-dmz-app07-12007 (RichMail) with SMTP id 2ee75ebf2446435-09b10; Sat, 16 May 2020 07:22:48 +0800 (CST) X-RM-TRANSID: 2ee75ebf2446435-09b10 X-RM-TagInfo: emlType=0 X-RM-SPAM-FLAG: 00000000 Received: from [192.168.0.101] (unknown[112.1.172.85]) by rmsmtp-syy-appsvr03-12003 (RichMail) with SMTP id 2ee35ebf244773b-96322; Sat, 16 May 2020 07:22:48 +0800 (CST) X-RM-TRANSID: 2ee35ebf244773b-96322 Subject: Re: [PATCH][next] USB: EHCI: ehci-mv: fix less than zero comparisonof an unsigned int To: Alan Stern , Colin King Cc: Greg Kroah-Hartman , Zhang Shengju , linux-usb@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20200515165453.104028-1-colin.king@canonical.com> <20200515172121.GA5498@rowland.harvard.edu> From: Tang Bin Message-ID: Date: Sat, 16 May 2020 07:23:42 +0800 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200515172121.GA5498@rowland.harvard.edu> Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 8bit Content-Language: en-US Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Alan & Colin: On 2020/5/16 1:21, Alan Stern wrote: > On Fri, May 15, 2020 at 05:54:53PM +0100, Colin King wrote: >> From: Colin Ian King >> >> The comparison of hcd->irq to less than zero for an error check will >> never be true because hcd->irq is an unsigned int. Fix this by >> assigning the int retval to the return of platform_get_irq and checking >> this for the -ve error condition and assigning hcd->irq to retval. >> >> Addresses-Coverity: ("Unsigned compared against 0") >> Fixes: c856b4b0fdb5 ("USB: EHCI: ehci-mv: fix error handling in mv_ehci_probe()") >> Signed-off-by: Colin Ian King >> --- > Thanks to Coverity for spotting this. Any reason why it didn't spot > exactly the same mistake in the ohci-da8xx.c driver? I just looked at the code and wondered whether it would be more appropriate to modify the header file "hcd.h".  Since 'irq' might be an negative, why not just modify the variables in the 'struct usb_hcd',  'unsigned int  irq'--> 'int irq'? After all, it's a public one. Thanks, Tang Bin > >