Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Staging: comedi: remove wrapper.h

Just make the bit call when it is needed, no need to wrap
things up like this for no reason.

Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>

+5 -38
+5 -13
drivers/staging/comedi/drivers.c
··· 38 38 #include <linux/mm.h> 39 39 #include <linux/slab.h> 40 40 #include "comedidev.h" 41 - #include "wrapper.h" 42 41 #include <linux/highmem.h> /* for SuSE brokenness */ 43 42 #include <linux/vmalloc.h> 44 43 #include <linux/cdev.h> ··· 441 442 unsigned i; 442 443 for (i = 0; i < async->n_buf_pages; ++i) { 443 444 if (async->buf_page_list[i].virt_addr) { 444 - mem_map_unreserve(virt_to_page 445 - (async->buf_page_list[i]. 446 - virt_addr)); 445 + clear_bit(PG_reserved, &(virt_to_page(async->buf_page_list[i].virt_addr)->flags)); 447 446 if (s->async_dma_dir != DMA_NONE) { 448 447 dma_free_coherent(dev->hw_dev, 449 448 PAGE_SIZE, ··· 494 497 if (async->buf_page_list[i].virt_addr == NULL) 495 498 break; 496 499 497 - mem_map_reserve(virt_to_page 498 - (async->buf_page_list[i]. 499 - virt_addr)); 500 - pages[i] = 501 - virt_to_page(async-> 502 - buf_page_list[i].virt_addr); 500 + set_bit(PG_reserved, 501 + &(virt_to_page(async->buf_page_list[i].virt_addr)->flags)); 502 + pages[i] = virt_to_page(async->buf_page_list[i].virt_addr); 503 503 } 504 504 } 505 505 if (i == n_pages) { ··· 513 519 NULL) { 514 520 break; 515 521 } 516 - mem_map_unreserve(virt_to_page 517 - (async->buf_page_list 518 - [i].virt_addr)); 522 + clear_bit(PG_reserved, &(virt_to_page(async->buf_page_list[i].virt_addr)->flags)); 519 523 if (s->async_dma_dir != DMA_NONE) { 520 524 dma_free_coherent(dev->hw_dev, 521 525 PAGE_SIZE,
-25
drivers/staging/comedi/wrapper.h
··· 1 - /* 2 - linux/wrapper.h compatibility header 3 - 4 - This program is free software; you can redistribute it and/or modify 5 - it under the terms of the GNU General Public License as published by 6 - the Free Software Foundation; either version 2 of the License, or 7 - (at your option) any later version. 8 - 9 - This program is distributed in the hope that it will be useful, 10 - but WITHOUT ANY WARRANTY; without even the implied warranty of 11 - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 12 - GNU General Public License for more details. 13 - 14 - You should have received a copy of the GNU General Public License 15 - along with this program; if not, write to the Free Software 16 - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. 17 - */ 18 - 19 - #ifndef __COMPAT_LINUX_WRAPPER_H_ 20 - #define __COMPAT_LINUX_WRAPPER_H_ 21 - 22 - #define mem_map_reserve(p) set_bit(PG_reserved, &((p)->flags)) 23 - #define mem_map_unreserve(p) clear_bit(PG_reserved, &((p)->flags)) 24 - 25 - #endif /* __COMPAT_LINUX_WRAPPER_H_ */