* [KJ][patch 1/3] IDT77252: use abs() from kernel.h where appropriate
[not found] <20070830102551.131398783@finow14.de>
@ 2007-08-30 10:36 ` andre
2007-08-30 10:37 ` [KJ][patch 2/3] CIFS SMB: " andre
2007-08-30 10:40 ` [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition andre
2 siblings, 0 replies; 6+ messages in thread
From: andre @ 2007-08-30 10:36 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, Andre Haupt, ecd
[-- Attachment #1: idt77252_use_abs_from_kernel_h.patch --]
[-- Type: text/plain, Size: 890 bytes --]
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;
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [KJ][patch 2/3] CIFS SMB: use abs() from kernel.h where appropriate
[not found] <20070830102551.131398783@finow14.de>
2007-08-30 10:36 ` [KJ][patch 1/3] IDT77252: use abs() from kernel.h where appropriate andre
@ 2007-08-30 10:37 ` andre
2007-08-30 10:40 ` [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition andre
2 siblings, 0 replies; 6+ messages in thread
From: andre @ 2007-08-30 10:37 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, Andre Haupt, sfrench
[-- Attachment #1: cifssmb_use_abs_from_kernel_h.patch --]
[-- Type: text/plain, Size: 682 bytes --]
From: Andre Haupt <andre@finow14.de>
Signed-off-by: Andre Haupt <andre@finow14.de>
---
Index: linus/fs/cifs/cifssmb.c
===================================================================
--- linus.orig/fs/cifs/cifssmb.c 2007-08-30 11:43:20.000000000 +0200
+++ linus/fs/cifs/cifssmb.c 2007-08-30 11:44:58.000000000 +0200
@@ -513,7 +513,7 @@ CIFSSMBNegotiate(unsigned int xid, struc
(int)ts.tv_sec, (int)utc.tv_sec,
(int)(utc.tv_sec - ts.tv_sec)));
val = (int)(utc.tv_sec - ts.tv_sec);
- seconds = val < 0 ? -val : val;
+ seconds = abs(val);
result = (seconds / MIN_TZ_ADJ) * MIN_TZ_ADJ;
remain = seconds % MIN_TZ_ADJ;
if (remain >= (MIN_TZ_ADJ / 2))
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition
[not found] <20070830102551.131398783@finow14.de>
2007-08-30 10:36 ` [KJ][patch 1/3] IDT77252: use abs() from kernel.h where appropriate andre
2007-08-30 10:37 ` [KJ][patch 2/3] CIFS SMB: " andre
@ 2007-08-30 10:40 ` andre
2007-08-30 11:17 ` Matthew Wilcox
2 siblings, 1 reply; 6+ messages in thread
From: andre @ 2007-08-30 10:40 UTC (permalink / raw)
To: kernel-janitors; +Cc: linux-kernel, Andre Haupt, rmk
[-- Attachment #1: vidc20_use_abs_from_kernel_h.patch --]
[-- Type: text/plain, Size: 956 bytes --]
From: Andre Haupt <andre@finow14.de>
Signed-off-by: Andre Haupt <andre@finow14.de>
---
Index: linus/sound/oss/vidc.c
===================================================================
--- linus.orig/sound/oss/vidc.c 2007-08-30 11:57:13.000000000 +0200
+++ linus/sound/oss/vidc.c 2007-08-30 11:57:53.000000000 +0200
@@ -185,8 +185,6 @@ static unsigned int vidc_audio_set_forma
return vidc_audio_format;
}
-#define my_abs(i) ((i)<0 ? -(i) : (i))
-
static int vidc_audio_set_speed(int dev, int rate)
{
if (rate) {
@@ -214,8 +212,8 @@ static int vidc_audio_set_speed(int dev,
rate_ext = VIDC_SOUND_CLOCK_EXT / hwrate_ext;
/* Chose between external and internal clock */
- diff_int = my_abs(rate_ext-rate);
- diff_ext = my_abs(rate_int-rate);
+ diff_int = abs(rate_ext-rate);
+ diff_ext = abs(rate_int-rate);
if (diff_ext < diff_int) {
/*printk("VIDC: external %d %d %d\n", rate, rate_ext, hwrate_ext);*/
hwrate=hwrate_ext;
--
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition
2007-08-30 10:40 ` [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition andre
@ 2007-08-30 11:17 ` Matthew Wilcox
2007-08-30 11:50 ` Andre Haupt
0 siblings, 1 reply; 6+ messages in thread
From: Matthew Wilcox @ 2007-08-30 11:17 UTC (permalink / raw)
To: andre; +Cc: kernel-janitors, linux-kernel, rmk
On Thu, Aug 30, 2007 at 12:40:38PM +0200, andre@finow14.de wrote:
> - diff_int = my_abs(rate_ext-rate);
> - diff_ext = my_abs(rate_int-rate);
> + diff_int = abs(rate_ext-rate);
> + diff_ext = abs(rate_int-rate);
Nothing to do with the patch, but is this really correct? Surely it
should be diff_ext = abs(rate_ext-rate) ?
--
Intel are signing my paycheques ... these opinions are still mine
"Bill, look, we understand that you're interested in selling us this
operating system, but compare it to ours. We can't possibly take such
a retrograde step."
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition
2007-08-30 11:17 ` Matthew Wilcox
@ 2007-08-30 11:50 ` Andre Haupt
2007-08-30 12:22 ` Russell King
0 siblings, 1 reply; 6+ messages in thread
From: Andre Haupt @ 2007-08-30 11:50 UTC (permalink / raw)
To: Matthew Wilcox; +Cc: andre, kernel-janitors, linux-kernel, rmk
On Thu, Aug 30, 2007 at 05:17:47AM -0600, Matthew Wilcox wrote:
> On Thu, Aug 30, 2007 at 12:40:38PM +0200, andre@finow14.de wrote:
> > - diff_int = my_abs(rate_ext-rate);
> > - diff_ext = my_abs(rate_int-rate);
> > + diff_int = abs(rate_ext-rate);
> > + diff_ext = abs(rate_int-rate);
>
> Nothing to do with the patch, but is this really correct? Surely it
> should be diff_ext = abs(rate_ext-rate) ?
hmmh, not sure about this ...
Russell?
regards,
Andre
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition
2007-08-30 11:50 ` Andre Haupt
@ 2007-08-30 12:22 ` Russell King
0 siblings, 0 replies; 6+ messages in thread
From: Russell King @ 2007-08-30 12:22 UTC (permalink / raw)
To: Andre Haupt; +Cc: Matthew Wilcox, kernel-janitors, linux-kernel
On Thu, Aug 30, 2007 at 01:50:59PM +0200, Andre Haupt wrote:
> On Thu, Aug 30, 2007 at 05:17:47AM -0600, Matthew Wilcox wrote:
> > On Thu, Aug 30, 2007 at 12:40:38PM +0200, andre@finow14.de wrote:
> > > - diff_int = my_abs(rate_ext-rate);
> > > - diff_ext = my_abs(rate_int-rate);
> > > + diff_int = abs(rate_ext-rate);
> > > + diff_ext = abs(rate_int-rate);
> >
> > Nothing to do with the patch, but is this really correct? Surely it
> > should be diff_ext = abs(rate_ext-rate) ?
>
> hmmh, not sure about this ...
No idea. The support for external clocking came from someone else
(I was never able to work it out myself).
I can only assume that the code as it stands does work. So let's
remain bug-compatible until there's a proven problem.
--
Russell King
Linux kernel 2.6 ARM Linux - http://www.arm.linux.org.uk/
maintainer of:
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2007-08-30 12:33 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20070830102551.131398783@finow14.de>
2007-08-30 10:36 ` [KJ][patch 1/3] IDT77252: use abs() from kernel.h where appropriate andre
2007-08-30 10:37 ` [KJ][patch 2/3] CIFS SMB: " andre
2007-08-30 10:40 ` [KJ][patch 3/3] VIDC20: use abs() from kernel.h instead of own definition andre
2007-08-30 11:17 ` Matthew Wilcox
2007-08-30 11:50 ` Andre Haupt
2007-08-30 12:22 ` Russell King
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox