Re: [PATCH 05/37] smartpqi: ensure controller is in SIS mode at init

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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;
}



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux