Re: [PATCH v6 2/5] udmabuf: Add back support for mapping hugetlb pages (v5)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



> +	if (ubuf->subpgoff) {
> +		pfn += ubuf->subpgoff[pgoff] >> PAGE_SHIFT;
> +	}

No need for the braces here..

> @@ -253,16 +271,59 @@ static long udmabuf_create(struct miscdevice *device,
>  			goto err;
>  		pgoff = list[i].offset >> PAGE_SHIFT;
>  		pgcnt = list[i].size   >> PAGE_SHIFT;
> +		if (is_file_hugepages(memfd)) {
> +			if (!ubuf->subpgoff) {
> +				ubuf->subpgoff = kmalloc_array(ubuf->pagecount,
> +							       sizeof(*ubuf->subpgoff),

Overly long line here.

Given how much code there is in the main loop here this almost screams
for splitting that into a helper anyay.

And then the body of the pgidx loop below which is compeltely different
for hugetlb vs not ask for another helper each for the loop body
variants.




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux