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

2017-05-03 Thread Don Brace
> -Original Message-
> From: Bart Van Assche [mailto:bart.vanass...@sandisk.com]
> Sent: Tuesday, April 25, 2017 2:58 PM
> To: h...@infradead.org; Viswas G <viswa...@microsemi.com>; Gerry
> Morong <gerry.mor...@microsemi.com>; Mahesh Rajashekhara
> <mahesh.rajashekh...@microsemi.com>; posw...@suse.com; Scott
> Benesh <scott.ben...@microsemi.com>; Don Brace
> <don.br...@microsemi.com>; Bader Ali - Saleh
> <bader.alisa...@microsemi.com>; Kevin Barnett
> <kevin.barn...@microsemi.com>; joseph.szczy...@hpe.com; Scott Teel
> <scott.t...@microsemi.com>; j...@linux.vnet.ibm.com; Justin Lindley
> <justin.lind...@microsemi.com>; John Hall <john.h...@microsemi.com>
> Cc: linux-scsi@vger.kernel.org
> Subject: Re: [PATCH 05/37] smartpqi: ensure controller is in SIS mode at init
> 
> EXTERNAL EMAIL
> 
> 
> 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(_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(_info->registers->sis_firmware_status) &
> SIS_CTRL_KERNEL_UP;
> }

Done
Thanks for your review

Thanks,
Don Brace
ESC - Smart Storage
Microsemi Corporation




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

2017-04-25 Thread Bart Van Assche
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(_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(_info->registers->sis_firmware_status) &
SIS_CTRL_KERNEL_UP;
}