diff mbox series

[XEN,5/6] vpic/msix: make 'get_slot' static

Message ID 6ff95436f704c852e6397a584eef65f9d1713999.1691676251.git.nicola.vetrini@bugseng.com (mailing list archive)
State New, archived
Headers show
Series xen: fix missing headers and static storage duration | expand

Commit Message

Nicola Vetrini Aug. 11, 2023, 7:19 a.m. UTC
The function can become static since it's used only within this file.
This also resolves a violation of MISRA C:2012 Rule 8.4 due to the absence
of a declaration before the function definition.

Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
Fixes: b177892d2d0e ("vpci/msix: handle accesses adjacent to the MSI-X table")
---
 xen/drivers/vpci/msix.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Stefano Stabellini Aug. 11, 2023, 11:03 p.m. UTC | #1
On Fri, 11 Aug 2023, Nicola Vetrini wrote:
> The function can become static since it's used only within this file.
> This also resolves a violation of MISRA C:2012 Rule 8.4 due to the absence
> of a declaration before the function definition.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> Fixes: b177892d2d0e ("vpci/msix: handle accesses adjacent to the MSI-X table")

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


> ---
>  xen/drivers/vpci/msix.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
> index 25bde77586a4..f9df506f29bf 100644
> --- a/xen/drivers/vpci/msix.c
> +++ b/xen/drivers/vpci/msix.c
> @@ -223,7 +223,7 @@ static void __iomem *get_table(const struct vpci *vpci, unsigned int slot)
>      return msix->table[slot];
>  }
>  
> -unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
> +static unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
>  {
>      unsigned long pfn = PFN_DOWN(addr);
>  
> -- 
> 2.34.1
>
Jan Beulich Aug. 14, 2023, 7:44 a.m. UTC | #2
On 11.08.2023 09:19, Nicola Vetrini wrote:
> The function can become static since it's used only within this file.
> This also resolves a violation of MISRA C:2012 Rule 8.4 due to the absence
> of a declaration before the function definition.
> 
> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
> Fixes: b177892d2d0e ("vpci/msix: handle accesses adjacent to the MSI-X table")

Nit (typo): In the title you mean "vpci/msix", just like this quoted
commit has it. This is important-ish because we also have "vpic"
elsewhere in the tree. (Can certainly be adjusted while committing.)

Jan
Nicola Vetrini Aug. 14, 2023, 7:54 a.m. UTC | #3
On 14/08/2023 09:44, Jan Beulich wrote:
> On 11.08.2023 09:19, Nicola Vetrini wrote:
>> The function can become static since it's used only within this file.
>> This also resolves a violation of MISRA C:2012 Rule 8.4 due to the 
>> absence
>> of a declaration before the function definition.
>> 
>> Signed-off-by: Nicola Vetrini <nicola.vetrini@bugseng.com>
>> Fixes: b177892d2d0e ("vpci/msix: handle accesses adjacent to the MSI-X 
>> table")
> 
> Nit (typo): In the title you mean "vpci/msix", just like this quoted
> commit has it. This is important-ish because we also have "vpic"
> elsewhere in the tree. (Can certainly be adjusted while committing.)
> 
> Jan

Yes, I meant to write 'vpci/msix'.
diff mbox series

Patch

diff --git a/xen/drivers/vpci/msix.c b/xen/drivers/vpci/msix.c
index 25bde77586a4..f9df506f29bf 100644
--- a/xen/drivers/vpci/msix.c
+++ b/xen/drivers/vpci/msix.c
@@ -223,7 +223,7 @@  static void __iomem *get_table(const struct vpci *vpci, unsigned int slot)
     return msix->table[slot];
 }
 
-unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
+static unsigned int get_slot(const struct vpci *vpci, unsigned long addr)
 {
     unsigned long pfn = PFN_DOWN(addr);