Patchwork [07/11] net/peak_pcmcia: take msecs_to_jiffies_min into use

login
register
mail settings
Submitter Imre Deak
Date May 10, 2013, 12:13 p.m.
Message ID <1368188011-23661-7-git-send-email-imre.deak@intel.com>
Download mbox | patch
Permalink /patch/242962/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Imre Deak - May 10, 2013, 12:13 p.m.
Use msecs_to_jiffies_min instead of open-coding the same.

Signed-off-by: Imre Deak <imre.deak@intel.com>
---
 drivers/net/can/sja1000/peak_pcmcia.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
Marc Kleine-Budde - May 15, 2013, 9:12 a.m.
On 05/10/2013 02:13 PM, Imre Deak wrote:
> Use msecs_to_jiffies_min instead of open-coding the same.
> 
> Signed-off-by: Imre Deak <imre.deak@intel.com>

Tnx, applied to linux-can-next/master.

Marc
Marc Kleine-Budde - May 15, 2013, 11:45 a.m.
On 05/15/2013 11:12 AM, Marc Kleine-Budde wrote:
> On 05/10/2013 02:13 PM, Imre Deak wrote:
>> Use msecs_to_jiffies_min instead of open-coding the same.
>>
>> Signed-off-by: Imre Deak <imre.deak@intel.com>
> 
> Tnx, applied to linux-can-next/master.

Removed, as requested by Imre:

> The reason is that in that driver I wasn't sure about why +1 was
> added, since the time_after() check already guarantees a minimum wait
> time.

Marc

Patch

diff --git a/drivers/net/can/sja1000/peak_pcmcia.c b/drivers/net/can/sja1000/peak_pcmcia.c
index 1a7020b..3e45e16 100644
--- a/drivers/net/can/sja1000/peak_pcmcia.c
+++ b/drivers/net/can/sja1000/peak_pcmcia.c
@@ -253,7 +253,7 @@  static inline int pcan_pccard_present(struct pcan_pccard *card)
 static int pcan_wait_spi_busy(struct pcan_pccard *card)
 {
 	unsigned long timeout = jiffies +
-				msecs_to_jiffies(PCC_SPI_MAX_BUSY_WAIT_MS) + 1;
+				msecs_to_jiffies_min(PCC_SPI_MAX_BUSY_WAIT_MS);
 
 	/* be sure to read status at least once after sleeping */
 	while (pcan_read_reg(card, PCC_CSR) & PCC_CSR_SPI_BUSY) {