-
Notifications
You must be signed in to change notification settings - Fork 366
More cosmetic fixes and clean up #1025
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
81df174
0e0e650
efc6600
8efa113
8fe531f
71e50f9
7969661
3e71493
c8a0441
f03667d
21a0219
58fed5c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -383,14 +383,11 @@ static void find_modes(struct decim_modes *modes, uint32_t fs, int di) | |
| * is possible. Then check that CIC decimation constraints | ||
| * are met. The passed decimation modes are added to array. | ||
| */ | ||
| j = 0; | ||
| /* Loop until NULL */ | ||
| while (fir_list[j]) { | ||
| for (j = 0; fir_list[j]; j++) { | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I suppose this works but what is the improvement?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I find better than |
||
| mfir = fir_list[j]->decim_factor; | ||
| j++; | ||
|
|
||
| /* Skip if previous decimation factor was the same */ | ||
| if (j > 2 && fir_list[j - 2]->decim_factor == mfir) | ||
| if (j > 1 && fir_list[j - 1]->decim_factor == mfir) | ||
| continue; | ||
|
|
||
| mcic = osr / mfir; | ||
|
|
@@ -404,11 +401,12 @@ static void find_modes(struct decim_modes *modes, uint32_t fs, int di) | |
| modes->mcic[i] = mcic; | ||
| modes->mfir[i] = mfir; | ||
| i++; | ||
| modes->num_of_modes = i; | ||
| } | ||
|
|
||
| } | ||
| } | ||
|
|
||
| modes->num_of_modes = i; | ||
|
|
||
| #if defined MODULE_TEST | ||
| printf("# Found %d modes\n", i); | ||
| #endif | ||
|
|
@@ -1239,7 +1237,7 @@ static int dmic_set_config(struct dai *dai, struct sof_ipc_dai_config *config) | |
| cfg.clkdiv, cfg.mcic); | ||
| trace_dmic("dmic_set_config(), cfg mfir_a = %u, mfir_b = %u", | ||
| cfg.mfir_a, cfg.mfir_b); | ||
| trace_dmic("dmic_set_config(), cfg cic_shift = %u", cfg.cic_shift) | ||
| trace_dmic("dmic_set_config(), cfg cic_shift = %u", cfg.cic_shift); | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. No wonder indenting in editor has behaved strange. Thanks! |
||
| trace_dmic("dmic_set_config(), cfg fir_a_shift = %u, " | ||
| "cfg.fir_b_shift = %u", cfg.fir_a_shift, cfg.fir_b_shift); | ||
| trace_dmic("dmic_set_config(), cfg fir_a_length = %u, " | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -35,8 +35,16 @@ | |
|
|
||
| #include <stdint.h> | ||
|
|
||
| #define MIN(a, b) (((a) < (b)) ? (a) : (b)) | ||
| #define MAX(a, b) (((a) > (b)) ? (a) : (b)) | ||
| #define MIN(a, b) ({ \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm curious, why is this better?
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. if you have MIN(x++, y), then with the first version you'd get i.e. you'd have x incremented twice. With the second version you'd correctly have it incremented once. Same for any MIN(f(x), y) - f(x) would be called twice with the first version. |
||
| typeof(a) __a = (a); \ | ||
| typeof(b) __b = (b); \ | ||
| __a > __b ? __b : __a; \ | ||
| }) | ||
| #define MAX(a, b) ({ \ | ||
| typeof(a) __a = (a); \ | ||
| typeof(b) __b = (b); \ | ||
| __a < __b ? __b : __a; \ | ||
| }) | ||
|
|
||
| int gcd(int a, int b); /* Calculate greatest common divisor for a and b */ | ||
|
|
||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.