lkml.org 
[lkml]   [1996]   [Nov]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    Date
    From
    SubjectRe: 2.1.10 FYI

    On Sat, 16 Nov 1996, Gerd Knorr wrote:

    > > The ide-cd driver simply adds a cast to suppress the compiler warning.

    > > ---> *(int *)&devinfo->speed = 0;
    > > ---> *(int *)&devinfo->capacity = nslots;

    > + (int)scsi_CDs[i].cdi.speed = 1;
    > + (int)scsi_CDs[i].cdi.capacity = 1;

    Aargh! Tried to make it better, but forgot to reverse the ucdrom.h changes
    before trying if it works :-(

    Is'nt there a way to get around this read-only warning with a simple cast?
    I don't like this complicated reference-cast-dereference construct just
    for avoiding a warning...

    Anyway, here is the *working* version.

    Gerd

    --------------------------------------------------------------------
    --- linux/drivers/scsi/sr.c-2.1.10 Sat Nov 16 09:17:18 1996
    +++ linux/drivers/scsi/sr.c Sat Nov 16 15:10:51 1996
    @@ -793,8 +793,8 @@
    scsi_CDs[i].cdi.handle = &scsi_CDs[i];
    scsi_CDs[i].cdi.dev = MKDEV(MAJOR_NR,i);
    scsi_CDs[i].cdi.mask = 0;
    - scsi_CDs[i].cdi.speed = 1;
    - scsi_CDs[i].cdi.capacity = 1;
    + *(int*)&scsi_CDs[i].cdi.speed = 1;
    + *(int*)&scsi_CDs[i].cdi.capacity = 1;
    register_cdrom(&scsi_CDs[i].cdi, "sr");

    #ifdef CONFIG_BLK_DEV_SR_VENDOR

    \
     
     \ /
      Last update: 2005-03-22 13:38    [W:0.017 / U:30.120 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site