linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* udev_queue_get_seqnum_is_finished
@ 2009-04-23  9:39 Alan Jenkins
  2009-04-23 11:20 ` udev_queue_get_seqnum_is_finished Kay Sievers
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Alan Jenkins @ 2009-04-23  9:39 UTC (permalink / raw)
  To: linux-hotplug

I'm puzzled by this function:


int udev_queue_get_seqnum_is_finished(struct udev_queue *udev_queue, unsigned long long int seqnum)
{
	char filename[UTIL_PATH_SIZE];
	struct stat statbuf;

	if (udev_queue = NULL)
		return -EINVAL;
	/* if we have not seen this seqnum, check if it is/was already queued */
	if (seqnum < udev_queue->last_seen_udev_seqnum) {
		udev_queue_get_udev_seqnum(udev_queue);
		if (seqnum < udev_queue->last_seen_udev_seqnum)
			return 0;
	}



Shouldn't the test be (seqnum > udev_queue->last_seen_udev_seqnum) ?
I.e. "greater than" instead of "less than".

If the code is right, then why does it need to re-check after calling
udev_queue_get_udev_seqnum() ?  The udev seqnum can only increase, so if
the first test is true then the second cannot fail either.

Thanks
Alan

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2009-04-23 12:54 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-04-23  9:39 udev_queue_get_seqnum_is_finished Alan Jenkins
2009-04-23 11:20 ` udev_queue_get_seqnum_is_finished Kay Sievers
2009-04-23 11:34 ` udev_queue_get_seqnum_is_finished Kay Sievers
2009-04-23 12:43 ` udev_queue_get_seqnum_is_finished Alan Jenkins
2009-04-23 12:54 ` udev_queue_get_seqnum_is_finished Kay Sievers

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).