]> err.no Git - linux-2.6/blobdiff - drivers/scsi/st.c
[SCSI] Mark some core scsi data structures const
[linux-2.6] / drivers / scsi / st.c
index 2913f879231784158eafbfa0a2663e00d6c93e22..6d9078705c5be1221eb5b74e76a3d75cde3b9c6e 100644 (file)
@@ -17,7 +17,7 @@
    Last modified: 18-JAN-1998 Richard Gooch <rgooch@atnf.csiro.au> Devfs support
  */
 
-static char *verstr = "20050830";
+static const char *verstr = "20050830";
 
 #include <linux/module.h>
 
@@ -134,7 +134,7 @@ static struct st_dev_parm {
 #endif
 /* Bit reversed order to get same names for same minors with all
    mode counts */
-static char *st_formats[] = {
+static const char *st_formats[] = {
        "",  "r", "k", "s", "l", "t", "o", "u",
        "m", "v", "p", "x", "a", "y", "q", "z"}; 
 
@@ -4107,8 +4107,7 @@ out_free_tape:
        write_unlock(&st_dev_arr_lock);
 out_put_disk:
        put_disk(disk);
-       if (tpnt)
-               kfree(tpnt);
+       kfree(tpnt);
 out_buffer_free:
        kfree(buffer);
 out:
@@ -4374,7 +4373,7 @@ static void do_create_class_files(struct scsi_tape *STp, int dev_num, int mode)
                snprintf(name, 10, "%s%s%s", rew ? "n" : "",
                         STp->disk->disk_name, st_formats[i]);
                st_class_member =
-                       class_device_create(st_sysfs_class,
+                       class_device_create(st_sysfs_class, NULL,
                                            MKDEV(SCSI_TAPE_MAJOR,
                                                  TAPE_MINOR(dev_num, mode, rew)),
                                            &STp->device->sdev_gendev, "%s", name);
@@ -4510,6 +4509,7 @@ static int sgl_map_user_pages(struct scatterlist *sgl, const unsigned int max_pa
        if (res > 0) {
                for (j=0; j < res; j++)
                        page_cache_release(pages[j]);
+               res = 0;
        }
        kfree(pages);
        return res;
@@ -4523,12 +4523,14 @@ static int sgl_unmap_user_pages(struct scatterlist *sgl, const unsigned int nr_p
        int i;
 
        for (i=0; i < nr_pages; i++) {
-               if (dirtied && !PageReserved(sgl[i].page))
-                       SetPageDirty(sgl[i].page);
+               struct page *page = sgl[i].page;
+
+               if (dirtied)
+                       SetPageDirty(page);
                /* FIXME: cache flush missing for rw==READ
                 * FIXME: call the correct reference counting function
                 */
-               page_cache_release(sgl[i].page);
+               page_cache_release(page);
        }
 
        return 0;