qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] firmware: fw_cfg register offsets on supported architectures only
@ 2016-02-22 21:18 Gabriel Somlo
  2016-02-23  5:08 ` Michael S. Tsirkin
  0 siblings, 1 reply; 2+ messages in thread
From: Gabriel Somlo @ 2016-02-22 21:18 UTC (permalink / raw)
  To: Michael S. Tsirkin
  Cc: mark.rutland, peter.maydell, matt, stefanha, qemu-devel, eric,
	kraxel, linux-api, agross, pawel.moll, zajec5, rmk+kernel,
	lersek, devicetree, ehabkost, arnd, ijc+devicetree, galak,
	leif.lindholm, robh+dt, pbonzini, rth, ard.biesheuvel, gregkh,
	linux-kernel, luto, hanjun.guo, sudeep.holla, imammedo, revol

Refrain from defining default fw_cfg register offsets on
unsupported architectures -- throw an error instead. If
QEMU were to add fw_cfg support on additional architectures,
we should add them to the FW_CFG_SYSFS depends statement in
drivers/firmware/Kconfig, and provide default values for
register offsets in drivers/firmware/qemu_fw_cfg.c at that
time.

Suggested-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: Gabriel Somlo <somlo@cmu.edu>
---
 drivers/firmware/qemu_fw_cfg.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
index fedbff5..79f6b7b 100644
--- a/drivers/firmware/qemu_fw_cfg.c
+++ b/drivers/firmware/qemu_fw_cfg.c
@@ -109,9 +109,7 @@ static void fw_cfg_io_cleanup(void)
 #  define FW_CFG_CTRL_OFF 0x00
 #  define FW_CFG_DATA_OFF 0x01
 # else
-#  warning "QEMU FW_CFG may not be available on this architecture!"
-#  define FW_CFG_CTRL_OFF 0x00
-#  define FW_CFG_DATA_OFF 0x01
+#  error "QEMU FW_CFG not available on this architecture!"
 # endif
 #endif
 
-- 
2.4.3

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] firmware: fw_cfg register offsets on supported architectures only
  2016-02-22 21:18 [Qemu-devel] [PATCH] firmware: fw_cfg register offsets on supported architectures only Gabriel Somlo
@ 2016-02-23  5:08 ` Michael S. Tsirkin
  0 siblings, 0 replies; 2+ messages in thread
From: Michael S. Tsirkin @ 2016-02-23  5:08 UTC (permalink / raw)
  To: Gabriel Somlo
  Cc: mark.rutland, peter.maydell, matt, stefanha, qemu-devel, eric,
	kraxel, linux-api, agross, pawel.moll, zajec5, rmk+kernel,
	lersek, devicetree, ehabkost, arnd, ijc+devicetree, galak,
	leif.lindholm, robh+dt, pbonzini, rth, ard.biesheuvel, gregkh,
	linux-kernel, luto, hanjun.guo, sudeep.holla, imammedo, revol

On Mon, Feb 22, 2016 at 04:18:18PM -0500, Gabriel Somlo wrote:
> Refrain from defining default fw_cfg register offsets on
> unsupported architectures -- throw an error instead. If
> QEMU were to add fw_cfg support on additional architectures,
> we should add them to the FW_CFG_SYSFS depends statement in
> drivers/firmware/Kconfig, and provide default values for
> register offsets in drivers/firmware/qemu_fw_cfg.c at that
> time.
> 
> Suggested-by: Michael S. Tsirkin <mst@redhat.com>
> Signed-off-by: Gabriel Somlo <somlo@cmu.edu>

Acked-by: Michael S. Tsirkin <mst@redhat.com>


> ---
>  drivers/firmware/qemu_fw_cfg.c | 4 +---
>  1 file changed, 1 insertion(+), 3 deletions(-)
> 
> diff --git a/drivers/firmware/qemu_fw_cfg.c b/drivers/firmware/qemu_fw_cfg.c
> index fedbff5..79f6b7b 100644
> --- a/drivers/firmware/qemu_fw_cfg.c
> +++ b/drivers/firmware/qemu_fw_cfg.c
> @@ -109,9 +109,7 @@ static void fw_cfg_io_cleanup(void)
>  #  define FW_CFG_CTRL_OFF 0x00
>  #  define FW_CFG_DATA_OFF 0x01
>  # else
> -#  warning "QEMU FW_CFG may not be available on this architecture!"
> -#  define FW_CFG_CTRL_OFF 0x00
> -#  define FW_CFG_DATA_OFF 0x01
> +#  error "QEMU FW_CFG not available on this architecture!"
>  # endif
>  #endif
>  
> -- 
> 2.4.3

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-02-23  5:08 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-22 21:18 [Qemu-devel] [PATCH] firmware: fw_cfg register offsets on supported architectures only Gabriel Somlo
2016-02-23  5:08 ` Michael S. Tsirkin

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).