From: Joe Korty <joe.korty@ccur.com>
To: William Lee Irwin III <wli@holomorphy.com>,
Andrew Morton <akpm@osdl.org>, Paul Jackson <pj@sgi.com>,
Linux kernel mailing list <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH] broken bitmap_parse for ncpus > 32
Date: Mon, 22 Mar 2004 23:10:13 -0500 [thread overview]
Message-ID: <20040323041012.GA30322@tsunami.ccur.com> (raw)
In-Reply-To: <20040323020907.GU2045@holomorphy.com>
On Mon, Mar 22, 2004 at 06:09:07PM -0800, William Lee Irwin III wrote:
> At some point in the past, I wrote:
>>> Bugfixes are always good. Maybe the kerneldoc stuff would be a good idea
>>> for these functions, and the rest of the non-static functions ppl might
>>> be expected to call.
>
> On Mon, Mar 22, 2004 at 07:14:33PM -0500, Joe Korty wrote:
>> IMO, one+ liners describing how a function is used is best put near
>> the function, where it is most likely to be seen. Stuff going into
>> Documentation/*.txt should be bulky stuff not suitable for inlining,
>> such as largish tutorials, annotated examples, theory papers, etc.
>
> Sorry about not being clear; I meant the : and @ stuff I've seen around
> various comments that somehow gets yanked directly out of C comments in
> the source and generated into a pdf.
Ah, I see. Here is the New-n-Improved patch:
--- base/lib/bitmap.c 2004-03-10 21:55:43.000000000 -0500
+++ new/lib/bitmap.c 2004-03-22 23:04:51.000000000 -0500
@@ -71,6 +71,17 @@
}
EXPORT_SYMBOL(bitmap_complement);
+/*
+ * bitmap_shift_write - logical right shift of the bits in a bitmap
+ * @dst - destination bitmap
+ * @src - source bitmap
+ * @nbits - shift by this many bits
+ * @bits - bitmap size, in bits
+ *
+ * Shifting right (dividing) means moving bits in the MS -> LS bit
+ * direction. Zeros are fed into the vacated MS positions and the
+ * LS bits shifted off the bottom are lost.
+ */
void bitmap_shift_right(unsigned long *dst,
const unsigned long *src, int shift, int bits)
{
@@ -86,6 +97,17 @@
}
EXPORT_SYMBOL(bitmap_shift_right);
+/*
+ * bitmap_shift_left - logical left shift of the bits in a bitmap
+ * @dst - destination bitmap
+ * @src - source bitmap
+ * @nbits - shift by this many bits
+ * @bits - bitmap size, in bits
+ *
+ * Shifting left (multiplying) means moving bits in the LS -> MS
+ * direction. Zeros are fed into the vacated LS bit positions
+ * and those MS bits shifted off the top are lost.
+ */
void bitmap_shift_left(unsigned long *dst,
const unsigned long *src, int shift, int bits)
{
@@ -269,7 +291,7 @@
if (nchunks == 0 && chunk == 0)
continue;
- bitmap_shift_right(maskp, maskp, CHUNKSZ, nmaskbits);
+ bitmap_shift_left(maskp, maskp, CHUNKSZ, nmaskbits);
*maskp |= chunk;
nchunks++;
nbits += (nchunks == 1) ? nbits_to_hold_value(chunk) : CHUNKSZ;
next prev parent reply other threads:[~2004-03-23 4:11 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2004-03-22 20:21 [PATCH] broken bitmap_parse for ncpus > 32 Joe Korty
2004-03-22 21:44 ` Paul Jackson
2004-03-22 23:12 ` William Lee Irwin III
2004-03-23 0:14 ` Joe Korty
2004-03-23 2:09 ` William Lee Irwin III
2004-03-23 4:10 ` Joe Korty [this message]
2004-03-23 4:17 ` William Lee Irwin III
2004-03-23 0:19 ` Paul Jackson
2004-03-23 2:08 ` William Lee Irwin III
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=20040323041012.GA30322@tsunami.ccur.com \
--to=joe.korty@ccur.com \
--cc=akpm@osdl.org \
--cc=linux-kernel@vger.kernel.org \
--cc=pj@sgi.com \
--cc=wli@holomorphy.com \
/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.