Changeset View
Changeset View
Standalone View
Standalone View
sys/dev/efidev/efidev.c
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Lines | |||||
static int | static int | ||||
efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, | efidev_ioctl(struct cdev *dev __unused, u_long cmd, caddr_t addr, | ||||
int flags __unused, struct thread *td __unused) | int flags __unused, struct thread *td __unused) | ||||
{ | { | ||||
int error; | int error; | ||||
switch (cmd) { | switch (cmd) { | ||||
case EFIIOC_GET_TABLE: | |||||
{ | |||||
struct efi_get_table_ioc *egtioc = | |||||
(struct efi_get_table_ioc *)addr; | |||||
void *buf = NULL; | |||||
error = efi_copy_table(&egtioc->uuid, egtioc->buf ? &buf : NULL, | |||||
kib: extra (), this should be written as
```
error = efi_copy_table(&egtioc->uuid, egtioc->buf !=… | |||||
Not Done Inline Actions...->buf != NULL ? ... kib: `...->buf != NULL ? ...` | |||||
egtioc->buf_len, &egtioc->table_len); | |||||
Not Done Inline ActionsIndent for continuation line should be +4 spaces. kib: Indent for continuation line should be +4 spaces. | |||||
if (error != 0 || egtioc->buf == NULL) { | |||||
break; | |||||
} | |||||
if (egtioc->buf_len < egtioc->table_len) { | |||||
Not Done Inline ActionsThis is probably too strict, why not buf_len >= table_len? kib: This is probably too strict, why not buf_len >= table_len? | |||||
error = EINVAL; | |||||
free(buf, M_TEMP); | |||||
break; | |||||
} | |||||
error = copyout(buf, egtioc->buf, egtioc->buf_len); | |||||
free(buf, M_TEMP); | |||||
break; | |||||
} | |||||
case EFIIOC_GET_TIME: | case EFIIOC_GET_TIME: | ||||
{ | { | ||||
struct efi_tm *tm = (struct efi_tm *)addr; | struct efi_tm *tm = (struct efi_tm *)addr; | ||||
error = efi_get_time(tm); | error = efi_get_time(tm); | ||||
break; | break; | ||||
} | } | ||||
case EFIIOC_SET_TIME: | case EFIIOC_SET_TIME: | ||||
▲ Show 20 Lines • Show All 149 Lines • Show Last 20 Lines |
extra (), this should be written as