qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@linaro.org>
To: qemu-devel@nongnu.org, "Daniel P. Berrangé" <berrange@redhat.com>,
	"Peter Maydell" <peter.maydell@linaro.org>,
	"Alex Bennée" <alex.bennee@linaro.org>,
	"Paolo Bonzini" <pbonzini@redhat.com>,
	"Stefan Hajnoczi" <stefanha@redhat.com>,
	"Richard Henderson" <richard.henderson@linaro.org>
Cc: "Jamin Lin" <jamin_lin@aspeedtech.com>,
	"Helge Deller" <deller@gmx.de>, "Song Gao" <gaosong@loongson.cn>,
	"Stafford Horne" <shorne@gmail.com>,
	"Daniel Henrique Barboza" <dbarboza@ventanamicro.com>,
	"Joel Stanley" <joel@jms.id.au>, "Troy Lee" <leetroy@gmail.com>,
	"Nicholas Piggin" <npiggin@gmail.com>,
	"Bin Meng" <bmeng.cn@gmail.com>,
	"Jiaxun Yang" <jiaxun.yang@flygoat.com>,
	"Max Filippov" <jcmvbkbc@gmail.com>,
	"Artyom Tarasenko" <atar4qemu@gmail.com>,
	"Aurelien Jarno" <aurelien@aurel32.net>,
	qemu-riscv@nongnu.org,
	"Edgar E. Iglesias" <edgar.iglesias@gmail.com>,
	"Weiwei Li" <liwei1518@gmail.com>,
	"Cédric Le Goater" <clg@kaod.org>,
	"Michael S. Tsirkin" <mst@redhat.com>,
	"Hao Wu" <wuhaotsh@google.com>,
	"Mark Cave-Ayland" <mark.cave-ayland@ilande.co.uk>,
	"Steven Lee" <steven_lee@aspeedtech.com>,
	"Marcel Apfelbaum" <marcel.apfelbaum@gmail.com>,
	"Andrew Jeffery" <andrew@codeconstruct.com.au>,
	"Alistair Francis" <Alistair.Francis@wdc.com>,
	"Beniamino Galvani" <b.galvani@gmail.com>,
	"Subbaraya Sundeep" <sundeep.lkml@gmail.com>,
	"Frédéric Barrat" <fbarrat@linux.ibm.com>,
	"Marc-André Lureau" <marcandre.lureau@redhat.com>,
	"Tyrone Ting" <kfting@nuvoton.com>,
	"Strahinja Jankovic" <strahinja.p.jankovic@gmail.com>,
	qemu-arm@nongnu.org, "Sergio Lopez" <slp@redhat.com>,
	"Jan Kiszka" <jan.kiszka@web.de>,
	qemu-ppc@nongnu.org, "Eduardo Habkost" <eduardo@habkost.net>,
	"Hervé Poussineau" <hpoussin@reactos.org>,
	"Aleksandar Rikalo" <arikalo@gmail.com>,
	"Jia Liu" <proljc@gmail.com>,
	"Huacai Chen" <chenhuacai@kernel.org>,
	"BALATON Zoltan" <balaton@eik.bme.hu>,
	"Niek Linnenbank" <nieklinnenbank@gmail.com>,
	"Paul Burton" <paulburton@kernel.org>,
	"Liu Zhiwei" <zhiwei_liu@linux.alibaba.com>,
	"Palmer Dabbelt" <palmer@dabbelt.com>,
	"Bernhard Beschow" <shentey@gmail.com>
Subject: Re: [PATCH v2 3/3] hw/char: Extract serial-mm
Date: Thu, 5 Sep 2024 13:13:49 +0200	[thread overview]
Message-ID: <08360075-385e-4083-8dea-5e2275d02834@linaro.org> (raw)
In-Reply-To: <20240905073832.16222-4-shentey@gmail.com>

Hi,

