lkml.org 
[lkml]   [2007]   [Aug]   [30]   [last100]   RSS Feed
Views: [more markup]  [less markup]  [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
DateThu, 30 Aug 2007 12:36:12 +0200
From andre@finow14 ...
Subject[KJ][patch 1/3] IDT77252: use abs() from kernel.h where appropriate
From: Andre Haupt <andre@finow14.de>
Signed-off-by: Andre Haupt <andre@finow14.de>
---
Index: linus/drivers/atm/idt77252.c
===================================================================
--- linus.orig/drivers/atm/idt77252.c	2007-08-30 11:33:22.000000000 +0200
+++ linus/drivers/atm/idt77252.c	2007-08-30 11:37:00.000000000 +0200
@@ -2092,7 +2092,7 @@ idt77252_rate_logindex(struct idt77252_d
 {
 	u16 afp;
 
-	afp = idt77252_int_to_atmfp(pcr < 0 ? -pcr : pcr);
+	afp = idt77252_int_to_atmfp(abs(pcr));
 	if (pcr < 0)
 		return rate_to_log[(afp >> 5) & 0x1ff];
 	return rate_to_log[((afp >> 5) + 1) & 0x1ff];
@@ -2149,7 +2149,7 @@ idt77252_init_est(struct vc_map *vc, int
 	est = kzalloc(sizeof(struct rate_estimator), GFP_KERNEL);
 	if (!est)
 		return NULL;
-	est->maxcps = pcr < 0 ? -pcr : pcr;
+	est->maxcps = abs(pcr);
 	est->cps = est->maxcps;
 	est->avcps = est->cps << 5;
 
--
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-08-30 12:43    [from the cache]
©2003-2008