Lars-Peter Clausen
a8667a3f15
ALSA: trident: Use DIV_ROUND_CLOSEST() instead of open-coding it
...
Use DIV_ROUND_CLOSEST() instead of open-coding it. This documents intent
and makes it more clear what is going on for the casual reviewer.
Generated using the following the Coccinelle semantic patch.
// <smpl>
@@
expression x, y;
@@
-((x) + ((y) / 2)) / (y)
+DIV_ROUND_CLOSEST(x, y)
@r1@
expression x;
constant C1;
constant C2;
@@
((x) + C1) / C2
@script:python@
C1 << r1.C1;
C2 << r1.C2;
@@
try:
if int(C1) * 2 != int(C2):
cocci.include_match(False)
except:
cocci.include_match(False)
@@
expression r1.x;
constant r1.C1;
constant r1.C2;
@@
-(((x) + C1) / C2)
+DIV_ROUND_CLOSEST(x, C2)
// </smpl>
Signed-off-by: Lars-Peter Clausen <lars@metafoo.de>
Link: https://lore.kernel.org/r/20201223172229.781-15-lars@metafoo.de
Signed-off-by: Takashi Iwai <tiwai@suse.de>
2020-12-25 09:11:55 +01:00
..
2020-07-20 10:10:47 +02:00
2020-02-10 08:29:54 +01:00
2020-12-25 09:11:48 +01:00
2020-07-09 19:10:43 +02:00
2020-07-07 12:05:14 +02:00
2020-08-25 09:27:49 +02:00
2020-12-25 09:11:49 +01:00
2020-01-03 09:24:28 +01:00
2020-12-25 09:11:49 +01:00
2020-08-13 11:21:05 +02:00
2020-12-25 09:11:51 +01:00
2020-12-23 15:28:29 +01:00
2020-08-06 09:30:02 +02:00
2020-07-07 12:10:21 +02:00
2020-12-25 09:11:52 +01:00
2020-01-05 16:15:07 +01:00
2020-11-19 18:26:30 +01:00
2020-07-15 14:31:56 +02:00
2020-08-06 09:30:02 +02:00
2020-01-05 16:14:47 +01:00
2020-09-09 18:34:10 +02:00
2020-11-21 09:29:25 +01:00
2020-12-25 09:11:55 +01:00
2020-01-05 16:14:30 +01:00
2020-07-09 13:01:29 +02:00
2020-01-03 09:24:13 +01:00
2017-11-02 11:10:55 +01:00
2020-01-05 16:15:09 +01:00
2020-01-03 09:24:13 +01:00
2019-12-11 07:25:31 +01:00
2020-01-05 16:14:54 +01:00
2020-07-09 13:01:29 +02:00
2020-07-09 13:01:29 +02:00
2017-11-02 11:10:55 +01:00
2020-12-25 09:11:48 +01:00
2020-01-05 16:14:55 +01:00
2020-01-05 16:15:10 +01:00
2020-01-03 09:23:56 +01:00
2020-01-05 16:15:11 +01:00
2020-07-07 12:11:59 +02:00
2020-07-15 14:31:55 +02:00
2020-07-07 12:12:21 +02:00
2020-07-15 14:31:56 +02:00
2020-01-05 16:14:31 +01:00
2019-10-07 03:53:03 +02:00
2020-01-03 09:24:45 +01:00
2017-11-02 11:10:55 +01:00
2020-10-26 15:27:13 +01:00
2020-01-28 16:26:57 -08:00
2020-01-28 16:26:57 -08:00
2019-06-05 17:30:30 +02:00
2020-12-25 09:11:55 +01:00
2020-07-07 12:12:38 +02:00
2020-07-15 14:31:57 +02:00