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

Commit a7401cdd authored by Ian Abbott's avatar Ian Abbott Committed by Greg Kroah-Hartman
Browse files

staging: comedi: make 'dev->attached' a bool bit-field



Change the `attached` member of `struct comedi_device` to a 1-bit
bit-field of type `bool`.  Change assigned values to `true` and `false`
and replace or remove comparison operations with simple boolean tests.

We'll put some extra bit-fields in the gap later to save space.

Signed-off-by: default avatarIan Abbott <abbotti@mev.co.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 8bdfefb7
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -207,7 +207,7 @@ struct comedi_device {

	const char *board_name;
	const void *board_ptr;
	int attached;
	bool attached:1;
	spinlock_t spinlock;
	struct mutex mutex;
	int in_request_module;
+2 −2
Original line number Diff line number Diff line
@@ -120,7 +120,7 @@ static void cleanup_device(struct comedi_device *dev)

static void __comedi_device_detach(struct comedi_device *dev)
{
	dev->attached = 0;
	dev->attached = false;
	if (dev->driver)
		dev->driver->detach(dev);
	else
@@ -290,7 +290,7 @@ static int comedi_device_postconfig(struct comedi_device *dev)
		dev->board_name = "BUG";
	}
	smp_wmb();
	dev->attached = 1;
	dev->attached = true;
	return 0;
}

+1 −1
Original line number Diff line number Diff line
@@ -1341,7 +1341,7 @@ static irqreturn_t cb_pcidas_interrupt(int irq, void *d)
	static const int timeout = 10000;
	unsigned long flags;

	if (dev->attached == 0)
	if (!dev->attached)
		return IRQ_NONE;

	async = s->async;
+1 −1
Original line number Diff line number Diff line
@@ -3113,7 +3113,7 @@ static irqreturn_t handle_interrupt(int irq, void *d)
	/* an interrupt before all the postconfig stuff gets done could
	 * cause a NULL dereference if we continue through the
	 * interrupt handler */
	if (dev->attached == 0) {
	if (!dev->attached) {
		DEBUG_PRINT("premature interrupt, ignoring\n");
		return IRQ_HANDLED;
	}
+1 −1
Original line number Diff line number Diff line
@@ -876,7 +876,7 @@ static void das16_interrupt(struct comedi_device *dev)
	int num_bytes, residue;
	int buffer_index;

	if (dev->attached == 0) {
	if (!dev->attached) {
		comedi_error(dev, "premature interrupt");
		return;
	}
Loading