[Qemu-devel] [PATCH v3 RESEND 0/3] nvram: at24c: fix problems related to "rom-size"

2018-05-20 Thread Wolfram Sang
ror_report(). Wolfram Sang (3): nvram: at24c: prevent segfault by checking "rom-size" nvram: at24c: use a sane default for "rom-size" nvram: at24c: use standard error reporting hw/nvram/eeprom_at24c.c | 25 ++--- 1 file changed, 14 insertions(+), 11 deletions(-) -- 2.11.0

[Qemu-devel] [PATCH v3 RESEND 2/3] nvram: at24c: use a sane default for "rom-size"

2018-05-20 Thread Wolfram Sang
0 as "rom-size" will lead to an error message. Let's use the size of a small 24c01 which has 128 byte. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 5 - 1 file chang

[Qemu-devel] [PATCH v3 RESEND 3/3] nvram: at24c: use standard error reporting

2018-05-20 Thread Wolfram Sang
Replace the ERR macro with error_report() because fprintf is deprecated. This also fixes the prefix printed out twice. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 17 ++---

[Qemu-devel] [PATCH v3 RESEND 1/3] nvram: at24c: prevent segfault by checking "rom-size"

2018-05-20 Thread Wolfram Sang
The value for "rom-size" is used as a divisor, so it must not be 0 or it will segfault. A size of 0 wouldn't make sense anyhow. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at2

[Qemu-devel] [RFC PATCH] i2c: device passthrough HACK(!) & evaluation

2018-03-13 Thread Wolfram Sang
rtualization I will still be around for further discussion. I can't really tell, though, if there will be a follow-up task for me to continue this. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/i2c/Makefile.objs | 2 +- hw/i2c/host-i2cdev.c | 110 ++

[Qemu-devel] [PATCH 0/3] nvram: at24c: fix problems related to "rom-size"

2018-03-12 Thread Wolfram Sang
I used this driver as a template for a custom one. While hacking on my own, I noticed some problems in this driver, too. This series fixes the first set of them, mostly related to "rom-size". It fixes a segfault. Wolfram Sang (3): nvram: at24c: remove doubled prefix for ERR nv

[Qemu-devel] [PATCH 3/3] nvram: at24c: use a sane default for "rom-size"

2018-03-12 Thread Wolfram Sang
0 as "rom-size" doesn't make much sense, let's use the smallest 24cXX which has 128 byte. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hw/nvram/eeprom_at

[Qemu-devel] [PATCH 2/3] nvram: at24c: prevent segfault by checking "rom-size"

2018-03-12 Thread Wolfram Sang
The value for "rom-size" is used as a divisor, so it must not be 0 or it will segfault. A size of 0 wouldn't make sense as well. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 5 + 1 file changed, 5 insertions(+) diff

[Qemu-devel] [PATCH 1/3] nvram: at24c: remove doubled prefix for ERR

2018-03-12 Thread Wolfram Sang
The ERR macro already has the TYPE_AT24C_EE prefix, no need to repeat in the error message. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 11 --- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/hw/nvram/eeprom_at24c.

Re: [Qemu-devel] [PATCH 1/3] nvram: at24c: remove doubled prefix for ERR

2018-03-13 Thread Wolfram Sang
> > -ERR(TYPE_AT24C_EE > > -" : failed to write backing file\n"); > > +ERR("failed to write backing file\n"); > > printf/fprintf are deprecated, since you are modifying this file can you > use a newer API, "qemu/error-report.h" for example.

Re: [Qemu-devel] [PATCH 3/3] nvram: at24c: use a sane default for "rom-size"

