]> err.no Git - linux-2.6/commitdiff
[POWERPC] scsi: Constify & voidify get_property()
authorJeremy Kerr <jk@ozlabs.org>
Wed, 12 Jul 2006 05:40:51 +0000 (15:40 +1000)
committerPaul Mackerras <paulus@samba.org>
Mon, 31 Jul 2006 05:55:05 +0000 (15:55 +1000)
Now that get_property() returns a void *, there's no need to cast its
return value. Also, treat the return value as const, so we can
constify get_property later.

powerpc-specific scsi driver changes.

Signed-off-by: Jeremy Kerr <jk@ozlabs.org>
Signed-off-by: Paul Mackerras <paulus@samba.org>
drivers/scsi/ibmvscsi/rpa_vscsi.c
drivers/scsi/mac53c94.c
drivers/scsi/mesh.c

index 242b8873b33363c26692db97cc36218d5aed378e..cafef9cbbe2eb276008cadb036096939de415ac0 100644 (file)
@@ -156,8 +156,8 @@ static void gather_partition_info(void)
 {
        struct device_node *rootdn;
 
-       char *ppartition_name;
-       unsigned int *p_number_ptr;
+       const char *ppartition_name;
+       const unsigned int *p_number_ptr;
 
        /* Retrieve information about this partition */
        rootdn = find_path_device("/");
@@ -165,14 +165,11 @@ static void gather_partition_info(void)
                return;
        }
 
-       ppartition_name =
-               get_property(rootdn, "ibm,partition-name", NULL);
+       ppartition_name = get_property(rootdn, "ibm,partition-name", NULL);
        if (ppartition_name)
                strncpy(partition_name, ppartition_name,
                                sizeof(partition_name));
-       p_number_ptr =
-               (unsigned int *)get_property(rootdn, "ibm,partition-no",
-                                            NULL);
+       p_number_ptr = get_property(rootdn, "ibm,partition-no", NULL);
        if (p_number_ptr)
                partition_number = *p_number_ptr;
 }
index 93edaa8696cf35e0b54a72dc3cfd266931e2c18b..c77f6f2581f72923ba0367b45eefb2b3b16c748f 100644 (file)
@@ -431,7 +431,7 @@ static int mac53c94_probe(struct macio_dev *mdev, const struct of_device_id *mat
        struct fsc_state *state;
        struct Scsi_Host *host;
        void *dma_cmd_space;
-       unsigned char *clkprop;
+       const unsigned char *clkprop;
        int proplen, rc = -ENODEV;
 
        if (macio_resource_count(mdev) != 2 || macio_irq_count(mdev) != 2) {
index c88717727be8ed58e9cbf23a2b1c376a2819ac09..cee9758b9278a8230cc842aaf0d68aca1c598db7 100644 (file)
@@ -1850,7 +1850,8 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
 {
        struct device_node *mesh = macio_get_of_node(mdev);
        struct pci_dev* pdev = macio_get_pci_dev(mdev);
-       int tgt, *cfp, minper;
+       int tgt, minper;
+       const int *cfp;
        struct mesh_state *ms;
        struct Scsi_Host *mesh_host;
        void *dma_cmd_space;
@@ -1939,7 +1940,7 @@ static int mesh_probe(struct macio_dev *mdev, const struct of_device_id *match)
                ms->tgts[tgt].current_req = NULL;
                }
 
-       if ((cfp = (int *) get_property(mesh, "clock-frequency", NULL)))
+       if ((cfp = get_property(mesh, "clock-frequency", NULL)))
                        ms->clk_freq = *cfp;
        else {
                        printk(KERN_INFO "mesh: assuming 50MHz clock frequency\n");