block: fix amiga and atari floppy driver compile warning

Geert, my crosstool don't produce warning below. I guess this has to do
something with compiler version.

- Geert noticed following warning during compilation.

  drivers/block/amiflop.c:1344: warning: ‘rq’ may be used uninitialized in
  this function
  drivers/block/ataflop.c:1402: warning: ‘rq’ may be used uninitialized in
  this function

- Initialize rq to NULL to fix the warning. If we can't find a suitable request
  to dispatch, this function should return NULL instead of a possibly garbage
  pointer.

- Cross compile tested only. Don't have hardware to test it.

Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Vivek Goyal <vgoyal@redhat.com>
Signed-off-by: Jens Axboe <jaxboe@fusionio.com>
This commit is contained in:
Vivek Goyal 2010-11-15 19:32:43 +01:00 committed by Jens Axboe
parent c2f6805d47
commit 3e9bb2a071
2 changed files with 2 additions and 2 deletions

View File

@ -1341,7 +1341,7 @@ static struct request *set_next_request(void)
{ {
struct request_queue *q; struct request_queue *q;
int cnt = FD_MAX_UNITS; int cnt = FD_MAX_UNITS;
struct request *rq; struct request *rq = NULL;
/* Find next queue we can dispatch from */ /* Find next queue we can dispatch from */
fdc_queue = fdc_queue + 1; fdc_queue = fdc_queue + 1;

View File

@ -1399,7 +1399,7 @@ static struct request *set_next_request(void)
{ {
struct request_queue *q; struct request_queue *q;
int old_pos = fdc_queue; int old_pos = fdc_queue;
struct request *rq; struct request *rq = NULL;
do { do {
q = unit[fdc_queue].disk->queue; q = unit[fdc_queue].disk->queue;