scsi/a100u2w: Remove custom msecs_to_jiffies and
Subsystems (2)
PATCH 1/1 scsi/a100u2w: Remove custom msecs_to_jiffies and
Replace the MS_TO_JIFFIES() macro with msecs_to_jiffies() from jiffies.h The current macro is incorrect because HZ can have different values on different architectures.
The patch also removes the JIFFIES_TO_MS() macro which is not used anymore in the code.
drivers/scsi/a100u2w.c +1 -5
@@ -100,10 +100,6 @@#include "a100u2w.h" - -#define JIFFIES_TO_MS (t) ((t) * 1000 / HZ) -#define MS_TO_JIFFIES (j) ((j * HZ) / 1000) -static ORC_SCB *orc_alloc_scb (ORC_HCS * hcsp);static void inia100SCBPost (BYTE * pHcb,BYTE * pScb);
@@ -160,7 +156,7 @@ static UCHAR dftNvRam[64] =/***************************************************************************/ static void waitForPause (unsigned amount) { -ULONG the_time = jiffies +MS_TO_JIFFIES (amount); +ULONG the_time = jiffies +msecs_to_jiffies (amount);while (time_before_eq (jiffies, the_time))cpu_relax (); }
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
drivers/scsi/a100u2w.c static UCHAR dftNvRam[64] = · line 162
Quoted 12 lines · Tobias Klauser
Replace the
MS_TO_JIFFIES()macro withmsecs_to_jiffies()fromjiffies.hdrivers/scsi/a100u2w.c +1
-1static void waitForPause (unsigned amount) { -ULONG the_time = jiffies +MS_TO_JIFFIES (amount); +ULONG the_time = jiffies +msecs_to_jiffies (amount);while (time_before_eq (jiffies, the_time))cpu_relax (); }
It'd be better to find out what is the equivalent generic sleeping/delaying function and, if any, remove waitForPause() altogether.
However, Bas Vermeulen added these lines at the top of the file:
* 01/31/99 bv - v1.02b Use mdelay instead of waitForPause
* 08/08/99 bv - v1.02c Use waitForPause again.
Maybe he can recall what was wrong with mdelay().
drivers/scsi/a100u2w.c static UCHAR dftNvRam[64] = · line 161
Quoted 6 lines
static void waitForPause(unsigned amount)
{drivers/scsi/a100u2w.c +1
-1-ULONG the_time = jiffies +MS_TO_JIFFIES (amount); +ULONG the_time = jiffies +msecs_to_jiffies (amount);while (time_before_eq (jiffies, the_time))cpu_relax ();
You should probably replace this function with msleep completely.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 8 lines · Christoph Hellwig
drivers/scsi/a100u2w.c static UCHAR dftNvRam[64] = · line 161
Quoted 6 lines
static void waitForPause(unsigned amount)
{drivers/scsi/a100u2w.c +1
-1-ULONG the_time = jiffies +MS_TO_JIFFIES (amount); +ULONG the_time = jiffies +msecs_to_jiffies (amount);while (time_before_eq (jiffies, the_time))cpu_relax ();You should probably replace this function with msleep completely.
I actually meant mdelay, but as mentioned in the other followup that might need some more research.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 2 lines · Christoph Hellwig
I actually meant mdelay, but as mentioned in the other followup that might need some more research.
Actually, several of the waits look as though they have user context and so could sleep:
waitChipReady
waitFWReady
waitSCSIRSTdone
These I think are also user context: the aborts and nvram functions all seem to be user context
waitHDOoff
waitHDIoff
So could someone with a board try the theory (that msleep will work)?
Thanks,
James
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors
Quoted 10 lines · Christoph Hellwig
Quoted 8 lines · Christoph Hellwig
drivers/scsi/a100u2w.c static UCHAR dftNvRam[64] = · line 161
Quoted 6 lines
static void waitForPause(unsigned amount)
{drivers/scsi/a100u2w.c +1
-1-ULONG the_time = jiffies +MS_TO_JIFFIES (amount); +ULONG the_time = jiffies +msecs_to_jiffies (amount);while (time_before_eq (jiffies, the_time))cpu_relax ();You should probably replace this function with msleep completely.
Quoted 2 lines
I actually meant mdelay, but as mentioned in the other followup that might need some more research.
OK, I'll have a look at it. Thanks for your help.
_______________________________________________
Kernel-janitors mailing list
[email protected]
http://lists.osdl.org/mailman/listinfo/kernel-janitors