diff mbox

[v3,03/13] s390x: Drop useless casts

Message ID 20170405194741.18956-4-eblake@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Eric Blake April 5, 2017, 7:47 p.m. UTC
An upcoming Coccinelle cleanup script wanted to reformat the casts
present in this file - but on closer look, we don't need the casts
at all because C automatically converts void* to any other pointer.

Signed-off-by: Eric Blake <eblake@redhat.com>
---
 target/s390x/cpu_models.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Philippe Mathieu-Daudé April 5, 2017, 7:57 p.m. UTC | #1
On 04/05/2017 04:47 PM, Eric Blake wrote:
> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
>
> Signed-off-by: Eric Blake <eblake@redhat.com>

Reviewed-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

> ---
>  target/s390x/cpu_models.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
>
>  static void qdict_add_disabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> +    qdict_put(opaque, name, qbool_from_bool(false));
>  }
>
>  static void qdict_add_enabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> +    qdict_put(opaque, name, qbool_from_bool(true));
>  }
>
>  /* convert S390CPUDef into a static CpuModelInfo */
>
Cornelia Huck April 6, 2017, 7:36 a.m. UTC | #2
On Wed,  5 Apr 2017 14:47:31 -0500
Eric Blake <eblake@redhat.com> wrote:

> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  target/s390x/cpu_models.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
> 
>  static void qdict_add_disabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> +    qdict_put(opaque, name, qbool_from_bool(false));
>  }
> 
>  static void qdict_add_enabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> +    qdict_put(opaque, name, qbool_from_bool(true));
>  }
> 
>  /* convert S390CPUDef into a static CpuModelInfo */

Do you prefer to keep this in this series, or should we just go ahead
and apply this via s390x?

In any case,

Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Eric Blake April 6, 2017, 1:31 p.m. UTC | #3
On 04/06/2017 02:36 AM, Cornelia Huck wrote:
> On Wed,  5 Apr 2017 14:47:31 -0500
> Eric Blake <eblake@redhat.com> wrote:
> 
>> An upcoming Coccinelle cleanup script wanted to reformat the casts
>> present in this file - but on closer look, we don't need the casts
>> at all because C automatically converts void* to any other pointer.
>>
>> Signed-off-by: Eric Blake <eblake@redhat.com>
>> ---
>>  target/s390x/cpu_models.c | 4 ++--
>>  1 file changed, 2 insertions(+), 2 deletions(-)
>>

> 
> Do you prefer to keep this in this series, or should we just go ahead
> and apply this via s390x?

I'm okay either way. It's trivial enough, and although I found it during
qapi cleanups, it is clearly independent enough that I don't mind
rebasing if you pick it up and apply first through a non-qapi tree.

> 
> In any case,
> 
> Acked-by: Cornelia Huck <cornelia.huck@de.ibm.com>
> 
>
Cornelia Huck April 6, 2017, 1:53 p.m. UTC | #4
On Wed,  5 Apr 2017 14:47:31 -0500
Eric Blake <eblake@redhat.com> wrote:

> An upcoming Coccinelle cleanup script wanted to reformat the casts
> present in this file - but on closer look, we don't need the casts
> at all because C automatically converts void* to any other pointer.
> 
> Signed-off-by: Eric Blake <eblake@redhat.com>
> ---
>  target/s390x/cpu_models.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
> index 1434d15..ce461cc 100644
> --- a/target/s390x/cpu_models.c
> +++ b/target/s390x/cpu_models.c
> @@ -376,12 +376,12 @@ static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,
> 
>  static void qdict_add_disabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(false));
> +    qdict_put(opaque, name, qbool_from_bool(false));
>  }
> 
>  static void qdict_add_enabled_feat(const char *name, void *opaque)
>  {
> -    qdict_put((QDict *) opaque, name, qbool_from_bool(true));
> +    qdict_put(opaque, name, qbool_from_bool(true));
>  }
> 
>  /* convert S390CPUDef into a static CpuModelInfo */

Thanks, applied to s390-next.
diff mbox

Patch

diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
index 1434d15..ce461cc 100644
--- a/target/s390x/cpu_models.c
+++ b/target/s390x/cpu_models.c
@@ -376,12 +376,12 @@  static void cpu_model_from_info(S390CPUModel *model, const CpuModelInfo *info,

 static void qdict_add_disabled_feat(const char *name, void *opaque)
 {
-    qdict_put((QDict *) opaque, name, qbool_from_bool(false));
+    qdict_put(opaque, name, qbool_from_bool(false));
 }

 static void qdict_add_enabled_feat(const char *name, void *opaque)
 {
-    qdict_put((QDict *) opaque, name, qbool_from_bool(true));
+    qdict_put(opaque, name, qbool_from_bool(true));
 }

 /* convert S390CPUDef into a static CpuModelInfo */