On 5/9/24 09:38, Bernhard Beschow wrote:
> hw/char/serial currently contains the implementation of both TYPE_SERIAL and
> TYPE_SERIAL_MM. According to serial_class_init(), TYPE_SERIAL is an internal
> class while TYPE_SERIAL_MM is used by numerous machine types directly. Let's
> move the latter into its own module which makes the dependencies more obvious
> and the code more tidy.
> 
> The includes and the dependencies have been converted mechanically except in the
> hw/char directories which were updated manually. The result was compile-tested.
> Now, only hw/char makes direct use of TYPE_SERIAL:
> 
>    # grep -r -e "select SERIAL" | grep -v SERIAL_
>    hw/char/Kconfig:    select SERIAL
>    hw/char/Kconfig:    select SERIAL
>    hw/char/Kconfig:    select SERIAL
>    hw/char/Kconfig:    select SERIAL
>    hw/char/Kconfig:    select SERIAL
> 
>    # grep -r -e "/serial\\.h"
>    include/hw/char/serial-mm.h:#include "hw/char/serial.h"
>    hw/char/serial-pci-multi.c:#include "hw/char/serial.h"
>    hw/char/serial.c:#include "hw/char/serial.h"
>    hw/char/serial-isa.c:#include "hw/char/serial.h"
>    hw/char/serial-pci.c:#include "hw/char/serial.h"
> 
> Tested-by: Andrew Jeffery <andrew@codeconstruct.com.au>
> Reviewed-by: Mark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
> Signed-off-by: Bernhard Beschow <shentey@gmail.com>
> ---
>   include/hw/arm/aspeed_soc.h         |   2 +-
>   include/hw/char/mchp_pfsoc_mmuart.h |   2 +-
>   include/hw/char/serial-mm.h         |  52 +++++++++
>   include/hw/char/serial.h            |  19 ----
>   hw/arm/allwinner-a10.c              |   2 +-
>   hw/arm/allwinner-h3.c               |   2 +-
>   hw/arm/allwinner-r40.c              |   2 +-
>   hw/arm/aspeed_ast2400.c             |   2 +-
>   hw/arm/aspeed_soc_common.c          |   2 +-
>   hw/arm/kzm.c                        |   2 +-
>   hw/arm/msf2-soc.c                   |   2 +-
>   hw/arm/musicpal.c                   |   2 +-
>   hw/arm/npcm7xx.c                    |   2 +-
>   hw/arm/pxa2xx.c                     |   2 +-
>   hw/char/omap_uart.c                 |   2 +-
>   hw/char/serial-mm.c                 | 157 ++++++++++++++++++++++++++++
>   hw/char/serial.c                    | 126 ----------------------
>   hw/display/sm501.c                  |   2 +-
>   hw/hppa/machine.c                   |   2 +-
>   hw/loongarch/virt.c                 |   2 +-
>   hw/microblaze/petalogix_ml605_mmu.c |   2 +-
>   hw/mips/boston.c                    |   2 +-
>   hw/mips/jazz.c                      |   2 +-
>   hw/mips/loongson3_virt.c            |   2 +-
>   hw/mips/malta.c                     |   2 +-
>   hw/mips/mipssim.c                   |   2 +-
>   hw/openrisc/openrisc_sim.c          |   2 +-
>   hw/openrisc/virt.c                  |   2 +-
>   hw/ppc/e500.c                       |   2 +-
>   hw/ppc/ppc405_uc.c                  |   2 +-
>   hw/ppc/ppc440_bamboo.c              |   2 +-
>   hw/ppc/sam460ex.c                   |   2 +-
>   hw/ppc/virtex_ml507.c               |   2 +-
>   hw/riscv/virt.c                     |   2 +-
>   hw/sparc64/niagara.c                |   2 +-
>   hw/sparc64/sun4u.c                  |   2 +-
>   hw/xtensa/xtfpga.c                  |   2 +-
>   hw/arm/Kconfig                      |  20 ++--
>   hw/char/Kconfig                     |   4 +
>   hw/char/meson.build                 |   1 +
>   hw/display/Kconfig                  |   2 +-
>   hw/hppa/Kconfig                     |   2 +-
>   hw/loongarch/Kconfig                |   2 +-
>   hw/microblaze/Kconfig               |   2 +-
>   hw/mips/Kconfig                     |  10 +-
>   hw/openrisc/Kconfig                 |   4 +-
>   hw/ppc/Kconfig                      |  10 +-
>   hw/riscv/Kconfig                    |   2 +-
>   hw/sparc64/Kconfig                  |   1 +
>   hw/xtensa/Kconfig                   |   2 +-
>   50 files changed, 276 insertions(+), 206 deletions(-)
>   create mode 100644 include/hw/char/serial-mm.h
>   create mode 100644 hw/char/serial-mm.c


> diff --git a/include/hw/char/serial-mm.h b/include/hw/char/serial-mm.h
> new file mode 100644
> index 0000000000..62a8489d69
> --- /dev/null
> +++ b/include/hw/char/serial-mm.h
> @@ -0,0 +1,52 @@
> +/*
> + * QEMU 16550A UART emulation
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + * Copyright (c) 2008 Citrix Systems, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */


