diff mbox series

[XEN,2/8] xen/memory: address MISRA C:2012 Rule 8.4

Message ID 844e7bf57c2eb7b20d8b1f81a7730a7612f1b6ac.1691575243.git.nicola.vetrini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series xen: address MISRA C:2012 Rule 8.4 | expand

Commit Message

Nicola Vetrini Aug. 9, 2023, 11:02 a.m. UTC
The function 'ioreq_server_max_frames' can be defined static,
as its only uses are within the same file. This in turn avoids
violating Rule 8.4 because no declaration is present.

No functional change.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
---
 xen/common/memory.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Luca Fancellu Aug. 9, 2023, 1:34 p.m. UTC | #1
> On 9 Aug 2023, at 12:02, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
> 
> The function 'ioreq_server_max_frames' can be defined static,
> as its only uses are within the same file. This in turn avoids
> violating Rule 8.4 because no declaration is present.
> 
> No functional change.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>

Makes sense,

Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Maybe it’s also better adding this:
Fixes: 9244528955de ("xen/memory: Fix acquire_resource size semantics”)

If the maintainers agree
Jan Beulich Aug. 9, 2023, 1:41 p.m. UTC | #2
On 09.08.2023 15:34, Luca Fancellu wrote:
>> On 9 Aug 2023, at 12:02, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
>>
>> The function 'ioreq_server_max_frames' can be defined static,
>> as its only uses are within the same file. This in turn avoids
>> violating Rule 8.4 because no declaration is present.
>>
>> No functional change.
>>
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Makes sense,
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>
> 
> Maybe it’s also better adding this:
> Fixes: 9244528955de ("xen/memory: Fix acquire_resource size semantics”)
> 
> If the maintainers agree

I for one agree; in fact I did ask for Fixes: tags throughout this series,
but in the context of another patch. As said there I also think titles and
descriptions want writing differently here.

Jan
Stefano Stabellini Aug. 9, 2023, 8:04 p.m. UTC | #3
On Wed, 9 Aug 2023, Luca Fancellu wrote:
> > On 9 Aug 2023, at 12:02, Nicola Vetrini <nicola.vetrini@bugseng.com> wrote:
> > 
> > The function 'ioreq_server_max_frames' can be defined static,
> > as its only uses are within the same file. This in turn avoids
> > violating Rule 8.4 because no declaration is present.
> > 
> > No functional change.
> > 
> > Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> 
> Makes sense,
> 
> Reviewed-by: Luca Fancellu <luca.fancellu@arm.com>

Acked-by: Stefano Stabellini <sstabellini@kernel.org>


> Maybe it’s also better adding this:
> Fixes: 9244528955de ("xen/memory: Fix acquire_resource size semantics”)
> 
> If the maintainers agree

Yes
diff mbox series

Patch

diff --git a/xen/common/memory.c b/xen/common/memory.c
index c206fa4808..b1dcbaf551 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -1120,7 +1120,7 @@  static long xatp_permission_check(struct domain *d, unsigned int space)
     return xsm_add_to_physmap(XSM_TARGET, current->domain, d);
 }
 
-unsigned int ioreq_server_max_frames(const struct domain *d)
+static unsigned int ioreq_server_max_frames(const struct domain *d)
 {
     unsigned int nr = 0;