Loading arch/s390/hypfs/hypfs.h +1 −2 Original line number Diff line number Diff line Loading @@ -22,8 +22,7 @@ extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name); extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, __u64 value); extern int hypfs_create_u64(struct dentry *dir, const char *name, __u64 value); extern int hypfs_create_str(struct dentry *dir, const char *name, char *string); Loading arch/s390/hypfs/hypfs_diag_fs.c +10 −10 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info) { struct dentry *cpu_dir; char buffer[TMP_SIZE]; void *rc; int rc; snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_get_info_type(), cpu_info)); Loading @@ -214,18 +214,18 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info) rc = hypfs_create_u64(cpu_dir, "mgmtime", cpu_info__acc_time(diag204_get_info_type(), cpu_info) - cpu_info__lp_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; rc = hypfs_create_u64(cpu_dir, "cputime", cpu_info__lp_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; if (diag204_get_info_type() == DIAG204_INFO_EXT) { rc = hypfs_create_u64(cpu_dir, "onlinetime", cpu_info__online_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; } diag224_idx2name(cpu_info__ctidx(diag204_get_info_type(), cpu_info), buffer); return hypfs_create_str(cpu_dir, "type", buffer); Loading Loading @@ -263,7 +263,7 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info) { struct dentry *cpu_dir; char buffer[TMP_SIZE]; void *rc; int rc; snprintf(buffer, TMP_SIZE, "%i", phys_cpu__cpu_addr(diag204_get_info_type(), cpu_info)); Loading @@ -272,8 +272,8 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info) return PTR_ERR(cpu_dir); rc = hypfs_create_u64(cpu_dir, "mgmtime", phys_cpu__mgm_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; diag224_idx2name(phys_cpu__ctidx(diag204_get_info_type(), cpu_info), buffer); return hypfs_create_str(cpu_dir, "type", buffer); } Loading arch/s390/hypfs/hypfs_vm_fs.c +6 −9 Original line number Diff line number Diff line Loading @@ -19,10 +19,9 @@ #define ATTRIBUTE(dir, name, member) \ do { \ void *rc; \ rc = hypfs_create_u64(dir, name, member); \ if (IS_ERR(rc)) \ return PTR_ERR(rc); \ int rc = hypfs_create_u64(dir, name, member); \ if (rc) \ return rc; \ } while (0) static int hypfs_vm_create_guest(struct dentry *systems_dir, Loading Loading @@ -85,7 +84,7 @@ static int hypfs_vm_create_guest(struct dentry *systems_dir, int hypfs_vm_create_files(struct dentry *root) { struct dentry *dir, *file; struct dentry *dir; struct diag2fc_data *data; unsigned int count = 0; int rc, i; Loading @@ -110,11 +109,9 @@ int hypfs_vm_create_files(struct dentry *root) rc = PTR_ERR(dir); goto failed; } file = hypfs_create_u64(dir, "count", data->lcpus); if (IS_ERR(file)) { rc = PTR_ERR(file); rc = hypfs_create_u64(dir, "count", data->lcpus); if (rc) goto failed; } /* guests */ dir = hypfs_mkdir(root, "systems"); Loading arch/s390/hypfs/inode.c +4 −5 Original line number Diff line number Diff line Loading @@ -377,8 +377,7 @@ static struct dentry *hypfs_create_update_file(struct dentry *dir) return dentry; } struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, __u64 value) int hypfs_create_u64(struct dentry *dir, const char *name, __u64 value) { char *buffer; char tmp[TMP_SIZE]; Loading @@ -387,15 +386,15 @@ struct dentry *hypfs_create_u64(struct dentry *dir, snprintf(tmp, TMP_SIZE, "%llu\n", (unsigned long long int)value); buffer = kstrdup(tmp, GFP_KERNEL); if (!buffer) return ERR_PTR(-ENOMEM); return -ENOMEM; dentry = hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); if (IS_ERR(dentry)) { kfree(buffer); return ERR_PTR(-ENOMEM); return -ENOMEM; } hypfs_add_dentry(dentry); return dentry; return 0; } int hypfs_create_str(struct dentry *dir, const char *name, char *string) Loading Loading
arch/s390/hypfs/hypfs.h +1 −2 Original line number Diff line number Diff line Loading @@ -22,8 +22,7 @@ extern struct dentry *hypfs_mkdir(struct dentry *parent, const char *name); extern struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, __u64 value); extern int hypfs_create_u64(struct dentry *dir, const char *name, __u64 value); extern int hypfs_create_str(struct dentry *dir, const char *name, char *string); Loading
arch/s390/hypfs/hypfs_diag_fs.c +10 −10 Original line number Diff line number Diff line Loading @@ -204,7 +204,7 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info) { struct dentry *cpu_dir; char buffer[TMP_SIZE]; void *rc; int rc; snprintf(buffer, TMP_SIZE, "%d", cpu_info__cpu_addr(diag204_get_info_type(), cpu_info)); Loading @@ -214,18 +214,18 @@ static int hypfs_create_cpu_files(struct dentry *cpus_dir, void *cpu_info) rc = hypfs_create_u64(cpu_dir, "mgmtime", cpu_info__acc_time(diag204_get_info_type(), cpu_info) - cpu_info__lp_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; rc = hypfs_create_u64(cpu_dir, "cputime", cpu_info__lp_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; if (diag204_get_info_type() == DIAG204_INFO_EXT) { rc = hypfs_create_u64(cpu_dir, "onlinetime", cpu_info__online_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; } diag224_idx2name(cpu_info__ctidx(diag204_get_info_type(), cpu_info), buffer); return hypfs_create_str(cpu_dir, "type", buffer); Loading Loading @@ -263,7 +263,7 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info) { struct dentry *cpu_dir; char buffer[TMP_SIZE]; void *rc; int rc; snprintf(buffer, TMP_SIZE, "%i", phys_cpu__cpu_addr(diag204_get_info_type(), cpu_info)); Loading @@ -272,8 +272,8 @@ static int hypfs_create_phys_cpu_files(struct dentry *cpus_dir, void *cpu_info) return PTR_ERR(cpu_dir); rc = hypfs_create_u64(cpu_dir, "mgmtime", phys_cpu__mgm_time(diag204_get_info_type(), cpu_info)); if (IS_ERR(rc)) return PTR_ERR(rc); if (rc) return rc; diag224_idx2name(phys_cpu__ctidx(diag204_get_info_type(), cpu_info), buffer); return hypfs_create_str(cpu_dir, "type", buffer); } Loading
arch/s390/hypfs/hypfs_vm_fs.c +6 −9 Original line number Diff line number Diff line Loading @@ -19,10 +19,9 @@ #define ATTRIBUTE(dir, name, member) \ do { \ void *rc; \ rc = hypfs_create_u64(dir, name, member); \ if (IS_ERR(rc)) \ return PTR_ERR(rc); \ int rc = hypfs_create_u64(dir, name, member); \ if (rc) \ return rc; \ } while (0) static int hypfs_vm_create_guest(struct dentry *systems_dir, Loading Loading @@ -85,7 +84,7 @@ static int hypfs_vm_create_guest(struct dentry *systems_dir, int hypfs_vm_create_files(struct dentry *root) { struct dentry *dir, *file; struct dentry *dir; struct diag2fc_data *data; unsigned int count = 0; int rc, i; Loading @@ -110,11 +109,9 @@ int hypfs_vm_create_files(struct dentry *root) rc = PTR_ERR(dir); goto failed; } file = hypfs_create_u64(dir, "count", data->lcpus); if (IS_ERR(file)) { rc = PTR_ERR(file); rc = hypfs_create_u64(dir, "count", data->lcpus); if (rc) goto failed; } /* guests */ dir = hypfs_mkdir(root, "systems"); Loading
arch/s390/hypfs/inode.c +4 −5 Original line number Diff line number Diff line Loading @@ -377,8 +377,7 @@ static struct dentry *hypfs_create_update_file(struct dentry *dir) return dentry; } struct dentry *hypfs_create_u64(struct dentry *dir, const char *name, __u64 value) int hypfs_create_u64(struct dentry *dir, const char *name, __u64 value) { char *buffer; char tmp[TMP_SIZE]; Loading @@ -387,15 +386,15 @@ struct dentry *hypfs_create_u64(struct dentry *dir, snprintf(tmp, TMP_SIZE, "%llu\n", (unsigned long long int)value); buffer = kstrdup(tmp, GFP_KERNEL); if (!buffer) return ERR_PTR(-ENOMEM); return -ENOMEM; dentry = hypfs_create_file(dir, name, buffer, S_IFREG | REG_FILE_MODE); if (IS_ERR(dentry)) { kfree(buffer); return ERR_PTR(-ENOMEM); return -ENOMEM; } hypfs_add_dentry(dentry); return dentry; return 0; } int hypfs_create_str(struct dentry *dir, const char *name, char *string) Loading