> diff --git a/hw/char/serial-mm.c b/hw/char/serial-mm.c
> new file mode 100644
> index 0000000000..2f67776b19
> --- /dev/null
> +++ b/hw/char/serial-mm.c
> @@ -0,0 +1,157 @@
> +/*
> + * QEMU 16550A UART emulation
> + *
> + * Copyright (c) 2003-2004 Fabrice Bellard
> + * Copyright (c) 2008 Citrix Systems, Inc.
> + *
> + * Permission is hereby granted, free of charge, to any person obtaining a copy
> + * of this software and associated documentation files (the "Software"), to deal
> + * in the Software without restriction, including without limitation the rights
> + * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
> + * copies of the Software, and to permit persons to whom the Software is
> + * furnished to do so, subject to the following conditions:
> + *
> + * The above copyright notice and this permission notice shall be included in
> + * all copies or substantial portions of the Software.
> + *
> + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
> + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
> + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
> + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
> + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
> + * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
> + * THE SOFTWARE.
> + */

Could we start recommend to also add SPDX tags for new files committed
to the repository? They are clearer than mis-copy/pasted license with
typos and can be parsed by tools.

Regards,

Phil.


  reply	other threads:[~2024-09-05 11:14 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-09-05  7:38 [PATCH v2 0/3] Serial device cleanup Bernhard Beschow
2024-09-05  7:38 ` [PATCH v2 1/3] hw: Remove unused inclusion of hw/char/serial.h Bernhard Beschow
2024-09-05 23:40   ` Alistair Francis
2024-09-05  7:38 ` [PATCH v2 2/3] hw/char/serial.h: Extract serial-isa.h Bernhard Beschow
2024-09-05  7:38 ` [PATCH v2 3/3] hw/char: Extract serial-mm Bernhard Beschow
2024-09-05 11:13   ` Philippe Mathieu-Daudé [this message]
2024-09-05 13:02     ` Peter Maydell
2024-09-05 12:26   ` BALATON Zoltan
2024-09-07 17:33     ` Bernhard Beschow
2024-09-05  7:56 ` [PATCH v2 0/3] Serial device cleanup Paolo Bonzini

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=08360075-385e-4083-8dea-5e2275d02834@linaro.org \
    --to=philmd@linaro.org \
    --cc=Alistair.Francis@wdc.com \
    --cc=alex.bennee@linaro.org \
    --cc=andrew@codeconstruct.com.au \
    --cc=arikalo@gmail.com \
    --cc=atar4qemu@gmail.com \
    --cc=aurelien@aurel32.net \
    --cc=b.galvani@gmail.com \
    --cc=balaton@eik.bme.hu \
    --cc=berrange@redhat.com \
    --cc=bmeng.cn@gmail.com \
    --cc=chenhuacai@kernel.org \
    --cc=clg@kaod.org \
    --cc=dbarboza@ventanamicro.com \
    --cc=deller@gmx.de \
    --cc=edgar.iglesias@gmail.com \
    --cc=eduardo@habkost.net \
    --cc=fbarrat@linux.ibm.com \
    --cc=gaosong@loongson.cn \
    --cc=hpoussin@reactos.org \
    --cc=jamin_lin@aspeedtech.com \
    --cc=jan.kiszka@web.de \
    --cc=jcmvbkbc@gmail.com \
    --cc=jiaxun.yang@flygoat.com \
    --cc=joel@jms.id.au \
    --cc=kfting@nuvoton.com \
    --cc=leetroy@gmail.com \
    --cc=liwei1518@gmail.com \
    --cc=marcandre.lureau@redhat.com \
    --cc=marcel.apfelbaum@gmail.com \
    --cc=mark.cave-ayland@ilande.co.uk \
    --cc=mst@redhat.com \
    --cc=nieklinnenbank@gmail.com \
    --cc=npiggin@gmail.com \
    --cc=palmer@dabbelt.com \
    --cc=paulburton@kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=peter.maydell@linaro.org \
    --cc=proljc@gmail.com \
    --cc=qemu-arm@nongnu.org \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-ppc@nongnu.org \
    --cc=qemu-riscv@nongnu.org \
    --cc=richard.henderson@linaro.org \
    --cc=shentey@gmail.com \
    --cc=shorne@gmail.com \
    --cc=slp@redhat.com \
    --cc=stefanha@redhat.com \
    --cc=steven_lee@aspeedtech.com \
    --cc=strahinja.p.jankovic@gmail.com \
    --cc=sundeep.lkml@gmail.com \
    --cc=wuhaotsh@google.com \
    --cc=zhiwei_liu@linux.alibaba.com \
    /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 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).