* [PATCH] system/physmem: remove redundant arg reassignment
@ 2024-02-15 9:15 Manos Pitsidianakis
2024-02-15 9:37 ` David Hildenbrand
` (2 more replies)
0 siblings, 3 replies; 5+ messages in thread
From: Manos Pitsidianakis @ 2024-02-15 9:15 UTC (permalink / raw)
To: qemu-devel
Cc: qemu-trivial, Michael Tokarev, Philippe Mathieu-Daudé,
Alex Bennée, Paolo Bonzini, Peter Xu, David Hildenbrand
Arguments `ram_block` are reassigned to local declarations `block`
without further use. Remove re-assignment to reduce noise.
Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
---
system/physmem.c | 7 ++-----
1 file changed, 2 insertions(+), 5 deletions(-)
diff --git a/system/physmem.c b/system/physmem.c
index 5e66d9ae36..d4c3bfac65 100644
--- a/system/physmem.c
+++ b/system/physmem.c
@@ -2154,10 +2154,8 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
*
* Called within RCU critical section.
*/
-void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
+void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr)
{
- RAMBlock *block = ram_block;
-
if (block == NULL) {
block = qemu_get_ram_block(addr);
addr -= block->offset;
@@ -2182,10 +2180,9 @@ void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
*
* Called within RCU critical section.
*/
-static void *qemu_ram_ptr_length(RAMBlock *ram_block, ram_addr_t addr,
+static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr,
hwaddr *size, bool lock)
{
- RAMBlock *block = ram_block;
if (*size == 0) {
return NULL;
}
base-commit: 5767815218efd3cbfd409505ed824d5f356044ae
--
γαῖα πυρί μιχθήτω
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] system/physmem: remove redundant arg reassignment
2024-02-15 9:15 [PATCH] system/physmem: remove redundant arg reassignment Manos Pitsidianakis
@ 2024-02-15 9:37 ` David Hildenbrand
2024-02-15 9:38 ` Michael Tokarev
2024-02-15 11:09 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 5+ messages in thread
From: David Hildenbrand @ 2024-02-15 9:37 UTC (permalink / raw)
To: Manos Pitsidianakis, qemu-devel
Cc: qemu-trivial, Michael Tokarev, Philippe Mathieu-Daudé,
Alex Bennée, Paolo Bonzini, Peter Xu
On 15.02.24 10:15, Manos Pitsidianakis wrote:
> Arguments `ram_block` are reassigned to local declarations `block`
> without further use. Remove re-assignment to reduce noise.
>
> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> system/physmem.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/system/physmem.c b/system/physmem.c
> index 5e66d9ae36..d4c3bfac65 100644
> --- a/system/physmem.c
> +++ b/system/physmem.c
> @@ -2154,10 +2154,8 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
> *
> * Called within RCU critical section.
> */
> -void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
> +void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr)
> {
> - RAMBlock *block = ram_block;
> -
> if (block == NULL) {
> block = qemu_get_ram_block(addr);
> addr -= block->offset;
> @@ -2182,10 +2180,9 @@ void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
> *
> * Called within RCU critical section.
> */
> -static void *qemu_ram_ptr_length(RAMBlock *ram_block, ram_addr_t addr,
> +static void *qemu_ram_ptr_length(RAMBlock *block, ram_addr_t addr,
> hwaddr *size, bool lock)
> {
> - RAMBlock *block = ram_block;
> if (*size == 0) {
> return NULL;
> }
>
> base-commit: 5767815218efd3cbfd409505ed824d5f356044ae
Reviewed-by: David Hildenbrand <david@redhat.com>
--
Cheers,
David / dhildenb
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] system/physmem: remove redundant arg reassignment
2024-02-15 9:15 [PATCH] system/physmem: remove redundant arg reassignment Manos Pitsidianakis
2024-02-15 9:37 ` David Hildenbrand
@ 2024-02-15 9:38 ` Michael Tokarev
2024-02-15 11:09 ` Philippe Mathieu-Daudé
2 siblings, 0 replies; 5+ messages in thread
From: Michael Tokarev @ 2024-02-15 9:38 UTC (permalink / raw)
To: Manos Pitsidianakis, qemu-devel
Cc: qemu-trivial, Philippe Mathieu-Daudé, Alex Bennée,
Paolo Bonzini, Peter Xu, David Hildenbrand
15.02.2024 12:15, Manos Pitsidianakis :
> Arguments `ram_block` are reassigned to local declarations `block`
> without further use. Remove re-assignment to reduce noise.
Reviewed-by: Michael Tokarev <mjt@tls.msk.ru>
And applied to trivial-patches, thanks!
/mjt
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH] system/physmem: remove redundant arg reassignment
2024-02-15 9:15 [PATCH] system/physmem: remove redundant arg reassignment Manos Pitsidianakis
2024-02-15 9:37 ` David Hildenbrand
2024-02-15 9:38 ` Michael Tokarev
@ 2024-02-15 11:09 ` Philippe Mathieu-Daudé
2024-02-26 8:54 ` Philippe Mathieu-Daudé
2 siblings, 1 reply; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-15 11:09 UTC (permalink / raw)
To: Manos Pitsidianakis, qemu-devel
Cc: qemu-trivial, Michael Tokarev, Alex Bennée, Paolo Bonzini,
Peter Xu, David Hildenbrand
On 15/2/24 10:15, Manos Pitsidianakis wrote:
> Arguments `ram_block` are reassigned to local declarations `block`
> without further use. Remove re-assignment to reduce noise.
>
> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
> ---
> system/physmem.c | 7 ++-----
> 1 file changed, 2 insertions(+), 5 deletions(-)
>
> diff --git a/system/physmem.c b/system/physmem.c
> index 5e66d9ae36..d4c3bfac65 100644
> --- a/system/physmem.c
> +++ b/system/physmem.c
> @@ -2154,10 +2154,8 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t length)
> *
> * Called within RCU critical section.
> */
> -void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
> +void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr)
Better update the declaration in the same commit:
-- >8 --
diff --git a/include/exec/memory.h b/include/exec/memory.h
index 177be23db7..bf4db3b374 100644
--- a/include/exec/memory.h
+++ b/include/exec/memory.h
@@ -2960,7 +2960,7 @@ MemTxResult flatview_read_continue(FlatView *fv,
hwaddr addr,
MemTxAttrs attrs, void *buf,
hwaddr len, hwaddr addr1, hwaddr l,
MemoryRegion *mr);
-void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr);
+void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr);
/* Internal functions, part of the implementation of
address_space_read_cached
* and address_space_write_cached. */
---
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCH] system/physmem: remove redundant arg reassignment
2024-02-15 11:09 ` Philippe Mathieu-Daudé
@ 2024-02-26 8:54 ` Philippe Mathieu-Daudé
0 siblings, 0 replies; 5+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-02-26 8:54 UTC (permalink / raw)
To: Manos Pitsidianakis, qemu-devel
Cc: qemu-trivial, Michael Tokarev, Alex Bennée, Paolo Bonzini,
Peter Xu, David Hildenbrand
On 15/2/24 12:09, Philippe Mathieu-Daudé wrote:
> On 15/2/24 10:15, Manos Pitsidianakis wrote:
>> Arguments `ram_block` are reassigned to local declarations `block`
>> without further use. Remove re-assignment to reduce noise.
>>
>> Signed-off-by: Manos Pitsidianakis <manos.pitsidianakis@linaro.org>
>> ---
>> system/physmem.c | 7 ++-----
>> 1 file changed, 2 insertions(+), 5 deletions(-)
>>
>> diff --git a/system/physmem.c b/system/physmem.c
>> index 5e66d9ae36..d4c3bfac65 100644
>> --- a/system/physmem.c
>> +++ b/system/physmem.c
>> @@ -2154,10 +2154,8 @@ void qemu_ram_remap(ram_addr_t addr, ram_addr_t
>> length)
>> *
>> * Called within RCU critical section.
>> */
>> -void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr)
>> +void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr)
>
> Better update the declaration in the same commit:
>
> -- >8 --
> diff --git a/include/exec/memory.h b/include/exec/memory.h
> index 177be23db7..bf4db3b374 100644
> --- a/include/exec/memory.h
> +++ b/include/exec/memory.h
> @@ -2960,7 +2960,7 @@ MemTxResult flatview_read_continue(FlatView *fv,
> hwaddr addr,
> MemTxAttrs attrs, void *buf,
> hwaddr len, hwaddr addr1, hwaddr l,
> MemoryRegion *mr);
> -void *qemu_map_ram_ptr(RAMBlock *ram_block, ram_addr_t addr);
> +void *qemu_map_ram_ptr(RAMBlock *block, ram_addr_t addr);
FYI this is now merged as commit aab4631a4a ("system/physmem:
remove redundant arg reassignment").
>
> /* Internal functions, part of the implementation of
> address_space_read_cached
> * and address_space_write_cached. */
> ---
>
> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
>
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2024-02-26 8:54 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-02-15 9:15 [PATCH] system/physmem: remove redundant arg reassignment Manos Pitsidianakis
2024-02-15 9:37 ` David Hildenbrand
2024-02-15 9:38 ` Michael Tokarev
2024-02-15 11:09 ` Philippe Mathieu-Daudé
2024-02-26 8:54 ` Philippe Mathieu-Daudé
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).