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
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
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 ++---
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
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 ++
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
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
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
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.
> > -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.
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
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
> > +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
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
> > -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
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
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
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
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
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 ++---
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
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"
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
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
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
25 matches
Mail list logo