From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alan Jenkins Date: Thu, 23 Apr 2009 09:39:26 +0000 Subject: udev_queue_get_seqnum_is_finished Message-Id: <49F0374E.2070000@tuffmail.co.uk> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-hotplug@vger.kernel.org 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