Commit 53cea34b authored by Michael Ellerman's avatar Michael Ellerman

powerpc/secvar: Use u64 in secvar_operations

There's no reason for secvar_operations to use uint64_t vs the more
common kernel type u64.

The types are compatible, but they require different printk format
strings which can lead to confusion.

Change all the secvar related routines to use u64.
Reviewed-by: default avatarRussell Currey <ruscur@russell.cc>
Reviewed-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarAndrew Donnellan <ajd@linux.ibm.com>
Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
Link: https://lore.kernel.org/r/20230210080401.345462-5-ajd@linux.ibm.com
parent c9fd2952
...@@ -14,12 +14,9 @@ ...@@ -14,12 +14,9 @@
extern const struct secvar_operations *secvar_ops; extern const struct secvar_operations *secvar_ops;
struct secvar_operations { struct secvar_operations {
int (*get)(const char *key, uint64_t key_len, u8 *data, int (*get)(const char *key, u64 key_len, u8 *data, u64 *data_size);
uint64_t *data_size); int (*get_next)(const char *key, u64 *key_len, u64 keybufsize);
int (*get_next)(const char *key, uint64_t *key_len, int (*set)(const char *key, u64 key_len, u8 *data, u64 data_size);
uint64_t keybufsize);
int (*set)(const char *key, uint64_t key_len, u8 *data,
uint64_t data_size);
}; };
#ifdef CONFIG_PPC_SECURE_BOOT #ifdef CONFIG_PPC_SECURE_BOOT
......
...@@ -47,7 +47,7 @@ static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr, ...@@ -47,7 +47,7 @@ static ssize_t format_show(struct kobject *kobj, struct kobj_attribute *attr,
static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr, static ssize_t size_show(struct kobject *kobj, struct kobj_attribute *attr,
char *buf) char *buf)
{ {
uint64_t dsize; u64 dsize;
int rc; int rc;
rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize);
...@@ -64,8 +64,8 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj, ...@@ -64,8 +64,8 @@ static ssize_t data_read(struct file *filep, struct kobject *kobj,
struct bin_attribute *attr, char *buf, loff_t off, struct bin_attribute *attr, char *buf, loff_t off,
size_t count) size_t count)
{ {
uint64_t dsize;
char *data; char *data;
u64 dsize;
int rc; int rc;
rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize); rc = secvar_ops->get(kobj->name, strlen(kobj->name) + 1, NULL, &dsize);
...@@ -166,9 +166,9 @@ static int update_kobj_size(void) ...@@ -166,9 +166,9 @@ static int update_kobj_size(void)
static int secvar_sysfs_load(void) static int secvar_sysfs_load(void)
{ {
char *name;
uint64_t namesize = 0;
struct kobject *kobj; struct kobject *kobj;
u64 namesize = 0;
char *name;
int rc; int rc;
name = kzalloc(NAME_MAX_SIZE, GFP_KERNEL); name = kzalloc(NAME_MAX_SIZE, GFP_KERNEL);
......
...@@ -54,8 +54,7 @@ static int opal_status_to_err(int rc) ...@@ -54,8 +54,7 @@ static int opal_status_to_err(int rc)
return err; return err;
} }
static int opal_get_variable(const char *key, uint64_t ksize, static int opal_get_variable(const char *key, u64 ksize, u8 *data, u64 *dsize)
u8 *data, uint64_t *dsize)
{ {
int rc; int rc;
...@@ -71,8 +70,7 @@ static int opal_get_variable(const char *key, uint64_t ksize, ...@@ -71,8 +70,7 @@ static int opal_get_variable(const char *key, uint64_t ksize,
return opal_status_to_err(rc); return opal_status_to_err(rc);
} }
static int opal_get_next_variable(const char *key, uint64_t *keylen, static int opal_get_next_variable(const char *key, u64 *keylen, u64 keybufsize)
uint64_t keybufsize)
{ {
int rc; int rc;
...@@ -88,8 +86,7 @@ static int opal_get_next_variable(const char *key, uint64_t *keylen, ...@@ -88,8 +86,7 @@ static int opal_get_next_variable(const char *key, uint64_t *keylen,
return opal_status_to_err(rc); return opal_status_to_err(rc);
} }
static int opal_set_variable(const char *key, uint64_t ksize, u8 *data, static int opal_set_variable(const char *key, u64 ksize, u8 *data, u64 dsize)
uint64_t dsize)
{ {
int rc; int rc;
......
...@@ -18,7 +18,7 @@ ...@@ -18,7 +18,7 @@
/* /*
* Get a certificate list blob from the named secure variable. * Get a certificate list blob from the named secure variable.
*/ */
static __init void *get_cert_list(u8 *key, unsigned long keylen, uint64_t *size) static __init void *get_cert_list(u8 *key, unsigned long keylen, u64 *size)
{ {
int rc; int rc;
void *db; void *db;
...@@ -51,7 +51,7 @@ static __init void *get_cert_list(u8 *key, unsigned long keylen, uint64_t *size) ...@@ -51,7 +51,7 @@ static __init void *get_cert_list(u8 *key, unsigned long keylen, uint64_t *size)
static int __init load_powerpc_certs(void) static int __init load_powerpc_certs(void)
{ {
void *db = NULL, *dbx = NULL; void *db = NULL, *dbx = NULL;
uint64_t dbsize = 0, dbxsize = 0; u64 dbsize = 0, dbxsize = 0;
int rc = 0; int rc = 0;
struct device_node *node; struct device_node *node;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment