On 16.05.25 05:23, Zhao Liu wrote:
On Thu, May 15, 2025 at 05:11:56PM +0100, Daniel P. Berrangé wrote:
Date: Thu, 15 May 2025 17:11:56 +0100
From: "Daniel P. Berrangé" <berra...@redhat.com>
Subject: Re: [PATCH 8/9] target/s390x/kvm/pv: Consolidate
OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES
On Thu, May 15, 2025 at 05:41:40PM +0200, BALATON Zoltan wrote:
On Thu, 15 May 2025, Zhao Liu wrote:
On Wed, May 14, 2025 at 06:24:03PM +0200, BALATON Zoltan wrote:
Date: Wed, 14 May 2025 18:24:03 +0200
From: BALATON Zoltan <bala...@eik.bme.hu>
Subject: Re: [PATCH 8/9] target/s390x/kvm/pv: Consolidate
OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES
On Wed, 14 May 2025, Zhao Liu wrote:
+OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES(S390PVGuest,
+ s390_pv_guest,
+ S390_PV_GUEST,
+ CONFIDENTIAL_GUEST_SUPPORT,
+ { TYPE_USER_CREATABLE },
+ { NULL })
I'll note that existing callers of OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES
happily ignore the line limit and put it into a single line.
(which ends up looking better IMHO)
Ok, I'll onor the existing conventions (which I'll apply to other
patches as well).
There are two line limits. If something is clearer on one line you could
exceed the normal 80 chars and put up to 90 chars on one line for which
checkpatch will issue a warning that can be ignored for these cases. Over 90
lines checkpatch will give an error and I think you should not ignore that.
Thank you. This makes sense!
Maybe try to put as much on one line as possible instead of new line after
each argument but without exceeding the 80 chars or if the whole line fits
in 90 chars then use that. Or maybe do not indent second line under ( but
with 4 spaces then you can fit it in two lines but lines over 90 chars are
undesirable.
HMM, I understand you mean:
OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES(S390PVGuest, s390_pv_guest,
S390_PV_GUEST, CONFIDENTIAL_GUEST_SUPPORT, { TYPE_USER_CREATABLE }, { NULL
})
The second line is 82 chars and now I think this version is better.
Yes and maybe can even fit in 80 chars if using { } instead of { NULL }.
Personally, once you have to break the line, I would be inclined
to have *nothing* after the '(' on the first line, and then break
at the list of interfaces. ie
OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES(
S390PVGuest, s390_pv_guest, S390_PV_GUEST, CONFIDENTIAL_GUEST_SUPPORT,
{ TYPE_USER_CREATABLE }, { NULL })
This version looks better! Thank you all for your patience.
(How to elegantly break lines is indeed a matter of taste, and I've
improved in this area now with your help :-).)
Sorry for starting this :) And thanks for your patience.
Back when I added a OBJECT_DEFINE_SIMPLE_TYPE_WITH_INTERFACES, I did it
just like everybody else:
Cram it all into a single line because it's all unbelievable unreadable
already, no need to fake that breaking lines would improve that in any
way ...
--
Cheers,
David / dhildenb