diff mbox

[01/12] checkpatch: Add xendevicemodel_handle to the list of types

Message ID 1520535787-6223-2-git-send-email-ian.jackson@eu.citrix.com (mailing list archive)
State New, archived
Headers show

Commit Message

Ian Jackson March 8, 2018, 7:02 p.m. UTC
This avoids checkpatch misparsing (as statements) long function
definitions or declarations, which sometimes start with constructs
like this:

  static inline int xendevicemodel_relocate_memory(
      xendevicemodel_handle *dmod, domid_t domid, ...

CC: Eric Blake <eblake@redhat.com>
CC: Paolo Bonzini <pbonzini@redhat.com>
CC: Daniel P. Berrange <berrange@redhat.com>
Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
---
v6.1: New patch
---
 scripts/checkpatch.pl | 1 +
 1 file changed, 1 insertion(+)

Comments

Paolo Bonzini March 13, 2018, 3:11 p.m. UTC | #1
On 08/03/2018 20:02, Ian Jackson wrote:
> This avoids checkpatch misparsing (as statements) long function
> definitions or declarations, which sometimes start with constructs
> like this:
> 
>   static inline int xendevicemodel_relocate_memory(
>       xendevicemodel_handle *dmod, domid_t domid, ...
> 
> CC: Eric Blake <eblake@redhat.com>
> CC: Paolo Bonzini <pbonzini@redhat.com>
> CC: Daniel P. Berrange <berrange@redhat.com>
> Signed-off-by: Ian Jackson <Ian.Jackson@eu.citrix.com>
> ---
> v6.1: New patch
> ---
>  scripts/checkpatch.pl | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
> index d1fe79b..3e488f7 100755
> --- a/scripts/checkpatch.pl
> +++ b/scripts/checkpatch.pl
> @@ -266,6 +266,7 @@ our @typeList = (
>  	qr{target_(?:u)?long},
>  	qr{hwaddr},
>  	qr{xml${Ident}},
> +	qr{xendevicemodel_handle},
>  );
>  
>  # This can be modified by sub possible.  Since it can be empty, be careful
> -- 

Or just rename it so that it is CamelCase.  Then checkpatch will be happy.

Paolo
Ian Jackson March 26, 2018, 1:58 p.m. UTC | #2
Paolo Bonzini writes ("Re: [PATCH 01/12] checkpatch: Add xendevicemodel_handle to the list of types"):
> On 08/03/2018 20:02, Ian Jackson wrote:
> > This avoids checkpatch misparsing (as statements) long function
> > definitions or declarations, which sometimes start with constructs
> > like this:
> > 
> >   static inline int xendevicemodel_relocate_memory(
> >       xendevicemodel_handle *dmod, domid_t domid, ...
...
> 
> Or just rename it so that it is CamelCase.  Then checkpatch will be happy.

I can do that if you want, although it seems a bit like pointless
churn.  If I do that it ought to be renamed as well as re-spelled
because xendevicemodel_handle is actually a struct, not a "handle"
(ie, not a scalar).[1]  So
   s/xendevicemodel_handle/XendevicemodelInterface/
I guess ?

[1] If it were a scalar CODING_STYLE says it should be in lowercase
with _t.  This is a violation of the C standard, which reserves names
ending _t for the implementation...

Ian.
Ian Jackson April 19, 2018, 4:32 p.m. UTC | #3
Ian Jackson writes ("Re: [PATCH 01/12] checkpatch: Add xendevicemodel_handle to the list of types"):
> Paolo Bonzini writes ("Re: [PATCH 01/12] checkpatch: Add xendevicemodel_handle to the list of types"):
> > Or just rename it so that it is CamelCase.  Then checkpatch will be happy.
> 
> I can do that if you want,

No I can't, because it's from the Xen headers, not a qemu type.

I have added a note to the commit message for the checkpatch commit.

Ian.
diff mbox

Patch

diff --git a/scripts/checkpatch.pl b/scripts/checkpatch.pl
index d1fe79b..3e488f7 100755
--- a/scripts/checkpatch.pl
+++ b/scripts/checkpatch.pl
@@ -266,6 +266,7 @@  our @typeList = (
 	qr{target_(?:u)?long},
 	qr{hwaddr},
 	qr{xml${Ident}},
+	qr{xendevicemodel_handle},
 );
 
 # This can be modified by sub possible.  Since it can be empty, be careful