if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid)) 
if ((remoteLp >= HVMAXARCHITECTEDLPS) || (remoteLp == HvLpIndexInvalid)) 
int viopath_open(HvLpIndex remoteLp, int subtype, int numReq){	int i;	unsigned long flags;	int tempNumAllocated;	if ((remoteLp >= HvMaxArchitectedLps) || (remoteLp == HvLpIndexInvalid))		return -EINVAL;	subtype = subtype >> VIOMAJOR_SUBTYPE_SHIFT;	if ((subtype < 0) || (subtype >= VIO_MAX_SUBTYPES))		return -EINVAL;	spin_lock_irqsave(&statuslock, flags);	if (!event_buffer_initialised) {		for (i = 0; i < VIO_MAX_SUBTYPES; i++)			atomic_set(&event_buffer_available[i], 1);		event_buffer_initialised = 1;	}	viopathStatus[remoteLp].users[subtype]++;	if (!viopathStatus[remoteLp].isOpen) {		viopathStatus[remoteLp].isOpen = 1;		HvCallEvent_openLpEventPath(remoteLp, HvLpEvent_Type_VirtualIo);		/*		 * Don't hold the spinlock during an operation that		 * can sleep.		 */		spin_unlock_irqrestore(&statuslock, flags);		tempNumAllocated = allocateEvents(remoteLp, 1);		spin_lock_irqsave(&statuslock, flags);		viopathStatus[remoteLp].numberAllocated += tempNumAllocated;		if (viopathStatus[remoteLp].numberAllocated == 0) {			HvCallEvent_closeLpEventPath(remoteLp,					HvLpEvent_Type_VirtualIo);			spin_unlock_irqrestore(&statuslock, flags);			return -ENOMEM;		}		viopathStatus[remoteLp].mSourceInst =			HvCallEvent_getSourceLpInstanceId(remoteLp,					HvLpEvent_Type_VirtualIo);		viopathStatus[remoteLp].mTargetInst =			HvCallEvent_getTargetLpInstanceId(remoteLp,					HvLpEvent_Type_VirtualIo);		HvLpEvent_registerHandler(HvLpEvent_Type_VirtualIo,					  &vio_handleEvent);		sendMonMsg(remoteLp);		printk(VIOPATH_KERN_INFO "opening connection to partition %d, "				"setting sinst %d, tinst %d\n",				remoteLp, viopathStatus[remoteLp].mSourceInst,				viopathStatus[remoteLp].mTargetInst);	}	spin_unlock_irqrestore(&statuslock, flags);	tempNumAllocated = allocateEvents(remoteLp, numReq);	spin_lock_irqsave(&statuslock, flags);	viopathStatus[remoteLp].numberAllocated += tempNumAllocated;	spin_unlock_irqrestore(&statuslock, flags);	return 0;}
10457	/local/tlutelli/issta_data/temp/c/2005_temp/2005/10457/c670b1acd0ed0d9f7a27154759a9825cb5012ae4/viopath.c/buggy/arch/ppc64/kernel/viopath.c