From: Paul Fulghum <paulkf@microgate.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>
Subject: [PATCH] synclink_gt use div_round_up macro
Date: Wed, 09 Dec 2009 12:17:55 -0600 [thread overview]
Message-ID: <1260382676.11494.4.camel@x2.microgate.com> (raw)
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");
reply other threads:[~2009-12-09 17:17 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1260382676.11494.4.camel@x2.microgate.com \
--to=paulkf@microgate.com \
--cc=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.