[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH 2/5] xen/common: vm_event: Fix MISRA C 2012 Rule 8.7 violation
- To: xenia <burzalodowa@xxxxxxxxx>
- From: Jan Beulich <jbeulich@xxxxxxxx>
- Date: Mon, 27 Jun 2022 10:43:23 +0200
- Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=suse.com; dmarc=pass action=none header.from=suse.com; dkim=pass header.d=suse.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=XfltGx2auh8LrZ8MpCLr3L09480H6JeUQ4eexV7wzwM=; b=VIv+AKenQ9gWo5mTqXJ8WAl71TKxyZ6ERrvaLualXRfDOOnaPusKZuXtIVm1l5PeJOd4EvY30Tt8cJpvukZ6qNk0XsA1br3C8085YQUXz8QLMU0xGQlGedaRNPqKNWwItwoZZ9nvHOdEisRTYx7/u23nUgUoyaOUfnuO3bso2JyRG1HgVGptvNHVsYiLN+ts3lNb27YEr52PTAap9SMLlo0fM5IdCLHW9j8UGJwcUtvLdnAgxUyjKRgW3tSLXImzKrYTemDY9u5RnddN/x7J2F6j114YjX91JL1YsmkTeOfpabJDXXzYuCYZqlozL9I3FQ7KPPSQBnR747jQKsLRJA==
- Arc-seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=SMKRNfRyzcLFeIu1Z6zKhd7ihaT/py2b/8yHi1CDwzJ9XlyhdTjxlNkJc633C/Nap9veWYr9Mab1mTNUhYUoVJnidoLnHMUDiX6sL/Bf15CC00vuuUSqu1O701GSnCmqwzTaKXW2jVMESBhdanj6IrsUnLLX2O7XPrUoLr+4WFZENYYoRt0DYQGp7gtuovDpijrhf/5jWXNTvLEBpXdbLjAdpr0YHrQXshREhSr0QhfS4FZB37u7kPCgQXGfNctUt0W1n9pALjizJjck5elTh/byQWJxnG+IK0FMJ5imwSCNdikAAkRAUgQ9EPW+ZoVG/qcadPOd+WMd8U+OF8zqrw==
- Authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=suse.com;
- Cc: Tamas K Lengyel <tamas@xxxxxxxxxxxxx>, Alexandru Isaila <aisaila@xxxxxxxxxxxxxxx>, Petre Pircalabu <ppircalabu@xxxxxxxxxxxxxxx>, xen-devel@xxxxxxxxxxxxxxxxxxxx
- Delivery-date: Mon, 27 Jun 2022 08:43:36 +0000
- List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
On 27.06.2022 09:54, xenia wrote:
> On 6/27/22 10:11, Jan Beulich wrote:
>> On 26.06.2022 23:11, Xenia Ragiadakou wrote:
>>> The function vm_event_wake() is referenced only in vm_event.c.
>>> Change the linkage of the function from external to internal by adding
>>> the storage-class specifier static to the function definition.
>>>
>>> This patch aims to resolve indirectly a MISRA C 2012 Rule 8.4 violation
>>> warning.
>> Actually also for patch 1 - this is slightly confusing, as the title
>> talks about 8.7. At first I suspected a typo. May I suggest to add
>> "also" (which I think could be easily done while committing)?
>
>
> This is actually a violation of MISRA C 2012 Rule 8.7 (Advisory), which
> states that functions referenced in only one translation unit should not
> be defined with external linkage.
> This violation triggers a MISRA C 2012 Rule 8.4 violation warning,
> because the function is defined with external linkage without a visible
> declaration at the point of definition.
> I thought that this does not make it a violation of MISRA C 2012 Rule 8.4.
I think this is a violation of both rules. It would be a violation of
only 8.7 if the function had a declaration, but still wasn't used
outside its defining CU.
Jan
|