[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH v2] xen: Fix implicit type conversion


  • To: Jiamei Xie <Jiamei.Xie@xxxxxxx>, Juergen Gross <jgross@xxxxxxxx>, Jiasheng Jiang <jiasheng@xxxxxxxxxxx>, "sstabellini@xxxxxxxxxx" <sstabellini@xxxxxxxxxx>
  • From: Boris Ostrovsky <boris.ostrovsky@xxxxxxxxxx>
  • Date: Wed, 27 Oct 2021 09:21:55 -0400
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=gEiO1xZ7xTyZWBanmfxng6/b7T/MSvtCaGAWP6qE6Ow=; b=Go0jVe78DZuBwguk5EZwjz281vApnxMlGvVOMqWu32Z5IrsIbXWLRSyONL6Hj0u4NGxtkyCmHuaEe+gOPjEV//u6HDJPAaYgzXsgaYxPeCor2MsuMBJuxHfVB/bdBBq2ipuKdAoBBuu+YKbfoeq15lQhgvNet4BJu+yVcOn70RaOAubZmlzCsOpG2dGmNbsGJIyEuoc/fhu5PBdkujmGON+QRzyeGs/Sojlxyv24Xl2hkT1eWNT2XRKS5pCaf8datFdS+tmCtJQ5Yq3etwpQO5cbK4l1/0ZJ8dwfqx5d0/kCvITCqRx5mnoM+CSqlC/lPfwYFlWOgogifAzCrtVIvA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TrPdJ0PEZzxInUP96LPjRuJr44d7VigoQXYMnQzAOxejVXfHFjiu3IjVCU9GWPcFrPyDLDBeKyZBENaDfUcdB/MTCm3OZ61fKPodxxGl+1MVBy2BcmvS2QhMlYAmpxPPvEpnFEt0xnTq2FuPzoFVTzfaQusd45S31Ald9EBeYoFLkx+R0yeIOvUHyctaFx9qSln9aTB1MVi4Dix6X8LRejfsPr+2eiq/rg5NTfKq6UYTOcdl/CkQKg8joizYxVkL/VhcbKxfdutQoeQmnic6BsYJIylQDKRixuH5hSMKl2ezKyT7dAm6TnL7X1zSWUVnCN6qUwI35AkpKKXcEo3MYw==
  • Authentication-results: arm.com; dkim=none (message not signed) header.d=none;arm.com; dmarc=none action=none header.from=oracle.com;
  • Cc: "xen-devel@xxxxxxxxxxxxxxxxxxxx" <xen-devel@xxxxxxxxxxxxxxxxxxxx>, "linux-kernel@xxxxxxxxxxxxxxx" <linux-kernel@xxxxxxxxxxxxxxx>
  • Delivery-date: Wed, 27 Oct 2021 13:22:47 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>


On 10/26/21 5:59 AM, Jiamei Xie wrote:

-----Original Message-----
From: Xen-devel <xen-devel-bounces@xxxxxxxxxxxxxxxxxxxx> On Behalf Of
Juergen Gross
Sent: 2021年10月26日 15:36
To: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>; boris.ostrovsky@xxxxxxxxxx;
sstabellini@xxxxxxxxxx
Cc: xen-devel@xxxxxxxxxxxxxxxxxxxx; linux-kernel@xxxxxxxxxxxxxxx
Subject: Re: [PATCH v2] xen: Fix implicit type conversion

On 26.10.21 09:32, Jiasheng Jiang wrote:
The variable 'i' is defined as UINT.
However in the for_each_possible_cpu, its value is assigned to -1.
That doesn't make sense and in the cpumask_next() it is implicitly
type conversed to INT.
It is universally accepted that the implicit type conversion is
terrible.
Also, having the good programming custom will set an example for
others.
Thus, it might be better to change the definition of 'i' from UINT
to INT.

Fixes: 3fac101 ("xen: Re-upload processor PM data to hypervisor after S3
resume (v2)")
Signed-off-by: Jiasheng Jiang <jiasheng@xxxxxxxxxxx>
Reviewed-by: Juergen Gross <jgross@xxxxxxxx>


Juergen
[Jiamei Xie]
Reviewed-by: Jiamei Xie <jiamei.xie@xxxxxxx>



Applied to for-linus-5.16


-boris




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.