spin_lock_irqsave(&vhbainfo->privlock, flags);
insert_location = vhbainfo->nextinsert;
- while (vhbainfo->pending[insert_location].sent != NULL) {
+ while (vhbainfo->pending[insert_location].sent) {
insert_location = (insert_location + 1) % MAX_PENDING_REQUESTS;
if (insert_location == (int)vhbainfo->nextinsert) {
spin_unlock_irqrestore(&vhbainfo->privlock, flags);
u64 mask;
unsigned long long rc1;
- if (virthbainfo == NULL)
+ if (!virthbainfo)
return IRQ_NONE;
virthbainfo->interrupts_rcvd++;
channel_header = virthbainfo->chinfo.queueinfo->chan;
*/
scsihost = scsi_host_alloc(&virthba_driver_template,
sizeof(struct virthba_info));
- if (scsihost == NULL)
+ if (!scsihost)
return -ENODEV;
scsihost->this_id = UIS_MAGIC_VHBA;
virthbainfo = (struct virthba_info *)scsihost->hostdata;
memset(virthbainfo, 0, sizeof(struct virthba_info));
for (i = 0; i < VIRTHBASOPENMAX; i++) {
- if (virthbas_open[i].virthbainfo == NULL) {
+ if (!virthbas_open[i].virthbainfo) {
virthbas_open[i].virthbainfo = virthbainfo;
break;
}
return FAILED;
cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
- if (cmdrsp == NULL)
+ if (!cmdrsp)
return FAILED; /* reject */
init_waitqueue_head(¬ifyevent);
return FAILED;
cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
- if (cmdrsp == NULL)
- return FAILED; /* reject */
+ if (!cmdrsp)
+ return FAILED; /* reject */
init_waitqueue_head(¬ifyevent);
if (virthbainfo->serverdown || virthbainfo->serverchangingstate)
return SCSI_MLQUEUE_DEVICE_BUSY;
cmdrsp = kzalloc(SIZEOF_CMDRSP, GFP_ATOMIC);
- if (cmdrsp == NULL)
+ if (!cmdrsp)
return 1; /* reject the command */
/* now saving everything we need from scsi_cmd into cmdrsp
UIS_DAEMONIZE("vhba_incoming");
/* alloc once and reuse */
cmdrsp = kmalloc(SZ, GFP_ATOMIC);
- if (cmdrsp == NULL) {
+ if (!cmdrsp) {
complete_and_exit(&dc->threadinfo.has_stopped, 0);
return 0;
}
return -ENOMEM;
for (i = 0; i < VIRTHBASOPENMAX; i++) {
- if (virthbas_open[i].virthbainfo == NULL)
+ if (!virthbas_open[i].virthbainfo)
continue;
virthbainfo = virthbas_open[i].virthbainfo;
/* set all counts to new_value usually 0 */
for (i = 0; i < VIRTHBASOPENMAX; i++) {
- if (virthbas_open[i].virthbainfo != NULL) {
+ if (virthbas_open[i].virthbainfo) {
virthbainfo = virthbas_open[i].virthbainfo;
features_addr =
&virthbainfo->chinfo.queueinfo->chan->features;
char *next = line;
POSTCODE_LINUX_2(VHBA_CREATE_ENTRY_PC, POSTCODE_SEVERITY_INFO);
- if (line == NULL || !*line)
+ if (!line || !*line)
return;
- while ((line = next) != NULL) {
+ while ((line = next)) {
next = strchr(line, ' ');
- if (next != NULL)
+ if (next)
*next++ = 0;
virthba_parse_line(line);
}
/* Initialize the serverdown workqueue */
virthba_serverdown_workqueue =
create_singlethread_workqueue("virthba_serverdown");
- if (virthba_serverdown_workqueue == NULL) {
+ if (!virthba_serverdown_workqueue) {
POSTCODE_LINUX_2(VHBA_CREATE_FAILURE_PC,
POSTCODE_SEVERITY_ERR);
error = -1;