* Re: [alsa-devel] [PATCH] ASoC: da7210: Minor update for PLL and SRM
2012-04-17 15:00 [PATCH] ASoC: da7210: Minor update for PLL and SRM Ashish Chavan
@ 2012-04-17 14:56 ` Mark Brown
2012-04-17 15:30 ` Ashish Chavan
0 siblings, 1 reply; 4+ messages in thread
From: Mark Brown @ 2012-04-17 14:56 UTC (permalink / raw)
To: Ashish Chavan
Cc: lrg, alsa-devel, David Dajun Chen, kuninori.morimoto.gx,
linux-kernel
[-- Attachment #1: Type: text/plain, Size: 296 bytes --]
On Tue, Apr 17, 2012 at 08:30:58PM +0530, Ashish Chavan wrote:
> + if ((fref == da7210_pll_div[cnt].fref) &&
> + (da7210->master == da7210_pll_div[cnt].mode) &&
> + (fout == da7210_pll_div[cnt].fout)) {
Since this is just a coding style thing how about lining up the (s for
the branches?
[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH] ASoC: da7210: Minor update for PLL and SRM
@ 2012-04-17 15:00 Ashish Chavan
2012-04-17 14:56 ` [alsa-devel] " Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Ashish Chavan @ 2012-04-17 15:00 UTC (permalink / raw)
To: Mark Brown, lrg, alsa-devel
Cc: linux-kernel, kuninori.morimoto.gx, David Dajun Chen
This patch converts multiple if conditions in to single if with "&&"s.
Signed-off-by: Ashish Chavan <ashish.chavan@kpitcummins.com>
Signed-off-by: David Dajun Chen <dchen@diasemi.com>
---
sound/soc/codecs/da7210.c | 22 +++++++++-------------
1 files changed, 9 insertions(+), 13 deletions(-)
diff --git a/sound/soc/codecs/da7210.c b/sound/soc/codecs/da7210.c
index cf4063b..d3ca28b 100644
--- a/sound/soc/codecs/da7210.c
+++ b/sound/soc/codecs/da7210.c
@@ -992,19 +992,15 @@ static int da7210_set_dai_pll(struct snd_soc_dai *codec_dai, int pll_id,
/* Search pll div array for correct divisors */
for (cnt = 0; cnt < ARRAY_SIZE(da7210_pll_div); cnt++) {
- /* check fref */
- if (fref == da7210_pll_div[cnt].fref) {
- /* check mode */
- if (da7210->master == da7210_pll_div[cnt].mode) {
- /* check fout */
- if (fout == da7210_pll_div[cnt].fout) {
- /* all match, pick up divisors */
- pll_div1 = da7210_pll_div[cnt].div1;
- pll_div2 = da7210_pll_div[cnt].div2;
- pll_div3 = da7210_pll_div[cnt].div3;
- break;
- }
- }
+ /* check fref, mode and fout */
+ if ((fref == da7210_pll_div[cnt].fref) &&
+ (da7210->master == da7210_pll_div[cnt].mode) &&
+ (fout == da7210_pll_div[cnt].fout)) {
+ /* all match, pick up divisors */
+ pll_div1 = da7210_pll_div[cnt].div1;
+ pll_div2 = da7210_pll_div[cnt].div2;
+ pll_div3 = da7210_pll_div[cnt].div3;
+ break;
}
}
if (cnt >= ARRAY_SIZE(da7210_pll_div))
--
1.7.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: da7210: Minor update for PLL and SRM
2012-04-17 15:30 ` Ashish Chavan
@ 2012-04-17 15:20 ` Mark Brown
0 siblings, 0 replies; 4+ messages in thread
From: Mark Brown @ 2012-04-17 15:20 UTC (permalink / raw)
To: Ashish Chavan
Cc: linux-kernel, alsa-devel, lrg, kuninori.morimoto.gx,
David Dajun Chen
[-- Attachment #1.1: Type: text/plain, Size: 425 bytes --]
On Tue, Apr 17, 2012 at 09:00:02PM +0530, Ashish Chavan wrote:
> To do that we will have to use spaces instead of tab for indentation. I
> am not sure if that is fine. You mean something like below, right?
> if ((fref == da7210_pll_div[cnt].fref) &&
> (da7210->master == da7210_pll_div[cnt].mode) &&
> (fout == da7210_pll_div[cnt].fout)) {
Yes, that's totally fine. 8 character tabs and spaces below that.
[-- Attachment #1.2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]
[-- Attachment #2: Type: text/plain, Size: 0 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] ASoC: da7210: Minor update for PLL and SRM
2012-04-17 14:56 ` [alsa-devel] " Mark Brown
@ 2012-04-17 15:30 ` Ashish Chavan
2012-04-17 15:20 ` Mark Brown
0 siblings, 1 reply; 4+ messages in thread
From: Ashish Chavan @ 2012-04-17 15:30 UTC (permalink / raw)
To: Mark Brown
Cc: alsa-devel, kuninori.morimoto.gx, linux-kernel, David, Chen, lrg
On Tue, 2012-04-17 at 15:56 +0100, Mark Brown wrote:
> On Tue, Apr 17, 2012 at 08:30:58PM +0530, Ashish Chavan wrote:
>
> > + if ((fref == da7210_pll_div[cnt].fref) &&
> > + (da7210->master == da7210_pll_div[cnt].mode) &&
> > + (fout == da7210_pll_div[cnt].fout)) {
>
> Since this is just a coding style thing how about lining up the (s for
> the branches?
To do that we will have to use spaces instead of tab for indentation. I
am not sure if that is fine. You mean something like below, right?
if ((fref == da7210_pll_div[cnt].fref) &&
(da7210->master == da7210_pll_div[cnt].mode) &&
(fout == da7210_pll_div[cnt].fout)) {
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2012-04-17 15:20 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-04-17 15:00 [PATCH] ASoC: da7210: Minor update for PLL and SRM Ashish Chavan
2012-04-17 14:56 ` [alsa-devel] " Mark Brown
2012-04-17 15:30 ` Ashish Chavan
2012-04-17 15:20 ` Mark Brown
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).