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: Re: [PATCH] implement a more efficient queue file format
Date: Fri, 22 May 2009 07:56:09 +0000	[thread overview]
Message-ID: <4A165A99.6060500@tuffmail.co.uk> (raw)
In-Reply-To: <4A159D09.8060806@tuffmail.co.uk>

Kay Sievers wrote:
> On Thu, May 21, 2009 at 20:27, Alan Jenkins <alan-jenkins@tuffmail.co.uk> wrote:
>   
>> Instead of creating a file for each event, append their details to a
>> log file.  The file is periodically rebuilt (garbage-collected) to
>> prevent it from growing indefinitely.
>>     
>
> Sounds cool. Boots fine here. :)
>
> I've switched a few int to unsigned int, to silent some gcc warnings,
> merged the few entries in queue-private.h just into libudev-private.h,
> moved the file format comments to the C file, renamed the
> seqnums_are_finished() to seqnum_sequence_is_finished() and exported
> it, bumped the minor version of libudev, and comitted it.
>
> Would be great, if you can check, that I didn't mess it up. :)
>
> Thanks a lot,
> Kay
>   

Wow, thanks!  I checked the delta.  I don't see any problems in these 
changes.


I only see one warning myself

lib/libudev-queue-export.c:143: warning: comparison between signed and 
unsigned

142 n = seqnum - udev_queue_export->seqnum_max;
143 if (n >= devpaths->devpaths_size)
144        goto read_error;

Arguably it _might_ be better addressed in this one place, by casting 
devpaths_size to unsigned.  It seems to be a matter of personal taste 
though, and I'm not complaining.


I have an unverifiable memory of reading "unsigned int i is evil" on 
LKML.  Half the internet says unsigned has relatively special semantics 
(intended for e.g. bit manipulation), you should avoid it unless that's 
what you actually need, and size_t should never have been defined as 
unsigned.  Of course, the other half advocate using unsigned liberally 
to exclude negative values when passing array indexes around :-).

Alan

      parent reply	other threads:[~2009-05-22  7:56 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-05-21 18:27 [PATCH] implement a more efficient queue file format Alan Jenkins
2009-05-21 20:55 ` Kay Sievers
2009-05-22  7:56 ` Alan Jenkins [this message]

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=4A165A99.6060500@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).