diff mbox series

[PATCH-for-9.0?,v2,3/4] qtest/libqos: Reduce size_to_prdtl() declaration scope

Message ID 20240326171009.26696-4-philmd@linaro.org
State Superseded
Headers show
Series overall: Avoid using inlined functions with external linkage again | expand

Commit Message

Philippe Mathieu-Daudé March 26, 2024, 5:10 p.m. UTC
Since size_to_prdtl() is only used within ahci.c,
declare it statically. This removes the last use
of "inlined function with external linkage". See
previous commit and commit 9de9fa5cf2 for rationale.

Suggested-by: Peter Maydell <peter.maydell@linaro.org>
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 tests/qtest/libqos/ahci.h | 1 -
 tests/qtest/libqos/ahci.c | 2 +-
 2 files changed, 1 insertion(+), 2 deletions(-)

Comments

Peter Maydell March 26, 2024, 5:19 p.m. UTC | #1
On Tue, 26 Mar 2024 at 17:10, Philippe Mathieu-Daudé <philmd@linaro.org> wrote:
>
> Since size_to_prdtl() is only used within ahci.c,
> declare it statically. This removes the last use
> of "inlined function with external linkage". See
> previous commit and commit 9de9fa5cf2 for rationale.
>
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

thanks
-- PMM
Thomas Huth March 26, 2024, 5:24 p.m. UTC | #2
On 26/03/2024 18.10, Philippe Mathieu-Daudé wrote:
> Since size_to_prdtl() is only used within ahci.c,
> declare it statically. This removes the last use
> of "inlined function with external linkage". See
> previous commit and commit 9de9fa5cf2 for rationale.
> 
> Suggested-by: Peter Maydell <peter.maydell@linaro.org>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> ---


Reviewed-by: Thomas Huth <thuth@redhat.com>
diff mbox series

Patch

diff --git a/tests/qtest/libqos/ahci.h b/tests/qtest/libqos/ahci.h
index 48017864bf..a0487a1557 100644
--- a/tests/qtest/libqos/ahci.h
+++ b/tests/qtest/libqos/ahci.h
@@ -599,7 +599,6 @@  void ahci_port_check_cmd_sanity(AHCIQState *ahci, AHCICommand *cmd);
 
 /* Misc */
 bool is_atapi(AHCIQState *ahci, uint8_t port);
-unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd);
 
 /* Command: Macro level execution */
 void ahci_guest_io(AHCIQState *ahci, uint8_t port, uint8_t ide_cmd,
diff --git a/tests/qtest/libqos/ahci.c b/tests/qtest/libqos/ahci.c
index a2c94c6e06..6d59c7551a 100644
--- a/tests/qtest/libqos/ahci.c
+++ b/tests/qtest/libqos/ahci.c
@@ -662,7 +662,7 @@  unsigned ahci_pick_cmd(AHCIQState *ahci, uint8_t port)
     g_assert_not_reached();
 }
 
-inline unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd)
+static unsigned size_to_prdtl(unsigned bytes, unsigned bytes_per_prd)
 {
     /* Each PRD can describe up to 4MiB */
     g_assert_cmphex(bytes_per_prd, <=, 4096 * 1024);