diff options
author | Adrian Bunk <bunk@stusta.de> | 2006-04-27 20:06:50 -0400 |
---|---|---|
committer | Mauro Carvalho Chehab <mchehab@infradead.org> | 2006-06-25 00:59:40 -0400 |
commit | 972c3517b792520a513d0ecd897ac6719e46fe0d (patch) | |
tree | 3dfb64c1829175648f5396e3df92ea3bbe3f4eb6 | |
parent | 9a8e10e034b268237af77e7ce73a54251eaf9fe2 (diff) |
V4L/DVB (3931): Vivi.c: possible cleanups
This patch contains the following possible cleanup:
- make needlessly global functions static
- remove unused #ifndef kzalloc kzalloc() #define
- remove inline's from functions
Signed-off-by: Adrian Bunk <bunk@stusta.de>
Signed-off-by: Mauro Carvalho Chehab <mchehab@infradead.org>
-rw-r--r-- | drivers/media/video/vivi.c | 44 |
1 files changed, 17 insertions, 27 deletions
diff --git a/drivers/media/video/vivi.c b/drivers/media/video/vivi.c index 779db26771c0..d002561aeb4c 100644 --- a/drivers/media/video/vivi.c +++ b/drivers/media/video/vivi.c | |||
@@ -48,16 +48,6 @@ | |||
48 | 48 | ||
49 | #include "font.h" | 49 | #include "font.h" |
50 | 50 | ||
51 | #ifndef kzalloc | ||
52 | #define kzalloc(size, flags) \ | ||
53 | ({ \ | ||
54 | void *__ret = kmalloc(size, flags); \ | ||
55 | if (__ret) \ | ||
56 | memset(__ret, 0, size); \ | ||
57 | __ret; \ | ||
58 | }) | ||
59 | #endif | ||
60 | |||
61 | MODULE_DESCRIPTION("Video Technology Magazine Virtual Video Capture Board"); | 51 | MODULE_DESCRIPTION("Video Technology Magazine Virtual Video Capture Board"); |
62 | MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); | 52 | MODULE_AUTHOR("Mauro Carvalho Chehab, Ted Walther and John Sokol"); |
63 | MODULE_LICENSE("Dual BSD/GPL"); | 53 | MODULE_LICENSE("Dual BSD/GPL"); |
@@ -248,7 +238,8 @@ static u8 bars[8][3] = { | |||
248 | #define TSTAMP_MAX_Y TSTAMP_MIN_Y+15 | 238 | #define TSTAMP_MAX_Y TSTAMP_MIN_Y+15 |
249 | #define TSTAMP_MIN_X 64 | 239 | #define TSTAMP_MIN_X 64 |
250 | 240 | ||
251 | void prep_to_addr(struct sg_to_addr to_addr[],struct videobuf_buffer *vb) | 241 | static void prep_to_addr(struct sg_to_addr to_addr[], |
242 | struct videobuf_buffer *vb) | ||
252 | { | 243 | { |
253 | int i, pos=0; | 244 | int i, pos=0; |
254 | 245 | ||
@@ -259,7 +250,7 @@ void prep_to_addr(struct sg_to_addr to_addr[],struct videobuf_buffer *vb) | |||
259 | } | 250 | } |
260 | } | 251 | } |
261 | 252 | ||
262 | inline int get_addr_pos(int pos, int pages, struct sg_to_addr to_addr[]) | 253 | static int get_addr_pos(int pos, int pages, struct sg_to_addr to_addr[]) |
263 | { | 254 | { |
264 | int p1=0,p2=pages-1,p3=pages/2; | 255 | int p1=0,p2=pages-1,p3=pages/2; |
265 | 256 | ||
@@ -280,8 +271,8 @@ inline int get_addr_pos(int pos, int pages, struct sg_to_addr to_addr[]) | |||
280 | return (p1); | 271 | return (p1); |
281 | } | 272 | } |
282 | 273 | ||
283 | void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax, | 274 | static void gen_line(struct sg_to_addr to_addr[],int inipos,int pages,int wmax, |
284 | int hmax, int line, char *timestr) | 275 | int hmax, int line, char *timestr) |
285 | { | 276 | { |
286 | int w,i,j,pos=inipos,pgpos,oldpg,y; | 277 | int w,i,j,pos=inipos,pgpos,oldpg,y; |
287 | char *p,*s,*basep; | 278 | char *p,*s,*basep; |
@@ -491,7 +482,7 @@ static void vivi_thread_tick(struct vivi_dmaqueue *dma_q) | |||
491 | dprintk(1,"%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc); | 482 | dprintk(1,"%s: %d buffers handled (should be 1)\n",__FUNCTION__,bc); |
492 | } | 483 | } |
493 | 484 | ||
494 | void vivi_sleep(struct vivi_dmaqueue *dma_q) | 485 | static void vivi_sleep(struct vivi_dmaqueue *dma_q) |
495 | { | 486 | { |
496 | int timeout; | 487 | int timeout; |
497 | DECLARE_WAITQUEUE(wait, current); | 488 | DECLARE_WAITQUEUE(wait, current); |
@@ -526,7 +517,7 @@ void vivi_sleep(struct vivi_dmaqueue *dma_q) | |||
526 | try_to_freeze(); | 517 | try_to_freeze(); |
527 | } | 518 | } |
528 | 519 | ||
529 | int vivi_thread(void *data) | 520 | static int vivi_thread(void *data) |
530 | { | 521 | { |
531 | struct vivi_dmaqueue *dma_q=data; | 522 | struct vivi_dmaqueue *dma_q=data; |
532 | 523 | ||
@@ -542,7 +533,7 @@ int vivi_thread(void *data) | |||
542 | return 0; | 533 | return 0; |
543 | } | 534 | } |
544 | 535 | ||
545 | int vivi_start_thread(struct vivi_dmaqueue *dma_q) | 536 | static int vivi_start_thread(struct vivi_dmaqueue *dma_q) |
546 | { | 537 | { |
547 | dma_q->frame=0; | 538 | dma_q->frame=0; |
548 | dma_q->ini_jiffies=jiffies; | 539 | dma_q->ini_jiffies=jiffies; |
@@ -560,7 +551,7 @@ int vivi_start_thread(struct vivi_dmaqueue *dma_q) | |||
560 | return 0; | 551 | return 0; |
561 | } | 552 | } |
562 | 553 | ||
563 | void vivi_stop_thread(struct vivi_dmaqueue *dma_q) | 554 | static void vivi_stop_thread(struct vivi_dmaqueue *dma_q) |
564 | { | 555 | { |
565 | dprintk(1,"%s\n",__FUNCTION__); | 556 | dprintk(1,"%s\n",__FUNCTION__); |
566 | /* shutdown control thread */ | 557 | /* shutdown control thread */ |
@@ -666,8 +657,7 @@ buffer_setup(struct videobuf_queue *vq, unsigned int *count, unsigned int *size) | |||
666 | return 0; | 657 | return 0; |
667 | } | 658 | } |
668 | 659 | ||
669 | void | 660 | static void free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf) |
670 | free_buffer(struct videobuf_queue *vq, struct vivi_buffer *buf) | ||
671 | { | 661 | { |
672 | dprintk(1,"%s\n",__FUNCTION__); | 662 | dprintk(1,"%s\n",__FUNCTION__); |
673 | 663 | ||
@@ -791,8 +781,8 @@ static void buffer_release(struct videobuf_queue *vq, struct videobuf_buffer *vb | |||
791 | free_buffer(vq,buf); | 781 | free_buffer(vq,buf); |
792 | } | 782 | } |
793 | 783 | ||
794 | int vivi_map_sg (void *dev, struct scatterlist *sg, int nents, | 784 | static int vivi_map_sg(void *dev, struct scatterlist *sg, int nents, |
795 | int direction) | 785 | int direction) |
796 | { | 786 | { |
797 | int i; | 787 | int i; |
798 | 788 | ||
@@ -808,15 +798,15 @@ int vivi_map_sg (void *dev, struct scatterlist *sg, int nents, | |||
808 | return nents; | 798 | return nents; |
809 | } | 799 | } |
810 | 800 | ||
811 | int vivi_unmap_sg(void *dev,struct scatterlist *sglist,int nr_pages, | 801 | static int vivi_unmap_sg(void *dev,struct scatterlist *sglist,int nr_pages, |
812 | int direction) | 802 | int direction) |
813 | { | 803 | { |
814 | dprintk(1,"%s\n",__FUNCTION__); | 804 | dprintk(1,"%s\n",__FUNCTION__); |
815 | return 0; | 805 | return 0; |
816 | } | 806 | } |
817 | 807 | ||
818 | int vivi_dma_sync_sg(void *dev,struct scatterlist *sglist,int nr_pages, | 808 | static int vivi_dma_sync_sg(void *dev,struct scatterlist *sglist, int nr_pages, |
819 | int direction) | 809 | int direction) |
820 | { | 810 | { |
821 | // dprintk(1,"%s\n",__FUNCTION__); | 811 | // dprintk(1,"%s\n",__FUNCTION__); |
822 | 812 | ||
@@ -900,7 +890,7 @@ static int res_get(struct vivi_dev *dev, struct vivi_fh *fh) | |||
900 | return 1; | 890 | return 1; |
901 | } | 891 | } |
902 | 892 | ||
903 | static inline int res_locked(struct vivi_dev *dev) | 893 | static int res_locked(struct vivi_dev *dev) |
904 | { | 894 | { |
905 | return (dev->resources); | 895 | return (dev->resources); |
906 | } | 896 | } |