Re: [PATCH 2/4] aacraid: Restart adapter on firmware assert

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

 



> +	if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) {
> +		u32 var;
> +		printk(KERN_ERR "%s%d: adapter kernel panic'd.\n", dev->name, instance);
> +		var = 0;
> +		if ((aac_rkt_check_health(dev) <= 0)
> +		 || rkt_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0,
> +		  &var, NULL, NULL, NULL, NULL)
> +		 || (var != 0x00000001)
> +		 || (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC))
> +			goto error_iounmap;
> +	}

I know you guys hate me for all that nitpicking, but can we write the
if condition in normal kernel style?  Even better untangle it a little
and put it into a helper function:

static int aac_rkt_restart(<args>)
{
	u32 var;

	printk(KERN_ERR "%s%d: adapter kernel panic'd.\n",
		dev->name, instance);
	if (aac_rkt_check_health(dev) <= 0)
		return 1;
	if (rkt_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0,
			&var, NULL, NULL, NULL, NULL)
		return 1;
	if (var != 0x00000001)
		return 1;
	if (rkt_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC)
		return 1;
	return 0;
}

> +	if (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC) {
> +		u32 var;
> +		printk(KERN_ERR "%s%d: adapter kernel panic.\n", dev->name, instance);
> +		var = 0;
> +		if ((aac_rx_check_health(dev) <= 0)
> +		 || rx_sync_cmd(dev, IOP_RESET, 0, 0, 0, 0, 0, 0,
> +		  &var, NULL, NULL, NULL, NULL)
> +		 || (var != 0x00000001)
> +		 || (rx_readl(dev, MUnit.OMRx[0]) & KERNEL_PANIC))
> +			goto error_iounmap;
> +	}

dito

-
: 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

[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