[PATCH] ll_rw_blk.c: fix sparse warnings

From: Victor Fusco <victor@cetuc.puc-rio.br>

Fix the sparse warning "implicit cast to nocast type"

Signed-off-by: Victor Fusco <victor@cetuc.puc-rio.br>
Signed-off-by: Alexey Dobriyan <adobriyan@gmail.com>

Index: linux-kj/drivers/block/ll_rw_blk.c
===================================================================
--- linux-kj.orig/drivers/block/ll_rw_blk.c	2005-09-03 14:19:55.000000000 +0400
+++ linux-kj/drivers/block/ll_rw_blk.c	2005-09-03 14:32:54.000000000 +0400
@@ -1651,13 +1651,14 @@ static int blk_init_free_list(request_qu
 
 static int __make_request(request_queue_t *, struct bio *);
 
-request_queue_t *blk_alloc_queue(int gfp_mask)
+request_queue_t *blk_alloc_queue(unsigned int __nocast gfp_mask)
 {
 	return blk_alloc_queue_node(gfp_mask, -1);
 }
 EXPORT_SYMBOL(blk_alloc_queue);
 
-request_queue_t *blk_alloc_queue_node(int gfp_mask, int node_id)
+request_queue_t *blk_alloc_queue_node(unsigned int __nocast gfp_mask,
+                                      int node_id)
 {
 	request_queue_t *q;
 
@@ -1786,7 +1787,8 @@ static inline void blk_free_request(requ
 }
 
 static inline struct request *
-blk_alloc_request(request_queue_t *q, int rw, struct bio *bio, int gfp_mask)
+blk_alloc_request(request_queue_t *q, int rw, struct bio *bio,
+                  unsigned int __nocast gfp_mask)
 {
 	struct request *rq = mempool_alloc(q->rq.rq_pool, gfp_mask);
 
@@ -1884,7 +1886,7 @@ static void freed_request(request_queue_
  * Returns !NULL on success, with queue_lock *not held*.
  */
 static struct request *get_request(request_queue_t *q, int rw, struct bio *bio,
-				   int gfp_mask)
+				   unsigned int __nocast gfp_mask)
 {
 	struct request *rq = NULL;
 	struct request_list *rl = &q->rq;
@@ -2018,7 +2020,8 @@ static struct request *get_request_wait(
 	return rq;
 }
 
-struct request *blk_get_request(request_queue_t *q, int rw, int gfp_mask)
+struct request *blk_get_request(request_queue_t *q, int rw,
+                                unsigned int __nocast gfp_mask)
 {
 	struct request *rq;
 
@@ -3297,7 +3300,7 @@ void exit_io_context(void)
  * but since the current task itself holds a reference, the context can be
  * used in general code, so long as it stays within `current` context.
  */
-struct io_context *current_io_context(int gfp_flags)
+struct io_context *current_io_context( unsigned int __nocast gfp_flags)
 {
 	struct task_struct *tsk = current;
 	struct io_context *ret;
@@ -3328,7 +3331,7 @@ EXPORT_SYMBOL(current_io_context);
  *
  * This is always called in the context of the task which submitted the I/O.
  */
-struct io_context *get_io_context(int gfp_flags)
+struct io_context *get_io_context(unsigned int __nocast gfp_flags)
 {
 	struct io_context *ret;
 	ret = current_io_context(gfp_flags);
Index: linux-kj/include/linux/blkdev.h
===================================================================
--- linux-kj.orig/include/linux/blkdev.h	2005-09-03 14:20:10.000000000 +0400
+++ linux-kj/include/linux/blkdev.h	2005-09-03 14:32:54.000000000 +0400
@@ -96,8 +96,8 @@ struct io_context {
 
 void put_io_context(struct io_context *ioc);
 void exit_io_context(void);
-struct io_context *current_io_context(int gfp_flags);
-struct io_context *get_io_context(int gfp_flags);
+struct io_context *current_io_context(unsigned int __nocast gfp_flags);
+struct io_context *get_io_context(unsigned int __nocast gfp_flags);
 void copy_io_context(struct io_context **pdst, struct io_context **psrc);
 void swap_io_context(struct io_context **ioc1, struct io_context **ioc2);
 
@@ -550,7 +550,7 @@ extern void generic_make_request(struct 
 extern void blk_put_request(struct request *);
 extern void blk_end_sync_rq(struct request *rq);
 extern void blk_attempt_remerge(request_queue_t *, struct request *);
-extern struct request *blk_get_request(request_queue_t *, int, int);
+extern struct request *blk_get_request(request_queue_t *, int, unsigned int __nocast);
 extern void blk_insert_request(request_queue_t *, struct request *, int, void *);
 extern void blk_requeue_request(request_queue_t *, struct request *);
 extern void blk_plug_device(request_queue_t *);
@@ -652,8 +652,8 @@ extern void blk_wait_queue_drained(reque
 extern void blk_finish_queue_drain(request_queue_t *);
 
 int blk_get_queue(request_queue_t *);
-request_queue_t *blk_alloc_queue(int gfp_mask);
-request_queue_t *blk_alloc_queue_node(int,int);
+request_queue_t *blk_alloc_queue(unsigned int __nocast gfp_mask);
+request_queue_t *blk_alloc_queue_node(unsigned int __nocast, int);
 #define blk_put_queue(q) blk_cleanup_queue((q))
 
 /*
Index: linux-kj/include/linux/elevator.h
===================================================================
--- linux-kj.orig/include/linux/elevator.h	2005-09-03 14:20:09.000000000 +0400
+++ linux-kj/include/linux/elevator.h	2005-09-03 14:32:54.000000000 +0400
@@ -18,7 +18,8 @@ typedef struct request *(elevator_reques
 typedef void (elevator_completed_req_fn) (request_queue_t *, struct request *);
 typedef int (elevator_may_queue_fn) (request_queue_t *, int, struct bio *);
 
-typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *, int);
+typedef int (elevator_set_req_fn) (request_queue_t *, struct request *, struct bio *,
+                                   unsigned int __nocast);
 typedef void (elevator_put_req_fn) (request_queue_t *, struct request *);
 typedef void (elevator_deactivate_req_fn) (request_queue_t *, struct request *);
 
@@ -98,7 +99,8 @@ extern int elv_register_queue(request_qu
 extern void elv_unregister_queue(request_queue_t *q);
 extern int elv_may_queue(request_queue_t *, int, struct bio *);
 extern void elv_completed_request(request_queue_t *, struct request *);
-extern int elv_set_request(request_queue_t *, struct request *, struct bio *, int);
+extern int elv_set_request(request_queue_t *, struct request *, struct bio *,
+                           unsigned int __nocast);
 extern void elv_put_request(request_queue_t *, struct request *);
 
 /*
Index: linux-kj/drivers/block/elevator.c
===================================================================
--- linux-kj.orig/drivers/block/elevator.c	2005-09-03 14:19:55.000000000 +0400
+++ linux-kj/drivers/block/elevator.c	2005-09-03 14:32:54.000000000 +0400
@@ -487,7 +487,7 @@ struct request *elv_former_request(reque
 }
 
 int elv_set_request(request_queue_t *q, struct request *rq, struct bio *bio,
-		    int gfp_mask)
+		    unsigned int __nocast gfp_mask)
 {
 	elevator_t *e = q->elevator;
 
