linux-hotplug.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alan Jenkins <alan-jenkins@tuffmail.co.uk>
To: linux-hotplug@vger.kernel.org
Subject: udev_queue_get_seqnum_is_finished
Date: Thu, 23 Apr 2009 09:39:26 +0000	[thread overview]
Message-ID: <49F0374E.2070000@tuffmail.co.uk> (raw)

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

             reply	other threads:[~2009-04-23  9:39 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-04-23  9:39 Alan Jenkins [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=49F0374E.2070000@tuffmail.co.uk \
    --to=alan-jenkins@tuffmail.co.uk \
    --cc=linux-hotplug@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).