From: Luis de Bethencourt <luisbg@ubuntu.com>
To: Sven Eckelmann <sven.eckelmann@gmx.de>,
Marek Lindner <lindner_marek@yahoo.de>
Cc: b.a.t.m.a.n@lists.open-mesh.org
Subject: Re: [B.A.T.M.A.N.] [PATCH 4/4] Staging: batman-adv: fix whitespace style issues
Date: Sun, 4 Apr 2010 13:39:49 +0100 [thread overview]
Message-ID: <g2o506b70dc1004040539weff4c04akcbde4ef62dcdaeb@mail.gmail.com> (raw)
In-Reply-To: <201004041330.37112.sven.eckelmann@gmx.de>
On Sun, Apr 4, 2010 at 12:30 PM, Sven Eckelmann <sven.eckelmann@gmx.de> wrote:
> On Sunday 04 April 2010 13:10:12 you wrote:
>
>> Thanks a lot for the help Sven.
>>
>> My patch didn't include changes to bat_sysfs.c, where are this changes
>> coming from? Sorry if I'm missing something obvious.
>
> Correct, that was part of the redoing of your changes. bat_sysfs.c is only
> part of the current development version and not in your patch (you still had
> the /proc stuff).
>
> But maybe you could explain to Marek why it is important/correct/good/... to
> have no whitespaces before \n or if the part for /proc or /sys files can be
> ignored.
>
> Best regards,
> Sven
>
I saw the bat_sysfs.c in the redoing of the changes. It is OK with me.
IMHO a whitespace before a \n is unneccesary, since it is a blank
character at the end of the line. Like adding a 0 at the left of a
number.
The obvious minor issue to try and avoid is space since having a big
number of these can bloat slightly the size of code/kernel. But the
whitespace can create other bigger issues, an example is when the
whitespace coincidentally falls one character out of the length of the
terminal, this will screw up the line break formatting in an ugly way.
I think these are the reasons why the coding style guidelines of the
Linux Kernel ask to avoid these whitespaces. Which also means removing
this helps the consistency of the kernel's code.
> Marek wrote:
> The whitespaces in bat_sysfs.c after the "commands" string are intentional.
> Userspace applications can simply split the string after each whitespace. Of
> course, it can be done differently but it only "costs" us a whitespace. I was
> not aware this would be an issue. Can we keep it or should we change e.g.
> batctl ?
Honestly, I don't understand the intention of the whitespaces you are
talking about. Userspace applications have to split the string after
each whitespace because there is a \n there, my fix just suggested to
split the line before the whitespace since I see no need for it.
So am I missunderstanding and there is a need for that whitespace?
Same question asked differently: Will there be any difference in the
print out if the line is broken before the whitespace instead of
after?
If so, please show me an example :)
Luis
next prev parent reply other threads:[~2010-04-04 12:39 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <batman-adv>
[not found] ` <1270341625-28764-1-git-send-email-luisbg@ubuntu.com>
2010-04-04 1:12 ` [B.A.T.M.A.N.] [PATCH 4/4] Staging: batman-adv: fix whitespace style issues Sven Eckelmann
2010-04-04 1:24 ` [B.A.T.M.A.N.] [PATCHv2-maint] " Sven Eckelmann
2010-04-04 17:09 ` Marek Lindner
2010-04-04 17:51 ` Luis de Bethencourt
2010-04-04 1:44 ` [B.A.T.M.A.N.] [PATCHv2-trunk] " Sven Eckelmann
2010-04-04 2:48 ` Marek Lindner
2010-04-04 16:33 ` [B.A.T.M.A.N.] [PATCH] batctl: Parse allowed settings for sysfs without whitespace before newline Sven Eckelmann
2010-04-06 5:33 ` Marek Lindner
2010-04-04 1:45 ` [B.A.T.M.A.N.] [PATCH 4/4] Staging: batman-adv: fix whitespace style issues Luis de Bethencourt
2010-04-04 10:46 ` Sven Eckelmann
2010-04-04 11:10 ` Luis de Bethencourt
2010-04-04 11:30 ` Sven Eckelmann
2010-04-04 12:39 ` Luis de Bethencourt [this message]
2010-04-04 14:42 ` Marek Lindner
2010-04-04 15:02 ` Luis de Bethencourt
2010-04-04 15:14 ` Sven Eckelmann
2010-04-04 15:19 ` Luis de Bethencourt
2010-04-04 13:56 ` Andrew Lunn
2010-04-04 14:56 ` Luis de Bethencourt
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=g2o506b70dc1004040539weff4c04akcbde4ef62dcdaeb@mail.gmail.com \
--to=luisbg@ubuntu.com \
--cc=b.a.t.m.a.n@lists.open-mesh.org \
--cc=lindner_marek@yahoo.de \
--cc=sven.eckelmann@gmx.de \
/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