[Qemu-devel] [PATCH v2] checkpatch.pl: add common glib defines to typelist

Peter Xu posted 1 patch 7 years, 6 months ago
Failed in applying to current master (apply log)
Test checkpatch passed
Test docker-build@min-glib passed
Test docker-mingw@fedora passed
Test s390x passed
scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)
[Qemu-devel] [PATCH v2] checkpatch.pl: add common glib defines to typelist
Posted by Peter Xu 7 years, 6 months ago
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 <pbonzini@redhat.com>
CC: Stefan Hajnoczi <stefanha@redhat.com>
CC: "Daniel P. Berrangé" <berrange@redhat.com>
CC: Markus Armbruster <armbru@redhat.com>
CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
CC: Fam Zheng <famz@redhat.com>
Signed-off-by: Peter Xu <peterx@redhat.com>
---
v2:
- add more missing glib types [Markus]
---
 scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
 1 file changed, 27 insertions(+)

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d52207a3cc..4954150e87 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -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
-- 
2.14.3


Re: [Qemu-devel] [PATCH v2] checkpatch.pl: add common glib defines to typelist
Posted by Markus Armbruster 7 years, 6 months ago
Peter Xu <peterx@redhat.com> writes:

> 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 <pbonzini@redhat.com>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: "Daniel P. Berrangé" <berrange@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> CC: Fam Zheng <famz@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> v2:
> - add more missing glib types [Markus]
> ---
>  scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
>
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d52207a3cc..4954150e87 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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

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

Reviewed-by: Markus Armbruster <armbru@redhat.com>

Re: [Qemu-devel] [PATCH v2] checkpatch.pl: add common glib defines to typelist
Posted by Stefan Hajnoczi 7 years, 6 months ago
On Wed, Apr 25, 2018 at 03:01:03PM +0800, Peter Xu wrote:
> 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 <pbonzini@redhat.com>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: "Daniel P. Berrangé" <berrange@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> CC: Fam Zheng <famz@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> v2:
> - add more missing glib types [Markus]
> ---
>  scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)

Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
Re: [Qemu-devel] [PATCH v2] checkpatch.pl: add common glib defines to typelist
Posted by Paolo Bonzini 7 years, 6 months ago
On 25/04/2018 09:01, Peter Xu wrote:
> 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 <pbonzini@redhat.com>
> CC: Stefan Hajnoczi <stefanha@redhat.com>
> CC: "Daniel P. Berrangé" <berrange@redhat.com>
> CC: Markus Armbruster <armbru@redhat.com>
> CC: Vladimir Sementsov-Ogievskiy <vsementsov@virtuozzo.com>
> CC: Fam Zheng <famz@redhat.com>
> Signed-off-by: Peter Xu <peterx@redhat.com>
> ---
> v2:
> - add more missing glib types [Markus]
> ---
>  scripts/checkpatch.pl | 27 +++++++++++++++++++++++++++
>  1 file changed, 27 insertions(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d52207a3cc..4954150e87 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -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
> 

Queued, thanks.

Paolo