Messages in this thread | | | Date | Tue, 5 Aug 2003 20:54:44 +0200 (MET DST) | From | Bartlomiej Zolnierkiewicz <> | Subject | Re: [PATCH] fix error return get/set_native_max functions |
| |
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/
| |