lkml.org 
[lkml]   [2009]   [Dec]   [9]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH] synclink_gt use div_round_up macro
From
Date
Use DIV_ROUND_UP macro to simplify code.

Signed-off-by: Paul Fulghum <paulkf@microgate.com>

--- a/drivers/char/synclink_gt.c 2009-12-09 12:09:25.000000000 -0600
+++ b/drivers/char/synclink_gt.c 2009-12-09 12:10:00.000000000 -0600
@@ -4779,13 +4779,9 @@ static bool tx_load(struct slgt_info *in
unsigned short count;
unsigned int i;
struct slgt_desc *d;
- unsigned int bufs_needed;

/* check required buffer space */
- bufs_needed = (size/DMABUFSIZE);
- if (size % DMABUFSIZE)
- ++bufs_needed;
- if (bufs_needed > free_tbuf_count(info))
+ if (DIV_ROUND_UP(size, DMABUFSIZE) > free_tbuf_count(info))
return false;

DBGDATA(info, buf, size, "tx");




\
 
 \ /
  Last update: 2009-12-09 18:21    [W:0.025 / U:1.528 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site