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

Re: [PATCH 3/3] common/spinlock: Drop inline from _spin_lock_cb()


  • To: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • From: Roger Pau Monné <roger.pau@xxxxxxxxxx>
  • Date: Mon, 9 May 2022 15:53:21 +0200
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=citrix.com; dmarc=pass action=none header.from=citrix.com; dkim=pass header.d=citrix.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=UeFhHXcUn8QzX8DuAxhxcA27qps7HWPARRHyB4uGeas=; b=Y7BKu3VMinX8R811I1yl8JkipX1igHEzL6A24dE2EXTmoFez2vk21RktS1dz1azlfqRHoXksgvvj6wQcfzOOzePF1ur7D47vtMN0g6sVp7uW+YfRtlpiN0U8bN7KYlwYS9cKR50kOawH/pR3chUVx8gRyve3AyIISl0wNoD5yvK3EtJmvgcSXDEDrD+MxUnICMPYElXzPXVptukyIX8PW6+Zk3eoSXDIERXLyrOKmuin1z3qV95M98ae4eoymWS2aojkWMTUBR2P/GwvG+tAmcy0Xo/9Buh+rPtHr1j7xpA/AABIhUI0nIhs5SnnU6e4hMUG0dZSlrRUYxZGs7Y4vA==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=EKWyZxMu+nsxHVnmgFL4TGVfDLmZRMBZoPN3EE4OF7sWBxIaAyy+T2vi5JdnIG+uCZAz7Q5xxDxafwPwjCYoiNy7mwTcUt1ua0i9cBNhtBv8xEhhSDuqwBgc9Yman9d+a3VnbH6sPAUlT68Nu/4St7o1tv7fcDzTMYN8AX4dWkowcYySX3ASuh6S4+ZnBwwDk2bjhsu7D5h7BS96v72XMbivY4KbSL9aDJxR4Bfyhwcka84Q3zqvA3O6vs6a/SfJpojkCXgKUHK0pU2DT4mqx5Nq9bYmqX8R7/Qax+zKUGqMH61pvIAcBbLh0R/QylADxxjF7Vk1t4u/ztEX3PVCsg==
  • Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=citrix.com;
  • Cc: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>, Jan Beulich <JBeulich@xxxxxxxx>, Wei Liu <wl@xxxxxxx>, Stefano Stabellini <sstabellini@xxxxxxxxxx>, Julien Grall <julien@xxxxxxx>, Volodymyr Babchuk <Volodymyr_Babchuk@xxxxxxxx>, Bertrand Marquis <bertrand.marquis@xxxxxxx>
  • Delivery-date: Mon, 09 May 2022 13:53:56 +0000
  • Ironport-data: A9a23:nhGFwKgg30CmLu/F+UhjgH68X161qhEKZh0ujC45NGQN5FlHY01je htvDWqOPvuON2ejLYskat62o0kAsZCBzYVhTQc9qyAyFy8b9cadCdqndUqhZCn6wu8v7a5EA 2fyTvGacajYm1eF/k/F3oDJ9CU6jefSLlbFILas1hpZHGeIcw98z0M68wIFqtQw24LhXlvc4 YqaT/D3YzdJ5RYlagr41IrbwP9flKyaVOQw5wFWiVhj5TcyplFNZH4tDfjZw0jQG+G4KtWSV efbpIxVy0uCl/sb5nFJpZ6gGqECaua60QFjERO6UYD66vRJjnRaPqrWqJPwwKqY4tmEt4kZ9 TlDiXC/YVY4IqHNubsEahZ7S3tCD61rybWfeHfq5KR/z2WeG5ft69NHKRhseKc+qqNwC2wI8 uEEIjcQaBzFn/ix3L+wVuhrgIIkMdXvO4Qc/HpnyFk1D95/GcyFH/qMuIIehWhu7ixNNa+2i 84xcz1gYQ6GexRSElwWFIg/jKGjgXyXnzhw9wvP9PZpvjS7IApZ973KLMTyRsGxSuoIx0rHt CX+4kXEO0RPXDCY4X/fmp62vcffkCW+VI8MGbmQ8v9xnEbV1mEVEAcRV1awvb++kEHWc/B1J lEQ+yEuhbMv70HtRd74NzWnpFaUsxhaXMBfe8Uh8x2EwKfQ5wefB0AHQyRHZdhgs9U5LRQoy 1uIktXBFTFp9rqPRhq1yLCQqj+jPDkPGkULbyQEUAgt7sHqpcc4iRenZtxuCrKvh9v5XzT52 SmXrTMWjq8Wy8UM0s2GEUvvhjutot3DSF4z7wCOBGa9tFomOsiiepCi7kXd4bBYNoGFQ1Kdv X8C3c+D8OQJCpLLnyuIKAkQIIyUCz++GGW0qTZS81MJrlxBJ1bLkVhs3QxD
  • Ironport-hdrordr: A9a23:lyKTR6n6U4f/n4/f39R0XblclErpDfOwimdD5ihNYBxZY6Wkfp +V8cjzhCWftN9OYhodcLC7V5Voj0mskKKdxbNhRYtKPTOWwVdASbsP0WKM+V3d8kHFh41gPO JbAtND4b7LfCRHZKTBkW6F+r8bqbHokZxAx92uqUuFJTsaFp2IhD0JbjpzfHcGJjWvUvECZe ChD4d81kydUEVSSv7+KmgOXuDFqdGOvJX6YSQeDxpizAWVlzun5JPzDhDdh34lInty6IZn1V KAvx3y562lvf3+4hjA11XL55ATvNf60NNMCOGFl8BQADTxjQSDYphnRtS5zXkIidDqzGxvvM jHoh8mMcg2w3TNflutqR+o4AXk2CZG0Q6W9XaoxV/Y5eDpTjMzDMRMwahDdAHC1kYmtNZglI pWwmOwrfNsfF/9tRW4w+KNewBhl0Kyr3Znu/UUlWZjXYwXb6IUhZAD/XlSDIwLEEvBmc0a+d FVfY/hDcttABKnhyizhBgu/DXsZAV4Iv6+eDlMhiTPuAIm30yQzCMjtb4idzk7hdAAoqJ/lp r525RT5c5zp/AtHNNA7cc6ML+K4z/2MGXx2Fz7GyWWKIg3f1TwlrXQ3JIZoMmXRb1g9upApH 2GaiISiVIP
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

On Mon, May 09, 2022 at 01:24:09PM +0100, Andrew Cooper wrote:
> This is undefined behaviour, because there is no _spin_lock_cb() in a separate
> translation unit (C11 6.7.4.11).
> 
> Moreover, MISRA prohibits this construct because, in the case where it is well
> defined, the compiler is free to use either implementation and nothing
> prevents the two from being different.

>From my reading of the spec, using inline defined function with an
extern declaration could allow the function to be (re)defined in the
scope of a different compilation unit, kind of similar to the usage of
the weak attribute?

> This function has external users, so drop the inline.
> 
> Spotted by Eclair MISRA scanner.

Like wants a:

Fixes: 462090402a ('spinlock: Introduce spin_lock_cb()')

Thanks, Roger.



 


Rackspace

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