Received: by 10.223.176.5 with SMTP id f5csp1346005wra; Wed, 31 Jan 2018 05:11:08 -0800 (PST) X-Google-Smtp-Source: AH8x2268ZeejxSg6loD/3wusLQ4uxmFpoAvYHm7MBSvMajXby1YBGA3lEIM3+/1Zga6m3BLg4W4K X-Received: by 2002:a17:902:8502:: with SMTP id bj2-v6mr5197058plb.371.1517404268464; Wed, 31 Jan 2018 05:11:08 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517404268; cv=none; d=google.com; s=arc-20160816; b=oJvzCCg7LwlQr34maRNFjAgYqSXeK1bb2BlGblxQvJZmbUohAUFAQVbHAgyWDxlDzd S0gb7gXvVJ0N6o7ys/aJdKwi7uWSH2dLGxDOwOui4366662lRiSztyPVQnHJgKU9BDWo OJPon1MWqgQD/HCOjB7m/1cG9ZxGXoeNWFKixV7APLFyqB5UxyzdPBM3iALChhugnIhF dUDVIduBwZspygDyHW0deHbHPEX3Pn0sitZoM0+/W6zrHlJ/llFO3s3ONQ9eVwMqmdIw nVyuGEtq85Fp231/zqSPYwTNVVR3dIapfPh7iGPyO7M0d3+6ZfPVdEVh+Oe7Nml291Kc ylGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:content-transfer-encoding :content-language:in-reply-to:mime-version:user-agent:date:from :references:cc:to:subject:arc-authentication-results; bh=XtnM8xYX7dE3bHntk6gcNW8yfR85jaL3GxJxfjs3ytg=; b=Kig0UsrZylhbCmc6vDqZkKGZiApbDqE3mhSLmunxjcPrGD3VTdTJbrqaOsrZUSwbU8 qJ4mYVqQeH07GlF1W43j/Fj+yKJ6XiQEn1ii06f6iYDm0aTN9ZpA/wr+0YZL0u0HI6Vf Co/7qsbhIbC1KqBvNVEnAfe8wEPK202iNRVAEOzQXeI/9yf30JKsMe8DZRt65pUHGhhJ aEbP9T/NHK5rKMTKJQOFtvx0twLfRJZ96PpYcLXafCf0OLoqLNZfkPUomgSfu4hcafpR RqjDEnNggmPLqrHTlBhLCEnp9h3gas2GOi0QvYFni8MbpKe1E/SGxAZ4ZVs3hzgaG+3U TYcg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m81si5818756pfk.168.2018.01.31.05.10.53; Wed, 31 Jan 2018 05:11:08 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753320AbeAaM5o (ORCPT + 99 others); Wed, 31 Jan 2018 07:57:44 -0500 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:40462 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752356AbeAaM5n (ORCPT ); Wed, 31 Jan 2018 07:57:43 -0500 Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w0VCsML1023816 for ; Wed, 31 Jan 2018 07:57:42 -0500 Received: from e06smtp14.uk.ibm.com (e06smtp14.uk.ibm.com [195.75.94.110]) by mx0a-001b2d01.pphosted.com with ESMTP id 2fuc0ue125-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 31 Jan 2018 07:57:42 -0500 Received: from localhost by e06smtp14.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 31 Jan 2018 12:57:39 -0000 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp14.uk.ibm.com (192.168.101.144) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 31 Jan 2018 12:57:36 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w0VCva1a40370206; Wed, 31 Jan 2018 12:57:36 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AAF535203F; Wed, 31 Jan 2018 11:49:51 +0000 (GMT) Received: from [9.164.190.251] (unknown [9.164.190.251]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C80BA52043; Wed, 31 Jan 2018 11:49:50 +0000 (GMT) Subject: Re: [PATCH] ocxl: fix signed comparison with less than zero To: Colin King , Andrew Donnellan , Arnd Bergmann , Greg Kroah-Hartman , linuxppc-dev@lists.ozlabs.org Cc: kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org References: <20180130151144.32544-1-colin.king@canonical.com> From: Frederic Barrat Date: Wed, 31 Jan 2018 13:57:34 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: <20180130151144.32544-1-colin.king@canonical.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: fr Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 18013112-0016-0000-0000-0000051DDDB0 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18013112-0017-0000-0000-0000285A7DA6 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2018-01-31_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1011 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1709140000 definitions=main-1801310170 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Le 30/01/2018 à 16:11, Colin King a écrit : > From: Colin Ian King > > Currently the comparison of used < 0 is always false because > uses is a size_t. Fix this by making used a ssize_t type. > > Detected by Coccinelle: > drivers/misc/ocxl/file.c:320:6-10: WARNING: Unsigned expression > compared with zero: used < 0 > > Fixes: 5ef3166e8a32 ("ocxl: Driver code for 'generic' opencapi devices") > Signed-off-by: Colin Ian King > --- Thanks! Acked-by: Frederic Barrat > drivers/misc/ocxl/file.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c > index c90c1a578d2f..1287e4430e6b 100644 > --- a/drivers/misc/ocxl/file.c > +++ b/drivers/misc/ocxl/file.c > @@ -277,7 +277,7 @@ static ssize_t afu_read(struct file *file, char __user *buf, size_t count, > struct ocxl_context *ctx = file->private_data; > struct ocxl_kernel_event_header header; > ssize_t rc; > - size_t used = 0; > + ssize_t used = 0; > DEFINE_WAIT(event_wait); > > memset(&header, 0, sizeof(header)); >