Messages in this thread | | | Date | Thu, 19 Oct 2006 21:59:54 -0700 | From | Andrew Morton <> | Subject | Re: [PATCH] Minor fixes to generic do_div |
| |
On Thu, 19 Oct 2006 21:34:00 -0600 Matthew Wilcox <matthew@wil.cx> wrote:
> +/* The unnecessary pointer compare is there > + * to check for type safety (n must be 64bit) > + */ > +# define do_div(n,base) ({ \ > + uint32_t __base = (base); \ > + uint32_t __rem; \ > + (void)(((typeof((n)) *)0) == ((uint64_t *)0)); \ > + __rem = ((uint64_t)(n)) % __base; \ > + (n) = ((uint64_t)(n)) / __base; \ > + __rem; \ > })
Can we use typecheck(), from include/linux/kernel.h? - 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/
| |