From: Michael Buesch <mbuesch@freenet.de>
To: linux-hotplug@vger.kernel.org
Subject: [PATCH, UDEV] use an unsigned int for kernel release number
Date: Sat, 05 Feb 2005 16:26:21 +0000 [thread overview]
Message-ID: <200502051726.27148.mbuesch@freenet.de> (raw)
[-- Attachment #1.1: Type: text/plain, Size: 296 bytes --]
Hi,
This fixes kernel_release_satisfactory().
We are already using %u in the sscanf() format string.
The patch replaces the int for the kernel release number with
unsigned int, as we can never have negative release numbers.
--
Regards Michael Buesch [ http://www.tuxsoft.de.vu ]
[-- Attachment #1.2: udev_unsigned_int_for_kernrelease.diff --]
[-- Type: text/x-diff, Size: 1289 bytes --]
===== udev_utils.c 1.25 vs edited =====
--- 1.25/udev_utils.c 2004-12-20 22:10:57 +01:00
+++ edited/udev_utils.c 2005-02-05 17:21:40 +01:00
@@ -62,11 +62,11 @@
strcpy(udev->group, "root");
}
-int kernel_release_satisfactory(int version, int patchlevel, int sublevel)
+int kernel_release_satisfactory(unsigned int version, unsigned int patchlevel, unsigned int sublevel)
{
- static int kversion = 0;
- static int kpatchlevel;
- static int ksublevel;
+ static unsigned int kversion = 0;
+ static unsigned int kpatchlevel;
+ static unsigned int ksublevel;
if (kversion == 0) {
struct utsname uts;
===== udev_utils.h 1.20 vs edited =====
--- 1.20/udev_utils.h 2004-12-19 23:38:32 +01:00
+++ edited/udev_utils.h 2005-02-05 17:21:16 +01:00
@@ -77,7 +77,7 @@
#endif
extern void udev_init_device(struct udevice *udev, const char* devpath, const char *subsystem);
-extern int kernel_release_satisfactory(int version, int patchlevel, int sublevel);
+extern int kernel_release_satisfactory(unsigned int version, unsigned int patchlevel, unsigned int sublevel);
extern int create_path(const char *path);
extern int parse_get_pair(char **orig_string, char **left, char **right);
extern int file_map(const char *filename, char **buf, size_t *bufsize);
[-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --]
next reply other threads:[~2005-02-05 16:26 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-02-05 16:26 Michael Buesch [this message]
2005-02-05 16:40 ` [PATCH, UDEV] use an unsigned int for kernel release number 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=200502051726.27148.mbuesch@freenet.de \
--to=mbuesch@freenet.de \
--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).