Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Bartlomiej Zolnierkiewicz
On Saturday 12 January 2008, Borislav Petkov wrote: [...] > > > set_disk_ro(floppy->disk, floppy->wp); > > > - page = (idefloppy_flexible_disk_page_t *) (header + 1); > > > - > > > - page->transfer_rate = be16_to_cpu(page->transfer_rate); > > > - page->sector_size =

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Borislav Petkov
[...] > This is not an equivalent transformation: > > header->wp is 0 or 1 > pc.buffer[3] & 0x80 is 0 or 0x80 > > It seems to work fine for ->wp (because it is needlessly defined as 'int') > but may seriously confuse set_disk_ro() and thus bdev_read_only() users. > > Should be fixed to

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Bartlomiej Zolnierkiewicz
On Saturday 12 January 2008, Bartlomiej Zolnierkiewicz wrote: [...] > > - header = (idefloppy_mode_parameter_header_t *) pc.buffer; > > - floppy->wp = header->wp; > > + floppy->wp = pc.buffer[3] & 0x80; > > This is not an equivalent transformation: > > header->wp is 0 or 1 > pc.buffer[3]

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Bartlomiej Zolnierkiewicz
On Friday 11 January 2008, Borislav Petkov wrote: > The driver used to test whether the flexible disk page has changed by > memcmp-ing > it with a cached copy of a previous version of the page from a different remo- > vable medium. Since, according to the SFF-8070i spec, the flexible disk page >

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Bartlomiej Zolnierkiewicz
On Saturday 12 January 2008, Bartlomiej Zolnierkiewicz wrote: [...] - header = (idefloppy_mode_parameter_header_t *) pc.buffer; - floppy-wp = header-wp; + floppy-wp = pc.buffer[3] 0x80; This is not an equivalent transformation: header-wp is 0 or 1 pc.buffer[3] 0x80 is 0 or

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Borislav Petkov
[...] This is not an equivalent transformation: header-wp is 0 or 1 pc.buffer[3] 0x80 is 0 or 0x80 It seems to work fine for -wp (because it is needlessly defined as 'int') but may seriously confuse set_disk_ro() and thus bdev_read_only() users. Should be fixed to '(pc.buffer[3]

Re: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-12 Thread Bartlomiej Zolnierkiewicz
On Saturday 12 January 2008, Borislav Petkov wrote: [...] set_disk_ro(floppy-disk, floppy-wp); - page = (idefloppy_flexible_disk_page_t *) (header + 1); - - page-transfer_rate = be16_to_cpu(page-transfer_rate); - page-sector_size = be16_to_cpu(page-sector_size); - page-cyls =

[PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-11 Thread Borislav Petkov
The driver used to test whether the flexible disk page has changed by memcmp-ing it with a cached copy of a previous version of the page from a different remo- vable medium. Since, according to the SFF-8070i spec, the flexible disk page "specifies parameters relating to the currently installed

[PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page

2008-01-11 Thread Borislav Petkov
The driver used to test whether the flexible disk page has changed by memcmp-ing it with a cached copy of a previous version of the page from a different remo- vable medium. Since, according to the SFF-8070i spec, the flexible disk page specifies parameters relating to the currently installed