Coccinelle archive on lore.kernel.org
 help / color / Atom feed
From: Markus Elfring <Markus.Elfring@web.de>
To: Julia Lawall <julia.lawall@lip6.fr>
Cc: Coccinelle <cocci@systeme.lip6.fr>
Subject: Re: [Cocci] Pretty-printing of code for ternary operators?
Date: Thu, 4 Jul 2019 14:05:57 +0200
Message-ID: <a6e7d5b8-9309-0a23-f7dd-48a1dd7d10be@web.de> (raw)
In-Reply-To: <alpine.DEB.2.20.1907041343250.3517@hadrien>

>> elfring@Sonne:~/Projekte/Coccinelle/Probe> spatch ../janitor/use_call_with_ternary_operator1.cocci ksm-excerpt1.c
>> …
>> +	list_add_tail(&mm_slot->mm_list,
>> +		      (ksm_run & KSM_RUN_UNMERGE) ? &ksm_mm_head.mm_list : &ksm_scan.mm_slot->mm_list);
>
> And this is unsatisfactory because why?

Such a transformation result could be acceptable if the generated line length
would be tolerated.
But the second function parameter should be reformatted if we would like to care
for the Linux coding style in such an use case finally.


> I don't think ? should be used if it is going to end up over multiple lines.

I got an other software development opinion.


> In any case, I already commented that you proposed code was unreadable.

I am also curious on how the clarification for a patch on a topic like
“NFS: Less function calls in show_pnfs()” will evolve further.
https://lore.kernel.org/patchwork/patch/1096614/#1293018
https://lore.kernel.org/lkml/ed599239-a6a2-1cc6-14ce-d5bb41e9170f@web.de/
https://lkml.org/lkml/2019/7/3/173

Regards,
Markus
_______________________________________________
Cocci mailing list
Cocci@systeme.lip6.fr
https://systeme.lip6.fr/mailman/listinfo/cocci

      parent reply index

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-07-04  7:33 Markus Elfring
     [not found] ` <alpine.DEB.2.20.1907041233010.3517@hadrien>
2019-07-04 11:40   ` Markus Elfring
     [not found]     ` <alpine.DEB.2.20.1907041343250.3517@hadrien>
2019-07-04 12:05       ` Markus Elfring [this message]

Reply instructions:

You may reply publically 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=a6e7d5b8-9309-0a23-f7dd-48a1dd7d10be@web.de \
    --to=markus.elfring@web.de \
    --cc=cocci@systeme.lip6.fr \
    --cc=julia.lawall@lip6.fr \
    /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

Coccinelle archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/cocci/0 cocci/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 cocci cocci/ https://lore.kernel.org/cocci \
		cocci@systeme.lip6.fr cocci@archiver.kernel.org
	public-inbox-index cocci


Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/fr.lip6.systeme.cocci


AGPL code for this site: git clone https://public-inbox.org/ public-inbox