public inbox for linux-bluetooth@vger.kernel.org
 help / color / mirror / Atom feed
From: Siarhei Siamashka <siarhei.siamashka@nokia.com>
To: BlueZ development <linux-bluetooth@vger.kernel.org>
Subject: Bluez coding style again
Date: Sat, 17 Jan 2009 19:43:45 +0200	[thread overview]
Message-ID: <200901171943.45370.siarhei.siamashka@nokia.com> (raw)

Hi,

> commit 1fb5ffff0b704038a90e03860ecce63be2deb988
> Author: Johan Hedberg <johan.hedberg@nokia.com>
> Date:   Fri Jan 16 20:29:43 2009 +0200
>
>     Fix indentation to use only tabs
>
> --- a/sbc/sbc_tables.h
> +++ b/sbc/sbc_tables.h
> @@ -161,30 +161,30 @@ static const int32_t synmatrix8[16][8] = {
>         ((FIXED_A) 1 << (sizeof(FIXED_T) * CHAR_BIT - 1)) + 0.5)
>  #define F(x) F_PROTO4(x)
>  static const FIXED_T _sbc_proto_fixed4[40] = {
> -        F(0.00000000E+00),  F(5.36548976E-04),
> +       F(0.00000000E+00),  F(5.36548976E-04),
>         -F(1.49188357E-03),  F(2.73370904E-03),
> -        F(3.83720193E-03),  F(3.89205149E-03),
> -        F(1.86581691E-03),  F(3.06012286E-03),
> +       F(3.83720193E-03),  F(3.89205149E-03),
> +       F(1.86581691E-03),  F(3.06012286E-03),

With this latest commit, the vertical alignment of elements in tables gets
messed up and it becomes harder to see any kind of symmetry in the tables.
If the spaces are strictly forbidden, I would probably prefer replacing them
with '+' character.

Anyway, with this requirement also in effect, it makes harder to use the
standard 'checkpatch.pl' from linux distribution as you have to watch for
a lot more stuff which can get through.

Adding --strict option to 'checkpatch.pl' only also reports something like:

CHECK: multiple assignments should be avoided
#623: FILE: sbc/sbc_primitives.c:381:
+       x[159] = x[31] = pcm[0 + 2];

CHECK: architecture specific defines should be avoided
#475: FILE: sbc/sbc_primitives_mmx.h:31:
+#if defined(__GNUC__) && (defined(__i386__) || defined(__amd64__)) && \


I have learned the following extra bluez coding style requirements over the
standard linux coding style up to now:
1. Space is required for cast operation, ex. '(int) x'
2. Indentation between '#' and 'define' is forbidden
3. Any kind of leading spaces are forbidden

Have I missed something else?

Anyway, does it make sense to introduce a modified variant of 'checkpatch.pl'?
Or probably somebody has done it already, but did not care to share with
everyone else? :)


Best regards,
Siarhei Siamashka

             reply	other threads:[~2009-01-17 17:43 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-01-17 17:43 Siarhei Siamashka [this message]
2009-01-18 15:08 ` Bluez coding style again Marcel Holtmann
2009-01-20 16:48   ` Siarhei Siamashka
2009-01-21 11:21     ` Marcel Holtmann
2009-01-22 15:59       ` Siarhei Siamashka
2009-01-23  1:01         ` Marcel Holtmann

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=200901171943.45370.siarhei.siamashka@nokia.com \
    --to=siarhei.siamashka@nokia.com \
    --cc=linux-bluetooth@vger.kernel.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox