Re: [PATCH 2.6.12-rc6] char: Add Dell Systems Management Base driver

Andi Kleen
2005-06-16T18:00:17Z

Doug Warzecha <Douglas_Warzecha@dell.com> writes:

> +static void *tvm_alloc_suitable(unsigned long size, unsigned long phys_max)
> +{
> + void *ptr;
> + unsigned int flags = GFP_KERNEL;
> +
> + while ((ptr = kmalloc(size, flags)) != NULL) {
> + if ((virt_to_phys(ptr) + size - 1) <= phys_max)
> + break;
> +
> + kfree(ptr);
> + ptr = NULL;
> +
> + if (flags & GFP_DMA)
> + break;
> + flags |= GFP_DMA;
> + }
> + return ptr;

Umm - what's that?

Please drop that immediately. 2.6.13 will hopefully have GFP_DMA32
on x86-64 that will make it fully obsolete.

And even before that you can use pci_alloc_consistent() - that
will do the right now and later.

... haven't read on.

But there seems to be a use of register_ioctl32_conversion. That
needs to be replaced with ->compat_ioctl, since the former
will soon go.

-Andi