Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit c3744138 authored by Bill Pemberton's avatar Bill Pemberton Committed by Greg Kroah-Hartman
Browse files

Staging: comedi: remove assignment in conditionals

parent 46dbd148
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -394,7 +394,8 @@ static int dev_8255_attach(struct comedi_device *dev, struct comedi_devconfig *
		return -EINVAL;
	}

	if ((ret = alloc_subdevices(dev, i)) < 0)
	ret = alloc_subdevices(dev, i);
	if (ret < 0)
		return ret;

	for (i = 0; i < dev->n_subdevices; i++) {
+15 −13
Original line number Diff line number Diff line
@@ -2575,9 +2575,9 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
	sprintf(c_Identifier, "Addi-Data GmbH Comedi %s",
		this_board->pc_DriverName);

	if ((ret = alloc_private(dev, sizeof(struct addi_private))) < 0) {
	ret = alloc_private(dev, sizeof(struct addi_private));
	if (ret < 0)
		return -ENOMEM;
	}

	if (!pci_list_builded) {
		v_pci_card_list_init(this_board->i_VendorId, 1);	/* 1 for displaying the list.. */
@@ -2589,12 +2589,14 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
		i_Dma = 1;
	}

	if ((card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
	card = ptr_select_and_alloc_pci_card(this_board->i_VendorId,
					     this_board->i_DeviceId,
					     it->options[0],
				it->options[1], i_Dma)) == NULL) {
					     it->options[1], i_Dma);

	if (card == NULL)
		return -EIO;
	}

	devpriv->allocated = 1;

	if ((i_pci_card_data(card, &pci_bus, &pci_slot, &pci_func, &io_addr[0],
@@ -2698,13 +2700,12 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
			devpriv->b_DmaDoubleBuffer = 0;
			for (i = 0; i < 2; i++) {
				for (pages = 4; pages >= 0; pages--) {
					if ((devpriv->ul_DmaBufferVirtual[i] =
							(void *)
							__get_free_pages
							(GFP_KERNEL, pages))) {
					devpriv->ul_DmaBufferVirtual[i] =
						(void *) __get_free_pages(GFP_KERNEL, pages);

					if (devpriv->ul_DmaBufferVirtual[i])
						break;
				}
				}
				if (devpriv->ul_DmaBufferVirtual[i]) {
					devpriv->ui_DmaBufferPages[i] = pages;
					devpriv->ui_DmaBufferSize[i] =
@@ -2745,7 +2746,8 @@ static int i_ADDI_Attach(struct comedi_device *dev, struct comedi_devconfig *it)
	} else {
		/* Update-0.7.57->0.7.68dev->n_subdevices = 7; */
		n_subdevices = 7;
		if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
		ret = alloc_subdevices(dev, n_subdevices);
		if (ret < 0)
			return ret;

		/*  Allocate and Initialise AI Subdevice Structures */
+2 −3
Original line number Diff line number Diff line
@@ -423,9 +423,8 @@ struct pcilst_struct *ptr_select_and_alloc_pci_card(unsigned short vendor_id,
	struct pcilst_struct *card;

	if ((pci_bus < 1) & (pci_slot < 1)) {	/*  use autodetection */
		if ((card = ptr_find_free_pci_card_by_device(vendor_id,
							     device_id)) ==
		    NULL) {
		card = ptr_find_free_pci_card_by_device(vendor_id, device_id);
		if (card == NULL) {
			rt_printk(" - Unused card not found in system!\n");
			return NULL;
		}
+3 −2
Original line number Diff line number Diff line
/**
//**
@verbatim

Copyright (C) 2004,2005  ADDI-DATA GmbH for the source code of this module.
@@ -63,7 +63,8 @@ void i_ADDI_AttachPCI1710(struct comedi_device *dev)
	int n_subdevices = 9;

	/* Update-0.7.57->0.7.68dev->n_subdevices = 9; */
	if ((ret = alloc_subdevices(dev, n_subdevices)) < 0)
	ret = alloc_subdevices(dev, n_subdevices);
	if (ret < 0)
		return;

	/*  Allocate and Initialise Timer Subdevice Structures */
+96 −75
Original line number Diff line number Diff line
@@ -975,7 +975,10 @@ static void v_APCI1564_Interrupt(int irq, void *d)

	}			/*  if  (ui_DO) */

	if ((ui_Timer == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_TIMER)) {
	if (ui_Timer == 1) {
		devpriv->b_TimerSelectMode = ADDIDATA_TIMER;
		if (devpriv->b_TimerSelectMode) {

			/*  Disable Timer Interrupt */
			ul_Command2 =
				inl(devpriv->i_IobaseAmcc + APCI1564_TIMER +
@@ -992,9 +995,14 @@ static void v_APCI1564_Interrupt(int irq, void *d)
			outl(ul_Command2,
			     devpriv->i_IobaseAmcc + APCI1564_TIMER +
			     APCI1564_TCW_PROG);
	}			/*  if  ((ui_Timer == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_TIMER)) */
		}
	}/* if  (ui_Timer == 1) */


	if (ui_C1 == 1) {
		devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
		if (devpriv->b_TimerSelectMode) {

	if ((ui_C1 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
			/*  Disable Counter Interrupt */
			ul_Command2 =
				inl(devpriv->iobase + APCI1564_COUNTER1 +
@@ -1010,9 +1018,13 @@ static void v_APCI1564_Interrupt(int irq, void *d)
			outl(ul_Command2,
			     devpriv->iobase + APCI1564_COUNTER1 +
			     APCI1564_TCW_PROG);
	}			/*  if  ((ui_C1 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) */
		}
	} /* if  (ui_C1 == 1) */

	if (ui_C2 == 1) {
		devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
		if (devpriv->b_TimerSelectMode) {

	if ((ui_C2 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
			/*  Disable Counter Interrupt */
			ul_Command2 =
				inl(devpriv->iobase + APCI1564_COUNTER2 +
@@ -1028,9 +1040,13 @@ static void v_APCI1564_Interrupt(int irq, void *d)
			outl(ul_Command2,
			     devpriv->iobase + APCI1564_COUNTER2 +
			     APCI1564_TCW_PROG);
	}			/*  if  ((ui_C2 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
		}
	} /*  if  ((ui_C2 == 1) */

	if (ui_C3 == 1) {
		devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
		if (devpriv->b_TimerSelectMode) {

	if ((ui_C3 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
			/*  Disable Counter Interrupt */
			ul_Command2 =
				inl(devpriv->iobase + APCI1564_COUNTER3 +
@@ -1046,9 +1062,13 @@ static void v_APCI1564_Interrupt(int irq, void *d)
			outl(ul_Command2,
			     devpriv->iobase + APCI1564_COUNTER3 +
			     APCI1564_TCW_PROG);
	}			/*  if ((ui_C3 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
		}
	}	/*  if ((ui_C3 == 1) */

	if (ui_C4 == 1) {
		devpriv->b_TimerSelectMode = ADDIDATA_COUNTER;
		if (devpriv->b_TimerSelectMode) {

	if ((ui_C4 == 1) && (devpriv->b_TimerSelectMode = ADDIDATA_COUNTER)) {
			/*  Disable Counter Interrupt */
			ul_Command2 =
				inl(devpriv->iobase + APCI1564_COUNTER4 +
@@ -1064,7 +1084,8 @@ static void v_APCI1564_Interrupt(int irq, void *d)
			outl(ul_Command2,
			     devpriv->iobase + APCI1564_COUNTER4 +
			     APCI1564_TCW_PROG);
	}			/*  if ((ui_C4 == 1) && (devpriv->b_TimerSelectMode =ADDIDATA_COUNTER)) */
		}
	}	/*  if (ui_C4 == 1) */
	return;
}

Loading