All of lore.kernel.org
 help / color / mirror / Atom feed
From: Knut Petersen <Knut_Petersen@t-online.de>
To: Takashi Iwai <tiwai@suse.de>
Cc: alsa-devel@alsa-project.org, Clemens Ladisch <clemens@ladisch.de>
Subject: Re: [PATCH] rme96 synchronization support
Date: Tue, 13 Aug 2013 12:32:12 +0200	[thread overview]
Message-ID: <520A0B2C.7060500@t-online.de> (raw)
In-Reply-To: <s5h61vacb25.wl%tiwai@suse.de>

On 13.08.2013 09:19, Takashi Iwai wrote:
> Well, looking at rme96.c, the rme96 driver code can be cleaned up and
> lots of redundant checks can be reduced, then the sync-support patch
> will be the half size.  For example, it's almost useless to check
> RME96_ISPLAYING() in trigger, or doing in close or prepare callback.
> (It's still valid to do it in snd_rme96_create(), though, since the
>   register values are unknown at the first initialization state,
>   though.)
>
> But it's no serious problem, and we can live with the current code.
> So the only problem is the coding-style issues in your patch.

Ok, I admit that I never used scripts/checkpatch.pl ;-) Alsa, feeding the current
rme96.c code to scripts/checkpatch.pl gives  235 errors and 205 warnings:

99 * ERROR: trailing whitespace
88 * ERROR: code indent should use tabs where possible
76 * WARNING: please, no spaces at the start of a line
72 * WARNING: line over 80 characters
39 * WARNING: braces {} are not necessary for single statement blocks
21 * ERROR: do not use assignment in if condition
18 * ERROR: that open brace { should be on the previous line
13 * WARNING: braces {} are not necessary for any arm of this statement
8 * ERROR: space required after that ',' (ctx:VxV)
3 * WARNING: quoted string split across lines
1 * ERROR: space prohibited after that '!' (ctx:BxW)
1 * WARNING: Use #include <linux/io.h> instead of <asm/io.h>
1 * WARNING: Avoid CamelCase: <snd_BUG>

Comments to the list of errors and warnings:

The CamelCase snd_BUG() isn´t a problem of rme96.c.

I don´t agree that code like "if ((err = pci_request_regions(pci, "RME96")) < 0)"
is a problem.

I don´t agree with the script that lines over 80 characters are _always_ a problem.

Nevertheless, I really don´t like code alternating between different styles, that´s the reason
for some unnecessary braces {} I used in the submitted patches.

So I suggest that I will (re)submit three patches:
- first a patch cleaning the current rme96.c source
- the PM and SYNC patches based on the first patch.

After that additional patches removing useless checks, etc could follow. But this
should be patch 4(+) as it´s not always obvious for me if a check is really useless.

Do you agree?

cu,
  Knut

  reply	other threads:[~2013-08-13 10:32 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-08-05 12:36 [PATCH] rme96 synchronization support Knut Petersen
2013-08-05 13:18 ` Clemens Ladisch
2013-08-06 17:42   ` Knut Petersen
2013-08-07  7:08     ` Takashi Iwai
2013-08-08 10:52       ` Knut Petersen
2013-08-13  7:19         ` Takashi Iwai
2013-08-13 10:32           ` Knut Petersen [this message]
2013-08-13 10:37             ` Takashi Iwai
2013-08-13 21:12               ` [PATCH] rme96 add stream synchronization and PM support Knut Petersen
2013-08-14 15:06                 ` Takashi Iwai
2013-08-15  6:01                   ` Knut Petersen
2013-08-15  6:22                     ` Takashi Iwai
2013-08-15  7:16                       ` Knut Petersen
2013-08-15  8:37                         ` Takashi Iwai
2013-08-21  7:44                           ` Knut Petersen
2013-08-22  8:53                             ` Takashi Iwai
     [not found]                               ` <52160CDE.4070306@t-online.de>
2013-08-22 21:25                                 ` [PATCH] rme96 Add missing vmalloc.h inclusion Takashi Iwai

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=520A0B2C.7060500@t-online.de \
    --to=knut_petersen@t-online.de \
    --cc=alsa-devel@alsa-project.org \
    --cc=clemens@ladisch.de \
    --cc=tiwai@suse.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 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.