Gabe Black has submitted this change. ( https://gem5-review.googlesource.com/c/public/gem5/+/45285 )

Change subject: dev: Overload swap_bytes, don't specialize the template.
......................................................................

dev: Overload swap_bytes, don't specialize the template.

The effect is the same, the rules for overloads are easier to work with
than the rules for templates, and it removes the assumption that
swap_bytes actually is a template.

Also some minor style fixes.

Change-Id: Id9439177185b5269dd89605bbd05b09390a18d40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/45285
Reviewed-by: Daniel Carvalho <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
Reviewed-by: Bobby R. Bruce <[email protected]>
Maintainer: Jason Lowe-Power <[email protected]>
Tested-by: kokoro <[email protected]>
---
M src/dev/virtio/base.hh
1 file changed, 6 insertions(+), 4 deletions(-)

Approvals:
Jason Lowe-Power: Looks good to me, but someone else must approve; Looks good to me, approved
  Daniel Carvalho: Looks good to me, but someone else must approve
  Bobby R. Bruce: Looks good to me, approved
  kokoro: Regressions pass



diff --git a/src/dev/virtio/base.hh b/src/dev/virtio/base.hh
index 8b20be1..416d3a4 100644
--- a/src/dev/virtio/base.hh
+++ b/src/dev/virtio/base.hh
@@ -68,15 +68,17 @@
  */


-template <> inline vring_used_elem
-swap_byte(vring_used_elem v) {
+static inline vring_used_elem
+swap_byte(vring_used_elem v)
+{
     v.id = swap_byte(v.id);
     v.len = swap_byte(v.len);
     return v;
 }

-template <> inline vring_desc
-swap_byte(vring_desc v) {
+static inline vring_desc
+swap_byte(vring_desc v)
+{
     v.addr = swap_byte(v.addr);
     v.len = swap_byte(v.len);
     v.flags = swap_byte(v.flags);

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/45285
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: Id9439177185b5269dd89605bbd05b09390a18d40
Gerrit-Change-Number: 45285
Gerrit-PatchSet: 2
Gerrit-Owner: Gabe Black <[email protected]>
Gerrit-Reviewer: Andreas Sandberg <[email protected]>
Gerrit-Reviewer: Bobby R. Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Gabe Black <[email protected]>
Gerrit-Reviewer: Giacomo Travaglini <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Nikos Nikoleris <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-MessageType: merged
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]
%(web_page_url)slistinfo%(cgiext)s/%(_internal_name)s

Reply via email to