const char *c, *s;
struct efusekey_info info;
unsigned int uint_val;
+ loff_t pos;
if (efuse_getinfo(name, &info) < 0) {
pr_err("%s is not found\n", name);
}
}
- ret = efuse_write_usr(local_buf, info.size, (loff_t *)&(info.offset));
+ pos = ((loff_t)(info.offset)) & 0xffffffff;
+ ret = efuse_write_usr(local_buf, info.size, &pos);
if (ret == -1) {
pr_err("ERROR: efuse write user data fail!\n");
goto error_exit;
ssize_t ret;
int i;
struct efusekey_info info;
+ loff_t pos;
if (efuse_getinfo(name, &info) < 0) {
pr_err("%s is not found\n", name);
local_buf = kzalloc(sizeof(char)*(info.size), GFP_KERNEL);
memset(local_buf, 0, info.size);
- ret = efuse_read_usr(local_buf, info.size, (loff_t *)&(info.offset));
+ pos = ((loff_t)(info.offset)) & 0xffffffff;
+ ret = efuse_read_usr(local_buf, info.size, &pos);
if (ret == -1) {
pr_err("ERROR: efuse read user data fail!\n");
goto error_exit;
loff_t offset;
unsigned int max_size;
- max_size = efuse_get_max();
+ ret = efuse_get_max();
+ if (ret < 0) {
+ pr_err("efuse: failed to get max size\n");
+ return -1;
+ }
+ max_size = (unsigned int)ret;
op = kmalloc_array(max_size, sizeof(char), GFP_KERNEL);
if (!op) {
char *op = NULL;
unsigned int max_size;
- max_size = efuse_get_max();
+ ret = efuse_get_max();
+ if (ret < 0) {
+ pr_err("efuse: failed to get max size\n");
+ return -1;
+ }
+ max_size = (unsigned int)ret;
+
op = kzalloc((sizeof(char)*max_size), GFP_KERNEL);
if (!op) {
pr_err("efuse: failed to allocate memory\n");