linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Geert Uytterhoeven <geert@linux-m68k.org>
To: Michal Simek <michal.simek@xilinx.com>
Cc: Max Filippov <jcmvbkbc@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Michal Simek <monstr@monstr.eu>,
	git@xilinx.com, Arnd Bergmann <arnd@arndb.de>,
	Andrew Morton <akpm@linux-foundation.org>,
	Stefan Asserhall <stefan.asserhall@xilinx.com>,
	Chris Zankel <chris@zankel.net>,
	"David S. Miller" <davem@davemloft.net>,
	Fenghua Yu <fenghua.yu@intel.com>, Helge Deller <deller@gmx.de>,
	Ivan Kokshaysky <ink@jurassic.park.msu.ru>,
	"James E.J. Bottomley" <James.Bottomley@hansenpartnership.com>,
	Matt Turner <mattst88@gmail.com>, Rich Felker <dalias@libc.org>,
	Richard Henderson <rth@twiddle.net>,
	Tony Luck <tony.luck@intel.com>,
	Yoshinori Sato <ysato@users.sourceforge.jp>,
	"open list:ALPHA PORT" <linux-alpha@vger.kernel.org>,
	"open list:IA64 (Itanium) PL..." <linux-ia64@vger.kernel.org>,
	"open list:M68K ARCHITECTURE" <linux-m68k@lists.linux-m68k.org>,
	"open list:PARISC ARCHITECTURE" <linux-parisc@vger.kernel.org>,
	"open list:SUPERH" <linux-sh@vger.kernel.org>,
	"open list:TENSILICA XTENSA PORT (xtensa)" 
	<linux-xtensa@linux-xtensa.org>,
	"open list:SPARC + UltraSPAR..." <sparclinux@vger.kernel.org>
Subject: Re: [PATCH v2] asm-generic: Fix unistd_32.h generation format
Date: Wed, 12 Feb 2020 10:57:39 +0100	[thread overview]
Message-ID: <CAMuHMdXQqEYsL4KfDb4EkS+P+6qW=E4m3wunx_LXZddXVZMd4g@mail.gmail.com> (raw)
In-Reply-To: <d93646fa-c844-693c-07a7-7075d0fcf2c9@xilinx.com>

Hi Michal,

On Wed, Feb 12, 2020 at 10:42 AM Michal Simek <michal.simek@xilinx.com> wrote:
> On 12. 02. 20 10:40, Geert Uytterhoeven wrote:
> > On Wed, Feb 12, 2020 at 10:38 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >> On 12. 02. 20 10:32, Geert Uytterhoeven wrote:
> >>> On Wed, Feb 12, 2020 at 10:27 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>> On 12. 02. 20 10:25, Geert Uytterhoeven wrote:
> >>>>> On Wed, Feb 12, 2020 at 10:23 AM Max Filippov <jcmvbkbc@gmail.com> wrote:
> >>>>>> On Wed, Feb 12, 2020 at 1:16 AM Michal Simek <michal.simek@xilinx.com> wrote:
> >>>>>>>
> >>>>>>> Generated files are also checked by sparse that's why add newline
> >>>>>>> to remove sparse (C=1) warning.
> >>>>>>>
> >>>>>>> The issue was found on Microblaze and reported like this:
> >>>>>>> ./arch/microblaze/include/generated/uapi/asm/unistd_32.h:438:45:
> >>>>>>> warning: no newline at end of file
> >>>>>>>
> >>>>>>> Signed-off-by: Michal Simek <michal.simek@xilinx.com>
> >>>>>>> Reviewed-by: Stefan Asserhall <stefan.asserhall@xilinx.com>
> >>>>>
> >>>>>>> --- a/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>>>> +++ b/arch/m68k/kernel/syscalls/syscallhdr.sh
> >>>>>>> @@ -33,4 +33,5 @@ grep -E "^[0-9A-Fa-fXx]+[[:space:]]+${my_abis}" "$in" | sort -n | (
> >>>>>>>         printf "#endif\n"
> >>>>>>>         printf "\n"
> >>>>>>>         printf "#endif /* %s */\n" "${fileguard}"
> >>>>>>
> >>>>>> Here there's already \n at the end, so no need for another one?
> >>>>>
> >>>>> Thanks! I completely missed that.
> >>>>> So I did fix the original while applying ;-)
> >>>>
> >>>> I can drop m68k or align with with others. I would prefer to have the
> >>>> same solution in all these scripts.
> >>>
> >>> Yeah, it makes sense to align as much as possible.
> >>> IIRC, the original plan was to consolidate more later.
> >>>
> >>> Note that all other lines are terminated with a "\n" at the end.
> >>> The separate 'printf "\n"' is an extra blank line, not the terminator for the
> >>> previous line.
> >>
> >> Should we also get rid of 'printf "\n"' lines or just keep them as they
> >> are today?
> >
> > Usually there is a blank line above the include guard terminator, so IMHO
> > it makes sense to have that in generated files, too.
>
> I meant more not to get rid of \n just include them in current prints.
> It means like this 'printf "\n#endif /* %s */\n" "${fileguard}"'

I think having a "\n" at the start of a string makes the code harder to read.

You could move it to the end of the previous string, but that is not always
possible (e.g. after the loop), so I'd keep the separate prints for blank
lines.

Gr{oetje,eeting}s,

                        Geert

-- 
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org

In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
                                -- Linus Torvalds

  reply	other threads:[~2020-02-12  9:57 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-12  9:16 [PATCH v2] asm-generic: Fix unistd_32.h generation format Michal Simek
2020-02-12  9:23 ` Geert Uytterhoeven
2020-02-12  9:23 ` Max Filippov
2020-02-12  9:25   ` Geert Uytterhoeven
2020-02-12  9:27     ` Michal Simek
2020-02-12  9:32       ` Geert Uytterhoeven
2020-02-12  9:37         ` Michal Simek
2020-02-12  9:40           ` Geert Uytterhoeven
2020-02-12  9:42             ` Michal Simek
2020-02-12  9:57               ` Geert Uytterhoeven [this message]
2020-02-12  9:26   ` Michal Simek

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='CAMuHMdXQqEYsL4KfDb4EkS+P+6qW=E4m3wunx_LXZddXVZMd4g@mail.gmail.com' \
    --to=geert@linux-m68k.org \
    --cc=James.Bottomley@hansenpartnership.com \
    --cc=akpm@linux-foundation.org \
    --cc=arnd@arndb.de \
    --cc=chris@zankel.net \
    --cc=dalias@libc.org \
    --cc=davem@davemloft.net \
    --cc=deller@gmx.de \
    --cc=fenghua.yu@intel.com \
    --cc=git@xilinx.com \
    --cc=ink@jurassic.park.msu.ru \
    --cc=jcmvbkbc@gmail.com \
    --cc=linux-alpha@vger.kernel.org \
    --cc=linux-ia64@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-m68k@lists.linux-m68k.org \
    --cc=linux-parisc@vger.kernel.org \
    --cc=linux-sh@vger.kernel.org \
    --cc=linux-xtensa@linux-xtensa.org \
    --cc=mattst88@gmail.com \
    --cc=michal.simek@xilinx.com \
    --cc=monstr@monstr.eu \
    --cc=rth@twiddle.net \
    --cc=sparclinux@vger.kernel.org \
    --cc=stefan.asserhall@xilinx.com \
    --cc=tony.luck@intel.com \
    --cc=ysato@users.sourceforge.jp \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).