!377 perf: assign '-1' to uninitialized variable: ret

Merge pull request !377 from Joker2770/master
This commit is contained in:
openharmony_ci 2021-07-12 00:55:51 +00:00 committed by Gitee
commit d8be8aad65
1 changed files with 2 additions and 2 deletions

View File

@ -65,7 +65,7 @@ static int RandomHwClose(struct file *filep)
static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg) static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg)
{ {
int ret; int ret = -1;
switch (cmd) { switch (cmd) {
default: default:
@ -77,7 +77,7 @@ static int RandomHwIoctl(struct file *filep, int cmd, unsigned long arg)
static ssize_t RandomHwRead(struct file *filep, char *buffer, size_t buflen) static ssize_t RandomHwRead(struct file *filep, char *buffer, size_t buflen)
{ {
int ret; int ret = -1;
if (g_randomOp.read != NULL) { if (g_randomOp.read != NULL) {
ret = g_randomOp.read(buffer, buflen); ret = g_randomOp.read(buffer, buflen);