Re: 2.5.1pre6 compile error

David C. Hansen (haveblue@us.ibm.com)
Fri, 07 Dec 2001 13:48:57 -0800


This is a multi-part message in MIME format.
--------------020100040404030705050404
Content-Type: text/plain; charset=us-ascii; format=flowed
Content-Transfer-Encoding: 7bit

Jens Axboe wrote:

>On Fri, Dec 07 2001, Martin A. Brooks wrote:
>
>>gcc -D__KERNEL__ -I/home/martin/kernel-a-day-club/linux/include -Wall
>>-Wstrict-prototypes -Wno-trigraphs -O2 -fomit-frame-pointer
>>-fno-strict-aliasing -fno-common -pipe -mpreferred-stack-boundary=2
>>-march=i686 -c -o ps2esdi.o ps2esdi.c
>>ps2esdi.c: In function `do_ps2esdi_request':
>>ps2esdi.c:498: switch quantity not an integer
>>ps2esdi.c:500: warning: unreachable code at beginning of switch
>>statement
>>make[3]: *** [ps2esdi.o] Error 1
>>
>Please take a look at the rq->cmd -> rq->flags changes. Then understand
>them. Then fix ps2 and send me a diff, thanks.
>
Jens,
It looks like in the rest of the code, you replaced CURRENT->cmd with
rq_data_dir(CURRENT). I've attached a patch that does this for
ps2esdi.c. Those old PS/2 machines are real workhorses. I still have a
few of them running.

--
Dave

--------------020100040404030705050404 Content-Type: text/plain; name="ps2esdi_cmd_fix.patch" Content-Transfer-Encoding: 7bit Content-Disposition: inline; filename="ps2esdi_cmd_fix.patch"

--- linux-2.5.1-pre6/drivers/block/ps2esdi.c Fri Nov 30 17:40:03 2001 +++ linux/drivers/block/ps2esdi.c Fri Dec 7 11:22:29 2001 @@ -466,10 +466,10 @@ sti(); #if 0 - printk("%s:got request. device : %d minor : %d command : %d sector : %ld count : %ld, buffer: %p\n", + printk("%s:got request. device : %d minor : %d flags : %d sector : %ld count : %ld, buffer: %p\n", DEVICE_NAME, CURRENT_DEV, MINOR(CURRENT->rq_dev), - CURRENT->cmd, CURRENT->sector, + rq_data_dir(CURRENT), CURRENT->sector, CURRENT->current_nr_sectors, CURRENT->buffer); #endif @@ -485,17 +485,17 @@ (CURRENT->sector + CURRENT->current_nr_sectors <= ps2esdi[MINOR(CURRENT->rq_dev)].nr_sects)) { #if 0 - printk("%s:got request. device : %d minor : %d command : %d sector : %ld count : %ld\n", + printk("%s:got request. device : %d minor : %d flags : %d sector : %ld count : %ld\n", DEVICE_NAME, CURRENT_DEV, MINOR(CURRENT->rq_dev), - CURRENT->cmd, CURRENT->sector, + rq_data_dir(CURRENT), CURRENT->sector, CURRENT->current_nr_sectors); #endif block = CURRENT->sector; count = CURRENT->current_nr_sectors; - switch (CURRENT->cmd) { + switch (rq_data_dir(CURRENT)) { case READ: ps2esdi_readwrite(READ, CURRENT_DEV, block, count); break; @@ -850,7 +850,7 @@ switch (int_ret_code & 0x0f) { case INT_TRANSFER_REQ: ps2esdi_prep_dma(CURRENT->buffer, CURRENT->current_nr_sectors, - (CURRENT->cmd == READ) + ( rq_data_dir(CURRENT) == READ) ? MCA_DMA_MODE_16 | MCA_DMA_MODE_WRITE | MCA_DMA_MODE_XFER : MCA_DMA_MODE_16 | MCA_DMA_MODE_READ); outb(CTRL_ENABLE_DMA | CTRL_ENABLE_INTR, ESDI_CONTROL);

--------------020100040404030705050404--

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/