On Tue, 2017-04-25 at 14:46 -0500, Don Brace wrote:
> +bool sis_is_kernel_up(struct pqi_ctrl_info *ctrl_info)
> +{
> +     u32 status;
> +     bool kernel_up;
> +
> +     status = readl(&ctrl_info->registers->sis_firmware_status);
> +
> +     if (status & SIS_CTRL_KERNEL_UP)
> +             kernel_up = true;
> +     else
> +             kernel_up = false;
> +
> +     return kernel_up;
> +}

Since bool is a synonym for the C11 type _Bool, it is not necessary to
convert explicitly to a truth value. The above code can be simplified into:

bool sis_is_kernel_up(struct pqi_ctrl_info *ctrl_info)
{
        return readl(&ctrl_info->registers->sis_firmware_status) &
                SIS_CTRL_KERNEL_UP;
}

Reply via email to