2018-03-13 Thread Wolfram Sang
Hi Philippe, > > static Property at24c_eeprom_props[] = { > > -DEFINE_PROP_UINT32("rom-size", EEPROMState, rsize, 0), > > +DEFINE_PROP_UINT32("rom-size", EEPROMState, rsize, 128), > > This patch should goes before your 2/3 in your series. I don't mind much, but why? My reasoning was

Re: [Qemu-devel] [PATCH v3 0/3] nvram: at24c: fix problems related to "rom-size"

2018-04-08 Thread Wolfram Sang
On Tue, Mar 20, 2018 at 05:18:47PM +0100, Wolfram Sang wrote: > I used this driver as a template for a custom one. While hacking on my own, I > noticed some problems in this driver, too. This series fixes the first set of > them, related to the "rom-size" parameter. It fixes

Re: [Qemu-devel] [PATCH v2 1/3] nvram: at24c: prevent segfault by checking "rom-size"

2018-03-20 Thread Wolfram Sang
> > +if (!ee->rsize) { > > +ERR("rom-size not allowed to be 0\n"); > > You can directly use error_report() in this patch. My reasoning was that this patch is suitable for stable while the error_report() stuff is not. I neither wanted to mix those two here nor did I want to make the

[Qemu-devel] [PATCH v2 3/3] nvram: at24c: use standard error reporting

2018-03-19 Thread Wolfram Sang
Replace the ERR macro with error_report() because fprintf is deprecated. This also fixes the prefix printed out twice. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 17 ++--- 1 file changed, 6 insertions(+), 11 deletions(-) diff

Re: [Qemu-devel] [PATCH v2 3/3] nvram: at24c: use standard error reporting

2018-03-19 Thread Wolfram Sang
> > -ERR(TYPE_AT24C_EE > > -" : failed to write backing file\n"); > > +error_report("failed to write backing file\n"); > > Drop the \n here and elsewhere in your patch; error_report() already does > that for you. Darn, I haven't installed

[Qemu-devel] [PATCH v2 1/3] nvram: at24c: prevent segfault by checking "rom-size"

2018-03-19 Thread Wolfram Sang
The value for "rom-size" is used as a divisor, so it must not be 0 or it will segfault. A size of 0 wouldn't make sense anyhow. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 5 + 1 file changed, 5 insertions(+) diff

[Qemu-devel] [PATCH v2 0/3] nvram: at24c: fix problems related to "rom-size"

2018-03-19 Thread Wolfram Sang
3 doesn't improve the ERR macro anymore but replaces it completely with error_report(). Wolfram Sang (3): nvram: at24c: prevent segfault by checking "rom-size" nvram: at24c: use a sane default for "rom-size" nvram: at24c: use standard error reporting

[Qemu-devel] [PATCH v2 2/3] nvram: at24c: use a sane default for "rom-size"

2018-03-19 Thread Wolfram Sang
0 as "rom-size" will lead to an error message. Let's use the size of a small 24c01 which has 128 byte. Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 5 - 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/hw/nvram/eep

[Qemu-devel] [PATCH v3 2/3] nvram: at24c: use a sane default for "rom-size"

2018-03-20 Thread Wolfram Sang
0 as "rom-size" will lead to an error message. Let's use the size of a small 24c01 which has 128 byte. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 5 - 1 file chang

[Qemu-devel] [PATCH v3 3/3] nvram: at24c: use standard error reporting

2018-03-20 Thread Wolfram Sang
Replace the ERR macro with error_report() because fprintf is deprecated. This also fixes the prefix printed out twice. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at24c.c | 17 ++---

[Qemu-devel] [PATCH v3 1/3] nvram: at24c: prevent segfault by checking "rom-size"

2018-03-20 Thread Wolfram Sang
The value for "rom-size" is used as a divisor, so it must not be 0 or it will segfault. A size of 0 wouldn't make sense anyhow. Reviewed-by: Philippe Mathieu-Daudé <f4...@amsat.org> Signed-off-by: Wolfram Sang <wsa+rene...@sang-engineering.com> --- hw/nvram/eeprom_at2

[Qemu-devel] [PATCH v3 0/3] nvram: at24c: fix problems related to "rom-size"

2018-03-20 Thread Wolfram Sang
s since v1: * reordered patches according to significance for stable * use AT24C_ROMSIZE_DEFAULT instead of magic value * patch 3 doesn't improve the ERR macro anymore but replaces it completely with error_report(). Wolfram Sang (3): nvram: at24c: prevent segfault by checking "rom-size"

Re: [Qemu-devel] [PATCH 3/3] nvram: at24c: use a sane default for "rom-size"

2018-03-19 Thread Wolfram Sang
Hi Philippe, > > I don't mind much, but why? My reasoning was "let's first fix the cause > > and then the symptom"? > > The '0' case is worst than incorrect, it segfaults, so you are right :) Ok, thanks. > >> Can you add a #define for this value? Such AT24C_ROMSIZE_MIN. > > > > Can do, of

Re: [PATCH v6 2/8] i2c: i801: Use GPIO_LOOKUP() helper macro

2020-04-15 Thread Wolfram Sang
On Tue, Mar 24, 2020 at 02:56:47PM +0100, Geert Uytterhoeven wrote: > i801_add_mux() fills in the GPIO lookup table by manually populating an > array of gpiod_lookup structures. Use the existing GPIO_LOOKUP() helper > macro instead, to relax a dependency on the gpiod_lookup structure's > member

Re: [RFC PATCH-for-9.1 3/4] hw/i2c: Convert to spec v7 terminology (automatically)

2024-04-09 Thread Wolfram Sang
quot; guidelines [*], replace > the I2C terminology. ... > Inspired-by: Wolfram Sang Cool, I am glad that I could inspire you to do this for QEMU. Good luck with the series, Wolfram signature.asc Description: PGP signature