All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Daniel P. Smith" <dpsmith@apertussolutions.com>
To: Jan Beulich <jbeulich@suse.com>
Cc: Daniel De Graaf <dgdegra@tycho.nsa.gov>,
	Andrew Cooper <andrew.cooper3@citrix.com>,
	xen-devel@lists.xenproject.org
Subject: Re: [PATCH v4 04/11] xsm: apply coding style
Date: Tue, 7 Sep 2021 10:55:36 -0400	[thread overview]
Message-ID: <bf876f84-aa0f-faff-da63-0f0525087883@apertussolutions.com> (raw)
In-Reply-To: <e006dc60-7745-43b7-f725-2390e174bfa7@suse.com>

On 9/7/21 10:27 AM, Jan Beulich wrote:
> On 07.09.2021 16:09, Daniel P. Smith wrote:
>> On 9/7/21 9:50 AM, Jan Beulich wrote:
>>> On 07.09.2021 15:41, Daniel P. Smith wrote:
>>>> On 9/6/21 2:17 PM, Andrew Cooper wrote:
>>>>> On 03/09/2021 20:06, Daniel P. Smith wrote:
>>>>>> --- a/xen/include/xsm/dummy.h
>>>>>> +++ b/xen/include/xsm/dummy.h
>>>>>> @@ -69,8 +69,9 @@ void __xsm_action_mismatch_detected(void);
>>>>>>    
>>>>>>    #endif /* CONFIG_XSM */
>>>>>>    
>>>>>> -static always_inline int xsm_default_action(
>>>>>> -    xsm_default_t action, struct domain *src, struct domain *target)
>>>>>> +static always_inline int xsm_default_action(xsm_default_t action,
>>>>>> +                                            struct domain *src,
>>>>>> +                                            struct domain *target)
>>>>>
>>>>> The old code is correct.  We have plenty of examples of this in Xen, and
>>>>> I have been adding new ones when appropriate.
>>>>>
>>>>> It avoids squashing everything on the RHS and ballooning the line count
>>>>> to compensate.  (This isn't a particularly bad example, but we've had
>>>>> worse cases in the past).
>>>>
>>>> Based on the past discussions I understood either is acceptable and find
>>>> this version much easier to visually parse myself. With that said, if
>>>> the "next line single indent" really is the preferred style by the
>>>> maintainers/community, then I can convert all of these over.
>>>
>>> I guess neither is the "preferred" style; as Andrew says, both are
>>> acceptable and both are in active use. I guess the rule of thumb is:
>>> The longer what's left of the function name, the more you should
>>> consider the style that you change away from.
>>>
>>> Anyway, in the end I guess the request for style adjustments was
>>> mainly to purge bad style, not to convert one acceptable form to
>>> another. Converting the entire file to the same style is of course
>>> fine (for producing a consistent result), but then - as per above -
>>> here it would more likely be the one that in this case was already
>>> there.
>>
>> Understood, I will respin with all the function defs to align with the 
>> "next line single indent" style, though it would be helpful for 
>> clarification on this style exactly. Do you always wrap all args if one 
>> extends past 80 col or is there a rule for when some should remain on 
>> the first line (function def line)?
> 
> I don't think that aspect has been discussed. I would say
> 
> void sufficiently_long_attribute test(unsigned int x, unsigned int y,
>                                       unsigned int z, void *p);
> 
> is as acceptable as
> 
> void sufficiently_long_attribute test(unsigned int x,
>                                       unsigned int y,
>                                       unsigned int z,
>                                       void *p);
> 
> with a slight preference to the former.
> 
> Jan
> 

Apologies, I was referring to this style which I am understanding is a
little more preferred

void short_function_name(
    struct really_long__struct_name *x,
    struct really_long__struct_name *y, unsigned int z, void *p);

vs

void short_function_name(struct really_long__struct_name *x,
    struct really_long__struct_name *y, unsigned int z, void *p);


NB: I don't recall it off the top of my head, but there is one function
def in here that is similar to this situation

v/r,
dps


  reply	other threads:[~2021-09-07 14:56 UTC|newest]

Thread overview: 37+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-03 19:06 [PATCH v4 00/11] xsm: refactoring xsm hooks Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 01/11] xen: Implement xen/alternative-call.h for use in common code Daniel P. Smith
2021-09-06 15:52   ` Jan Beulich
2021-09-06 16:22     ` Andrew Cooper
2021-09-07  6:00       ` Jan Beulich
2021-09-07 13:07         ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 02/11] xsm: remove the ability to disable flask Daniel P. Smith
2021-09-06 17:56   ` Andrew Cooper
2021-09-03 19:06 ` [PATCH v4 03/11] xsm: drop dubious xsm_op_t type Daniel P. Smith
2021-09-06 18:00   ` Andrew Cooper
2021-09-03 19:06 ` [PATCH v4 04/11] xsm: apply coding style Daniel P. Smith
2021-09-06 18:17   ` Andrew Cooper
2021-09-07 13:41     ` Daniel P. Smith
2021-09-07 13:50       ` Jan Beulich
2021-09-07 14:09         ` Daniel P. Smith
2021-09-07 14:27           ` Jan Beulich
2021-09-07 14:55             ` Daniel P. Smith [this message]
2021-09-07 15:01               ` Jan Beulich
2021-09-03 19:06 ` [PATCH v4 05/11] xsm: refactor xsm_ops handling Daniel P. Smith
2021-09-06 18:31   ` Andrew Cooper
2021-09-07 13:44     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 06/11] xsm: convert xsm_ops hook calls to alternative call Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 07/11] xsm: decouple xsm header inclusion selection Daniel P. Smith
2021-09-06 18:47   ` Andrew Cooper
2021-09-07 13:52     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 08/11] xsm: drop generic event channel labeling exclusion Daniel P. Smith
2021-09-09 15:35   ` Jan Beulich
2021-09-09 16:44     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 09/11] silo: remove circular xsm hook call Daniel P. Smith
2021-09-06 18:55   ` Andrew Cooper
2021-09-07 14:00     ` Daniel P. Smith
2021-09-09 15:45   ` Jan Beulich
2021-09-09 19:14     ` Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 10/11] kconfig: update xsm config to reflect reality Daniel P. Smith
2021-09-03 19:06 ` [PATCH v4 11/11] xsm: remove alternate xsm hook interface Daniel P. Smith
2021-09-06 19:18   ` Andrew Cooper
2021-09-07 14:03     ` Daniel P. Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=bf876f84-aa0f-faff-da63-0f0525087883@apertussolutions.com \
    --to=dpsmith@apertussolutions.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=dgdegra@tycho.nsa.gov \
    --cc=jbeulich@suse.com \
    --cc=xen-devel@lists.xenproject.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.