Skip to contentSkip to conversation

checkpatch.pl: add common glib defines to typelist

PATCH Applied Peter Xu 4 participants 4 messages Apr 25, 2018 – Apr 28, 2018 Checkpatch

lore
Share & tools
lore

Peter Xu

author
#0 lore raw

PATCH v2 1/1 checkpatch.pl: add common glib defines to typelist

Otherwise it can warn this:

ERROR: space prohibited between function name and open parenthesis '('

When with things like this:

typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);

CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Vladimir Sementsov-Ogievskiy <[email protected]>
CC Fam Zheng <[email protected]>

---
v2:
- add more missing glib types [Markus]

---
 scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
scripts/checkpatch.pl +27 -0
index d52207a3cc..4954150e87 100755
@@ -266,6 +266,33 @@ our @typeList = (
 	qr{target_(?:u)?long},
 	qr{hwaddr},
 	qr{xml${Ident}},
+	# Glib definitions
+	qr{gchar},
+	qr{gshort},
+	qr{glong},
+	qr{gint},
+	qr{gboolean},
+	qr{guchar},
+	qr{gushort},
+	qr{gulong},
+	qr{guint},
+	qr{gfloat},
+	qr{gdouble},
+	qr{gpointer},
+	qr{gconstpointer},
+	qr{gint8},
+	qr{guint8},
+	qr{gint16},
+	qr{guint16},
+	qr{gint32},
+	qr{guint32},
+	qr{gint64},
+	qr{guint64},
+	qr{gsize},
+	qr{gssize},
+	qr{goffset},
+	qr{gintptr},
+	qr{guintptr},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful
Signature · 1 line
2.14.3
Reviewed-by on v2 1/1
#1 lore raw
Quoted 50 lines · Peter Xu

Otherwise it can warn this:

ERROR: space prohibited between function name and open parenthesis '('

When with things like this:

typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);

CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Vladimir Sementsov-Ogievskiy <[email protected]>
CC Fam Zheng <[email protected]>

---
v2:
- add more missing glib types [Markus]

---
 scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
scripts/checkpatch.pl +20 -0
index d52207a3cc..4954150e87 100755
@@ -266,6 +266,33 @@ our @typeList = (
 	qr{target_(?:u)?long},
 	qr{hwaddr},
 	qr{xml${Ident}},
+	# Glib definitions
+	qr{gchar},
+	qr{gshort},
+	qr{glong},
+	qr{gint},
+	qr{gboolean},
+	qr{guchar},
+	qr{gushort},
+	qr{gulong},
+	qr{guint},
+	qr{gfloat},
+	qr{gdouble},
+	qr{gpointer},
+	qr{gconstpointer},
+	qr{gint8},
+	qr{guint8},
+	qr{gint16},
+	qr{guint16},
+	qr{gint32},
+	qr{guint32},

scripts/checkpatch.pl our @typeList = ( · line 298

Quoted 10 lines
scripts/checkpatch.pl +7 -0
+	qr{gint64},
+	qr{guint64},
+	qr{gsize},
+	qr{gssize},
+	qr{goffset},
+	qr{gintptr},
+	qr{guintptr},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful

We could quibble about order, but since this is unlikely to need maintenance, let's just take it and move on.

Reviewed-by on v2 1/1
#2 lore raw
In reply to Peter Xu
Quoted 15 lines · Peter Xu

Otherwise it can warn this:

ERROR: space prohibited between function name and open parenthesis '('

When with things like this:

typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);

CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Vladimir Sementsov-Ogievskiy <[email protected]>
CC Fam Zheng <[email protected]>
Quoted 6 lines

---
v2:
- add more missing glib types [Markus]

---
 scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
#3 lore raw
In reply to Peter Xu
Quoted 51 lines · Peter Xu

Otherwise it can warn this:

ERROR: space prohibited between function name and open parenthesis '('

When with things like this:

typedef gboolean (*it_tree_iterator)(ITValue start, ITValue end);

CC Paolo Bonzini <[email protected]>
CC Stefan Hajnoczi <[email protected]>
CC "Daniel P. Berrangé" <[email protected]>
CC Markus Armbruster <[email protected]>
CC Vladimir Sementsov-Ogievskiy <[email protected]>
CC Fam Zheng <[email protected]>

---
v2:
- add more missing glib types [Markus]

---
 scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)
scripts/checkpatch.pl +20 -0
index d52207a3cc..4954150e87 100755
@@ -266,6 +266,33 @@ our @typeList = (
 	qr{target_(?:u)?long},
 	qr{hwaddr},
 	qr{xml${Ident}},
+	# Glib definitions
+	qr{gchar},
+	qr{gshort},
+	qr{glong},
+	qr{gint},
+	qr{gboolean},
+	qr{guchar},
+	qr{gushort},
+	qr{gulong},
+	qr{guint},
+	qr{gfloat},
+	qr{gdouble},
+	qr{gpointer},
+	qr{gconstpointer},
+	qr{gint8},
+	qr{guint8},
+	qr{gint16},
+	qr{guint16},
+	qr{gint32},
+	qr{guint32},

scripts/checkpatch.pl our @typeList = ( · line 298

Quoted 10 lines
scripts/checkpatch.pl +7 -0
+	qr{gint64},
+	qr{guint64},
+	qr{gsize},
+	qr{gssize},
+	qr{goffset},
+	qr{gintptr},
+	qr{guintptr},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful

Queued, thanks.

Paolo