Re: Linuv 2.6.15-rc1

Linus Torvalds
2005-11-16T16:09:53Z

On Wed, 16 Nov 2005, Zhu Yi wrote:
>
> Please try the patch below and see if it makes any difference.
> http://bughost.org/bugzilla/show_bug.cgi?id=821

Hmm. That patch does

+ error->log = (struct ipw_event *)((u8 *)error->elem +
(sizeof(*error->elem) * elem_len));

which really can be much more cleanly written as

error->log = (void *)(error->elem + elem_len);

since pointer addition does the "multiply by pointer element size" on it's
own.

For future reference, you want to make just a byte add, the cleanest way
(in kernel, where we use the gcc "void *" additions) is

newptr = offset + (void *)oldptr;

ho humm..

Linus