All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Dr. David Alan Gilbert" <dgilbert@redhat.com>
To: Markus Armbruster <armbru@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH 17/17] include: Move fprintf_function to disas/
Date: Fri, 12 Apr 2019 19:39:47 +0100	[thread overview]
Message-ID: <20190412183946.GS2906@work-vm> (raw)
In-Reply-To: <20190411152520.10061-18-armbru@redhat.com>

* Markus Armbruster (armbru@redhat.com) wrote:
> The previous commits have eliminated fprintf_function outside
> disassemblers, simplifying code and cleaning up the ugly type-punning
> fprintf_function seems to attract.  Move fprintf_function to
> include/disas/dis-asm.h to reduce the temptation to abuse it.
> 
> I considered renaming it to fprintf_ftype (reverting that part of
> commit 6e2d864edf5, v0.14.0) to get us closer to binutils, but I
> figure the fork is too distant to make this worthwhile.
> 
> Signed-off-by: Markus Armbruster <armbru@redhat.com>

I'm OKish with this - although it's the only place we currently
use it, it's a fairly common concept, so I'm not sure it's worth
banishing.


Reviewed-by: Dr. David Alan Gilbert <dgilbert@redhat.com>

> ---
>  include/disas/dis-asm.h   |  5 +++--
>  include/qemu/fprintf-fn.h | 14 --------------
>  2 files changed, 3 insertions(+), 16 deletions(-)
>  delete mode 100644 include/qemu/fprintf-fn.h
> 
> diff --git a/include/disas/dis-asm.h b/include/disas/dis-asm.h
> index 41b61c85f9..9240ec32c2 100644
> --- a/include/disas/dis-asm.h
> +++ b/include/disas/dis-asm.h
> @@ -9,8 +9,6 @@
>  #ifndef DISAS_BFD_H
>  #define DISAS_BFD_H
>  
> -#include "qemu/fprintf-fn.h"
> -
>  typedef void *PTR;
>  typedef uint64_t bfd_vma;
>  typedef int64_t bfd_signed_vma;
> @@ -243,6 +241,9 @@ typedef struct symbol_cache_entry
>      } udata;
>  } asymbol;
>  
> +typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
> +    GCC_FMT_ATTR(2, 3);
> +
>  enum dis_insn_type {
>    dis_noninsn,			/* Not a valid instruction */
>    dis_nonbranch,		/* Not a branch instruction */
> diff --git a/include/qemu/fprintf-fn.h b/include/qemu/fprintf-fn.h
> deleted file mode 100644
> index 9068a960b3..0000000000
> --- a/include/qemu/fprintf-fn.h
> +++ /dev/null
> @@ -1,14 +0,0 @@
> -/*
> - * Typedef for fprintf-alike function pointers.
> - *
> - * This work is licensed under the terms of the GNU GPL, version 2 or later.
> - * See the COPYING file in the top-level directory.
> - */
> -
> -#ifndef QEMU_FPRINTF_FN_H
> -#define QEMU_FPRINTF_FN_H
> -
> -typedef int (*fprintf_function)(FILE *f, const char *fmt, ...)
> -    GCC_FMT_ATTR(2, 3);
> -
> -#endif
> -- 
> 2.17.2
> 
--
Dr. David Alan Gilbert / dgilbert@redhat.com / Manchester, UK

  reply	other threads:[~2019-04-12 18:39 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-04-11 15:25 [Qemu-devel] [PATCH 00/17] Clean up and simplify around fprintf_function Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 01/17] include: Include fprintf-fn.h only where needed Markus Armbruster
2019-04-12 16:53   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 02/17] trace: Simplify how st_print_trace_file_status() prints Markus Armbruster
2019-04-12 16:55   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 03/17] tcg: Simplify how dump_opcount_info() prints Markus Armbruster
2019-04-12 16:58   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 04/17] tcg: Simplify how dump_exec_info() prints Markus Armbruster
2019-04-12 17:09   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 05/17] tcg: Simplify how dump_drift_info() prints Markus Armbruster
2019-04-12 17:18   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 06/17] qsp: Simplify how qsp_report() prints Markus Armbruster
2019-04-12 17:25   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 07/17] block/qapi: Clean up how we print to monitor or stdout Markus Armbruster
2019-04-12 17:59   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 08/17] memory: Clean up how mtree_info() prints Markus Armbruster
2019-04-12 17:44   ` Dr. David Alan Gilbert
2019-04-12 18:25     ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 09/17] target: Simplify how the TARGET_cpu_list() print Markus Armbruster
2019-04-15 15:43   ` Dr. David Alan Gilbert
2019-04-16  6:14     ` Markus Armbruster
2019-04-16  8:20       ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 10/17] target: Clean up how the dump_mmu() print Markus Armbruster
2019-04-15 15:53   ` Dr. David Alan Gilbert
2019-04-16  6:23     ` Markus Armbruster
2019-04-16  6:23       ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 11/17] target/i386: Simplify how x86_cpu_dump_local_apic_state() prints Markus Armbruster
2019-04-12 17:49   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 12/17] qom/cpu: Simplify how CPUClass::dump_statistics() prints Markus Armbruster
2019-04-12 17:50   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 13/17] qemu-print: New qemu_fprintf(), qemu_vfprintf() Markus Armbruster
2019-04-12 17:53   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 14/17] qom/cpu: Simplify how CPUClass:cpu_dump_state() prints Markus Armbruster
2019-04-15 16:47   ` Dr. David Alan Gilbert
2019-04-16  6:32     ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 15/17] monitor: Clean up how monitor_disas() funnels output to monitor Markus Armbruster
2019-04-12 18:01   ` Dr. David Alan Gilbert
2019-04-11 15:25 ` [Qemu-devel] [PATCH 16/17] disas: Rename include/disas/bfd.h back to include/disas/dis-asm.h Markus Armbruster
2019-04-11 15:25   ` Markus Armbruster
2019-04-11 15:25 ` [Qemu-devel] [PATCH 17/17] include: Move fprintf_function to disas/ Markus Armbruster
2019-04-12 18:39   ` Dr. David Alan Gilbert [this message]
2019-04-13  4:59     ` Markus Armbruster
2019-04-11 15:49 ` [Qemu-devel] [PATCH 00/17] Clean up and simplify around fprintf_function no-reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190412183946.GS2906@work-vm \
    --to=dgilbert@redhat.com \
    --cc=armbru@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.