patch-2.0.24 linux/drivers/cdrom/cdu31a.c

Next file: linux/drivers/char/selection.c
Previous file: linux/drivers/block/umc8672.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.0.23/linux/drivers/cdrom/cdu31a.c linux/drivers/cdrom/cdu31a.c
@@ -1915,7 +1915,9 @@
    int num_tracks;
 
 
-   num_tracks = sony_toc.last_track_num - sony_toc.first_track_num + 1;
+   num_tracks = (  bcd_to_int(sony_toc.last_track_num)
+                 - bcd_to_int(sony_toc.first_track_num)
+		 + 1);
    for (i = 0; i < num_tracks; i++)
    {
       if (sony_toc.tracks[i].track == track)
@@ -2486,8 +2488,8 @@
          i=verify_area(VERIFY_WRITE, hdr, sizeof(*hdr));
          if(i<0)
          	return i;
-         loc_hdr.cdth_trk0 = sony_toc.first_track_num;
-         loc_hdr.cdth_trk1 = sony_toc.last_track_num;
+         loc_hdr.cdth_trk0 = bcd_to_int(sony_toc.first_track_num);
+         loc_hdr.cdth_trk1 = bcd_to_int(sony_toc.last_track_num);
          memcpy_tofs(hdr, &loc_hdr, sizeof(*hdr));
       }
       return 0;
@@ -2567,8 +2569,8 @@
          	return i;
          
          memcpy_fromfs(&ti, (char *) arg, sizeof(ti));
-         if (   (ti.cdti_trk0 < sony_toc.first_track_num)
-             || (ti.cdti_trk0 > sony_toc.last_track_num)
+         if (   (ti.cdti_trk0 < bcd_to_int(sony_toc.first_track_num))
+             || (ti.cdti_trk0 > bcd_to_int(sony_toc.last_track_num))
              || (ti.cdti_trk1 < ti.cdti_trk0))
          {
             return -EINVAL;
@@ -2587,7 +2589,7 @@
           * If we want to stop after the last track, use the lead-out
           * MSF to do that.
           */
-         if (ti.cdti_trk1 >= sony_toc.last_track_num)
+         if (ti.cdti_trk1 >= bcd_to_int(sony_toc.last_track_num))
          {
             log_to_msf(msf_to_log(sony_toc.lead_out_start_msf)-1,
                        &(params[4]));

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov