qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PATCH] input/adb: Only include where needed


From: Philippe Mathieu-Daudé
Subject: Re: [PATCH] input/adb: Only include where needed
Date: Sat, 5 Feb 2022 12:13:23 +0100
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.5.1

On 5/2/22 12:02, Mark Cave-Ayland wrote:
On 27/01/2022 23:39, BALATON Zoltan wrote:

On Mon, 5 Jul 2021, BALATON Zoltan wrote:
The header hw/input/adb.h is included by some files that don't need
it. Clean it up and include only where necessary.

When you're touching mos6522, I've also have this patch that cleans up includes that's somewhat related to mos6522 so you could consider it to be included in your series. I haven't checked but it should still apply. At least I got no problem with rebasing so at least with --3way should probably work but if not I can resend just let me know.

I have a vague memory that someone was advocating a while back for the opposite of this patch in the way it uses headers i.e. the .c file should contain the include for the header as well as the .h file, so I'm not sure what the recommendation is here.

Headers should include the minimum headers they require.

hw/misc/macio/cuda.h uses ADBBusState which is declared in
"hw/input/adb.h", so it must include this header, otherwise we can
consider this a bug.

I haven't checked the rest.

The parts related to tidying up the mos6522.c and mos6522.h includes look correct though, as they shouldn't be referencing any ADB headers.


ATB,

Mark.

Signed-off-by: BALATON Zoltan <balaton@eik.bme.hu>
---
hw/misc/macio/cuda.c         | 2 --
hw/misc/macio/pmu.c          | 3 ---
hw/misc/mos6522.c            | 1 -
hw/ppc/mac.h                 | 2 --
include/hw/misc/mac_via.h    | 1 +
include/hw/misc/macio/cuda.h | 1 +
include/hw/misc/macio/pmu.h  | 1 +
include/hw/misc/mos6522.h    | 3 +--
8 files changed, 4 insertions(+), 10 deletions(-)

diff --git a/include/hw/misc/macio/cuda.h b/include/hw/misc/macio/cuda.h
index a71deec968..8a6678c749 100644
--- a/include/hw/misc/macio/cuda.h
+++ b/include/hw/misc/macio/cuda.h
@@ -26,6 +26,7 @@
#ifndef CUDA_H
#define CUDA_H

+#include "hw/input/adb.h"
#include "hw/misc/mos6522.h"
#include "qom/object.h"



reply via email to

[Prev in Thread] Current Thread [Next in Thread]