But of course. I'm not denying that. Naturally the type should be
changed. I thought that was obvious so I didn't bother agreeing. But
in fact, it already *is* aligned on a long boundary. Better, in
fact. It's aligned on a 16 byte boundary. Even though the type was
__u32.
> (Turning to the gallery) I assert: if you're going to do bitops on it,
> make it a "unsigned long".
Agreed.
> > So there should be no issues with big vs. little endian,
> > since memset/memcpy operations are done in blocks of sufficient
> > alignment.
>
> I think you're right, as long as length is always a multiple of
> sizeof(long). This is not obvious from this hunk of code alone, which
> is why I queried it...
>
> if (space->num_free < 1)
> {
> if (space->length < 16) length = 16;
> else length = space->length << 1;
Assuming sizeof (long) <= 16 bytes, then length will always be a
multiple of sizeof (long). So, even for a 128 bit CPU, this code is
fine. It might break down on a 256 bit CPU...
Anyway, it looks like we're in agreement.
Regards,
Richard....
Permanent: rgooch@atnf.csiro.au
Current: rgooch@ras.ucalgary.ca
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/