summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 15:58:18 -0700
committerLinus Torvalds <torvalds@woody.linux-foundation.org>2007-10-25 15:58:18 -0700
commit0e81bef05e3b90f8319e79bf36e61341f7b6e189 (patch)
treea3747692b343ee5963731f4cef93d5ea78f6f3f5 /drivers
parenteadd4f5ea1507403655e9f5aeb0ea944eaa9d5de (diff)
parent9317d4313e0cd51b2256ea9a9316f2d8561e37a8 (diff)
Merge branch 'warnings-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6
* 'warnings-upstream' of git://git.kernel.org/pub/scm/linux/kernel/git/jgarzik/misc-2.6: ISDN/sc: fix longstanding warning
Diffstat (limited to 'drivers')
-rw-r--r--drivers/isdn/sc/shmem.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/drivers/isdn/sc/shmem.c b/drivers/isdn/sc/shmem.c
index 034d41a61ae1..e0331e0094f1 100644
--- a/drivers/isdn/sc/shmem.c
+++ b/drivers/isdn/sc/shmem.c
@@ -28,15 +28,15 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
{
unsigned long flags;
unsigned char ch;
+ unsigned long dest_rem = ((unsigned long) dest) % 0x4000;
- if(!IS_VALID_CARD(card)) {
+ if (!IS_VALID_CARD(card)) {
pr_debug("Invalid param: %d is not a valid card id\n", card);
return;
}
- if(n > SRAM_PAGESIZE) {
+ if (n > SRAM_PAGESIZE)
return;
- }
/*
* determine the page to load from the address
@@ -50,8 +50,7 @@ void memcpy_toshmem(int card, void *dest, const void *src, size_t n)
outb(((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE) >> 14) | 0x80,
sc_adapter[card]->ioport[sc_adapter[card]->shmem_pgport]);
- memcpy_toio(sc_adapter[card]->rambase +
- ((unsigned long) dest % 0x4000), src, n);
+ memcpy_toio(sc_adapter[card]->rambase + dest_rem, src, n);
spin_unlock_irqrestore(&sc_adapter[card]->lock, flags);
pr_debug("%s: set page to %#x\n",sc_adapter[card]->devicename,
((sc_adapter[card]->shmem_magic + ch * SRAM_PAGESIZE)>>14)|0x80);