Re: [PATCH] fix error return get/set_native_max functions

From: Bartlomiej Zolnierkiewicz (B.Zolnierkiewicz@elka.pw.edu.pl)
Date: Tue Aug 05 2003 - 13:54:44 EST


On Tue, 5 Aug 2003 Andries.Brouwer@cwi.nl wrote:

> In ide-disk.c we have functions
> idedisk_read_native_max_address
> idedisk_read_native_max_address_ext
> idedisk_set_max_address
> idedisk_set_max_address_ext
> that are documented as
>
> /*
> * Sets maximum virtual LBA address of the drive.
> * Returns new maximum virtual LBA address (> 0) or 0 on failure.
> */
>
> The IDE command they execute returns the largest address,
> and 1 is added to get the capacity.
> Unfortunately, the code does
>
> addr = 0;
> if (ide_command_succeeds) {
> addr = ...
> }
> addr++;
>
> so that the return value on error is 1 instead of 0.
> The patch below moves the addr++.
>
> Andries

This change is okay, thanks.

However changing coding style is not...

> @@ -1002,7 +1003,8 @@
> * Sets maximum virtual LBA address of the drive.
> * Returns new maximum virtual LBA address (> 0) or 0 on failure.
> */
> -static unsigned long idedisk_set_max_address(ide_drive_t *drive, unsigned long addr_req)
> +static unsigned long
> +idedisk_set_max_address(ide_drive_t *drive, unsigned long addr_req)
> {
> ide_task_t args;
> unsigned long addr_set = 0;

--
Bartlomiej

- 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/



This archive was generated by hypermail 2b29 : Thu Aug 07 2003 - 22:00:30 EST