Skip to contentSkip to conversation

synclink_gt use div_round_up macro

PATCH New Paul Fulghum 1 participant 1 message Dec 9, 2009 Char and misc drivers

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 synclink_gt use div_round_up macro

Use DIV_ROUND_UP macro to simplify code.

drivers/char/synclink_gt.c +1 -5
@@ -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");