Merge branch 'master' into for_paulus
[linux-drm-fsl-dcu.git] / arch / powerpc / kernel / nvram_64.c
index fd7db8d542db0a75dd9da1f34d10c525c6723bcc..f9676f52c6d8c58ec70de146c7fd88d8e5f51db4 100644 (file)
@@ -160,7 +160,7 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
        case IOC_NVRAM_GET_OFFSET: {
                int part, offset;
 
-               if (_machine != PLATFORM_POWERMAC)
+               if (!machine_is(powermac))
                        return -EINVAL;
                if (copy_from_user(&part, (void __user*)arg, sizeof(part)) != 0)
                        return -EFAULT;
@@ -174,11 +174,12 @@ static int dev_nvram_ioctl(struct inode *inode, struct file *file,
                return 0;
        }
 #endif /* CONFIG_PPC_PMAC */
+       default:
+               return -EINVAL;
        }
-       return -EINVAL;
 }
 
-struct file_operations nvram_fops = {
+const struct file_operations nvram_fops = {
        .owner =        THIS_MODULE,
        .llseek =       dev_nvram_llseek,
        .read =         dev_nvram_read,
@@ -203,7 +204,7 @@ static void nvram_print_partitions(char * label)
        printk(KERN_WARNING "indx\t\tsig\tchks\tlen\tname\n");
        list_for_each(p, &nvram_part->partition) {
                tmp_part = list_entry(p, struct nvram_partition, partition);
-               printk(KERN_WARNING "%d    \t%02x\t%02x\t%d\t%s\n",
+               printk(KERN_WARNING "%4d    \t%02x\t%02x\t%d\t%s\n",
                       tmp_part->index, tmp_part->header.signature,
                       tmp_part->header.checksum, tmp_part->header.length,
                       tmp_part->header.name);
@@ -443,7 +444,7 @@ static int nvram_setup_partition(void)
         * in our nvram, as Apple defined partitions use pretty much
         * all of the space
         */
-       if (_machine == PLATFORM_POWERMAC)
+       if (machine_is(powermac))
                return -ENOSPC;
 
        /* see if we have an OS partition that meets our needs.
@@ -504,7 +505,7 @@ static int nvram_scan_partitions(void)
                return -ENODEV;
        total_size = ppc_md.nvram_size();
        
-       header = (char *) kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
+       header = kmalloc(NVRAM_HEADER_LEN, GFP_KERNEL);
        if (!header) {
                printk(KERN_ERR "nvram_scan_partitions: Failed kmalloc\n");
                return -ENOMEM;
@@ -573,7 +574,7 @@ static int __init nvram_init(void)
        }
        
        /* initialize our anchor for the nvram partition list */
-       nvram_part = (struct nvram_partition *) kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
+       nvram_part = kmalloc(sizeof(struct nvram_partition), GFP_KERNEL);
        if (!nvram_part) {
                printk(KERN_ERR "nvram_init: Failed kmalloc\n");
                return -ENOMEM;