On Wed, 2013-08-28 at 18:07 +0800, Vaughan Cao wrote: > @@ -331,17 +330,20 @@ sg_open(struct inode *inode, struct file *filp) > } > if ((sfp = sg_add_sfp(sdp, dev))) > filp->private_data = sfp; > - else { > + /* retval is already provably zero at this point > because of the > + * check after retval = > scsi_autopm_get_device(sdp->device)) > + */ > + else > + retval = -ENOMEM; > + > + if (retval) { > +sem_out: There's still no need for the double if. You know the value of retval in each of the legs of the first if; its only non zero for the else leg, so you can combine them thus: if ((sfp = sg_add_sfp(sdp, dev))) filp->private_data = sfp; /* retval is already provably zero at this point because of the * check after retval scsi_autopm_get_device(sdp->device)) */ else { retval = -ENOMEM; sem_out: ... James -- To unsubscribe from this list: send the line "unsubscribe linux-scsi" in the body of a message to majordomo@xxxxxxxxxxxxxxx More majordomo info at http://vger.kernel.org/majordomo-info.html