lkml.org 
[lkml]   [2008]   [Jan]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH 06/21] ide-floppy: remove struct idefloppy_flexible_disk_page
Date
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 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] & 0x80) ? 1 : 0' (or something similar).

Update: this change belongs to patch #10 (+ the need for such change in
patch #6 is a hint that #10 should be before #6)


\
 
 \ /
  Last update: 2008-01-12 21:23    [W:0.088 / U:0.204 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site