public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH] synclink_gt use div_round_up macro
@ 2009-12-09 18:17 Paul Fulghum
  0 siblings, 0 replies; only message in thread
From: Paul Fulghum @ 2009-12-09 18:17 UTC (permalink / raw)
  To: Andrew Morton; +Cc: linux-kernel@vger.kernel.org

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");




^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2009-12-09 17:17 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-12-09 18:17 [PATCH] synclink_gt use div_round_up macro Paul Fulghum

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox