summaryrefslogtreecommitdiff
path: root/drivers/media/common
diff options
context:
space:
mode:
authorFabian Frederick <fabf@skynet.be>2015-06-10 19:32:41 +0300
committerMauro Carvalho Chehab <mchehab@osg.samsung.com>2015-07-06 14:25:49 +0300
commit2bb00da1484073342a1f3e9f846ac0ad8dc6314d (patch)
tree37eee08d9326b6353a546bd74d528def68c47bdf /drivers/media/common
parent453f847ef2e445a7b1fe6cbe35d36a06c60f58a5 (diff)
downloadlinux-2bb00da1484073342a1f3e9f846ac0ad8dc6314d.tar.xz
[media] saa7146: use swap() in sort_and_eliminate()
Use kernel.h macro definition. Thanks to Julia Lawall for Coccinelle scripting support. Signed-off-by: Fabian Frederick <fabf@skynet.be> Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@osg.samsung.com>
Diffstat (limited to 'drivers/media/common')
-rw-r--r--drivers/media/common/saa7146/saa7146_hlp.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/drivers/media/common/saa7146/saa7146_hlp.c b/drivers/media/common/saa7146/saa7146_hlp.c
index be746d1aee9a..3dc6a838ca6f 100644
--- a/drivers/media/common/saa7146/saa7146_hlp.c
+++ b/drivers/media/common/saa7146/saa7146_hlp.c
@@ -307,7 +307,7 @@ static int calculate_v_scale_registers(struct saa7146_dev *dev, enum v4l2_field
/* simple bubble-sort algorithm with duplicate elimination */
static int sort_and_eliminate(u32* values, int* count)
{
- int low = 0, high = 0, top = 0, temp = 0;
+ int low = 0, high = 0, top = 0;
int cur = 0, next = 0;
/* sanity checks */
@@ -318,11 +318,8 @@ static int sort_and_eliminate(u32* values, int* count)
/* bubble sort the first @count items of the array @values */
for( top = *count; top > 0; top--) {
for( low = 0, high = 1; high < top; low++, high++) {
- if( values[low] > values[high] ) {
- temp = values[low];
- values[low] = values[high];
- values[high] = temp;
- }
+ if( values[low] > values[high] )
+ swap(values[low], values[high]);
}
}