diff mbox

[v3,05/14] qapi: Simplify c_enum_const()

Message ID 1430829055-4739-6-git-send-email-eblake@redhat.com
State New
Headers show

Commit Message

Eric Blake May 5, 2015, 12:30 p.m. UTC
From: Markus Armbruster <armbru@redhat.com>

Signed-off-by: Markus Armbruster <armbru@redhat.com>
Signed-off-by: Eric Blake <eblake@redhat.com>
---
 scripts/qapi.py | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)
diff mbox

Patch

diff --git a/scripts/qapi.py b/scripts/qapi.py
index b3628fd..9209fd5 100644
--- a/scripts/qapi.py
+++ b/scripts/qapi.py
@@ -961,6 +961,4 @@  def camel_to_upper(value):
     return new_name.lstrip('_').upper()

 def c_enum_const(type_name, const_name):
-    abbrev_string = camel_to_upper(type_name)
-    value_string = camel_to_upper(const_name)
-    return "%s_%s" % (abbrev_string, value_string)
+    return camel_to_upper(type_name + '_' + const_name)