From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Google-Smtp-Source: AH8x2243FT4KZ2eXBJ0wwP+LBUaybiIK3l3sRyEseZXiRP8t/8fbYVwhHCh393d/PxkZTcHQsNtV ARC-Seal: i=1; a=rsa-sha256; t=1517403464; cv=none; d=google.com; s=arc-20160816; b=ju5xbQRtBwDEzAoRRxR+TRprqpimoBidxhYRTJlEyclsmU7DEQjS/x+6tWCUYIruks cDApSRujzSaAt33+pO1dAgX021a0yDQDMSuaJjH76TgsKCIl+hpb50n0hVHf0C9xJDii gut1DDkx+MsFdembkBmbFpVl4LUHtaOHmMJLyaZ5bxzE3P5fN1JL1NGynzb1bswFeeWc HityssA8tVWydfVHUg4PyLSPhq/4+IaByGdhwgW8aLmd3NCTFYlaxogt+AARlrbAF3D1 MU54SOcsOTsKjAdRNXAdTnPNuJU7RTMeZz+4enbFLLM5ZjWED7aZV8Nwt4uXnA/dUR+w WPSA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=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=TusS35Eo+DrQaLxbIt+c+QLGtUJ2tboXefKu5WYsZZa4YvAHGQnkYATjY0iFi55sf1 ak3cMVsYG3He+fp0I7xkzD+q2akCUXonFBJUZMzBuZt/7hQ5tJ/fG5SwllxbFltkq/G6 ggCAWcgsLZJhW9yVQtIBiWI/K3BhKc0xCA6NfHD4jKb1zSjSsinQTOereGsfzRuX6FYn 8L6hCezKGGijHR1DsyhobZw+DnMoyNl3xD6Qsvwn5uMWNapZCt0Pc1c7p+8mUSP69PH9 nGzOoUx6inSabYxbde9f3ogeMbQmG+AMBpI3bxCOIVS14OItg7a0G2g2RO+njMdCs5dD Th6A== ARC-Authentication-Results: i=1; mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of fbarrat@linux.vnet.ibm.com) smtp.mailfrom=fbarrat@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com Authentication-Results: mx.google.com; spf=neutral (google.com: 148.163.158.5 is neither permitted nor denied by best guess record for domain of fbarrat@linux.vnet.ibm.com) smtp.mailfrom=fbarrat@linux.vnet.ibm.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=ibm.com 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 X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: =?utf-8?q?1591030691319252976?= X-GMAIL-MSGID: =?utf-8?q?1591112855333036253?= X-Mailing-List: linux-kernel@vger.kernel.org List-ID: 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)); >