Skip to contentSkip to conversation

fw_cfg: Make base type "fw_cfg" abstract

PATCH In review Markus Armbruster 3 participants 4 messages Jul 29, 2016 – Aug 1, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fw_cfg: Make base type "fw_cfg" abstract

Missed when commit 5712db6 split off "fw_cfg_io" and "fw_cfg_mem".

---
 hw/nvram/fw_cfg.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/fw_cfg.c +1 -0
index 2873030..0ccab2d 100644
@@ -990,6 +990,7 @@ static void fw_cfg_class_init(ObjectClass *klass, void *data)
 static const TypeInfo fw_cfg_info = {
     .name          = TYPE_FW_CFG,
     .parent        = TYPE_SYS_BUS_DEVICE,
+    .abstract = true,
     .instance_size = sizeof(FWCfgState),
     .class_init    = fw_cfg_class_init,
 };
Signature · 1 line
2.5.5
Reviewed-by on v1 1/1
#1 lore raw
Quoted 13 lines · Markus Armbruster

Missed when commit 5712db6 split off "fw_cfg_io" and "fw_cfg_mem".

---
 hw/nvram/fw_cfg.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/fw_cfg.c +0 -0
index 2873030..0ccab2d 100644

hw/nvram/fw_cfg.c static void fw_cfg_class_init(ObjectClass *klass, void *data) · line 996

Quoted 7 lines
hw/nvram/fw_cfg.c +1 -0
@@ -990,6 +990,7 @@ static void fw_cfg_class_init(ObjectClass *klass, void *data)
 static const TypeInfo fw_cfg_info = {
     .name          = TYPE_FW_CFG,
     .parent        = TYPE_SYS_BUS_DEVICE,
+    .abstract = true,
     .instance_size = sizeof(FWCfgState),
     .class_init    = fw_cfg_class_init,
 };

Not sure how consistent we try to be about this: should the equal sign (in the assignment) line up with the other equal signs?

Looking for prior art, I ran

git grep -E 'abstract {2,}= true'

and it returned 27 hits.

Functionally the patch is right, of course. And I think the whitespace can be adjusted without a repost, if we agree it should be adjusted.

Thanks!
Laszlo

#2 lore raw
Quoted 25 lines · Laszlo Ersek
Quoted 13 lines · Markus Armbruster

Missed when commit 5712db6 split off "fw_cfg_io" and "fw_cfg_mem".

---
 hw/nvram/fw_cfg.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/fw_cfg.c +0 -0
index 2873030..0ccab2d 100644

hw/nvram/fw_cfg.c static void fw_cfg_class_init(ObjectClass *klass, void *data) · line 996

Quoted 7 lines
hw/nvram/fw_cfg.c +1 -0
@@ -990,6 +990,7 @@ static void fw_cfg_class_init(ObjectClass *klass, void *data)
 static const TypeInfo fw_cfg_info = {
     .name          = TYPE_FW_CFG,
     .parent        = TYPE_SYS_BUS_DEVICE,
+    .abstract = true,
     .instance_size = sizeof(FWCfgState),
     .class_init    = fw_cfg_class_init,
 };

Not sure how consistent we try to be about this: should the equal sign (in the assignment) line up with the other equal signs?

Quoted 8 lines

Looking for prior art, I ran

git grep -E 'abstract {2,}= true'

and it returned 27 hits.

Functionally the patch is right, of course. And I think the whitespace can be adjusted without a repost, if we agree it should be adjusted.

Yes, please.

Quoted 4 lines

Thanks!
Laszlo

Thanks!

#3 lore raw
In reply to Laszlo Ersek
Quoted 27 lines · Laszlo Ersek
Quoted 13 lines · Markus Armbruster

Missed when commit 5712db6 split off "fw_cfg_io" and "fw_cfg_mem".

---
 hw/nvram/fw_cfg.c | 1 +
 1 file changed, 1 insertion(+)
hw/nvram/fw_cfg.c +0 -0
index 2873030..0ccab2d 100644

hw/nvram/fw_cfg.c static void fw_cfg_class_init(ObjectClass *klass, void *data) · line 996

Quoted 7 lines
hw/nvram/fw_cfg.c +1 -0
@@ -990,6 +990,7 @@ static void fw_cfg_class_init(ObjectClass *klass, void *data)
 static const TypeInfo fw_cfg_info = {
     .name          = TYPE_FW_CFG,
     .parent        = TYPE_SYS_BUS_DEVICE,
+    .abstract = true,
     .instance_size = sizeof(FWCfgState),
     .class_init    = fw_cfg_class_init,
 };

Not sure how consistent we try to be about this: should the equal sign (in the assignment) line up with the other equal signs?

Looking for prior art, I ran

Quoted 8 lines

git grep -E 'abstract {2,}= true'

and it returned 27 hits.

Functionally the patch is right, of course. And I think the whitespace can be adjusted without a repost, if we agree it should be adjusted.

Tweaked and queued, thanks to both.

Paolo