chiark / gitweb /
forgot the ChangeLog for 074
[elogind.git] / extras / volume_id / volume_id / msdos.c
index 47c94456e48652eeb48104590ff4a1ae109fdc87..ab18fc35850bd93396ea6ae020562a5b99139d65 100644 (file)
@@ -3,19 +3,9 @@
  *
  * Copyright (C) 2004 Kay Sievers <kay.sievers@vrfy.org>
  *
- *     This library is free software; you can redistribute it and/or
- *     modify it under the terms of the GNU Lesser General Public
- *     License as published by the Free Software Foundation; either
- *     version 2.1 of the License, or (at your option) any later version.
- *
- *     This library is distributed in the hope that it will be useful,
- *     but WITHOUT ANY WARRANTY; without even the implied warranty of
- *     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- *     Lesser General Public License for more details.
- *
- *     You should have received a copy of the GNU Lesser General Public
- *     License along with this library; if not, write to the Free Software
- *     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+ *     This program is free software; you can redistribute it and/or modify it
+ *     under the terms of the GNU General Public License as published by the
+ *     Free Software Foundation version 2 of the License.
  */
 
 #ifndef _GNU_SOURCE
@@ -32,7 +22,6 @@
 #include <string.h>
 #include <errno.h>
 #include <ctype.h>
-#include <asm/types.h>
 
 #include "volume_id.h"
 #include "logging.h"
 #include "msdos.h"
 
 struct msdos_partition_entry {
-       __u8    boot_ind;
-       __u8    head;
-       __u8    sector;
-       __u8    cyl;
-       __u8    sys_ind;
-       __u8    end_head;
-       __u8    end_sector;
-       __u8    end_cyl;
-       __u32   start_sect;
-       __u32   nr_sects;
+       uint8_t         boot_ind;
+       uint8_t         head;
+       uint8_t         sector;
+       uint8_t         cyl;
+       uint8_t         sys_ind;
+       uint8_t         end_head;
+       uint8_t         end_sector;
+       uint8_t         end_cyl;
+       uint32_t        start_sect;
+       uint32_t        nr_sects;
 } __attribute__((packed));
 
 #define MSDOS_MAGIC                    "\x55\xaa"
@@ -67,15 +56,15 @@ struct msdos_partition_entry {
 #define is_raid(type) \
        (type == LINUX_RAID_PARTITION)
 
-int volume_id_probe_msdos_part_table(struct volume_id *id, __u64 off)
+int volume_id_probe_msdos_part_table(struct volume_id *id, uint64_t off)
 {
-       const __u8 *buf;
+       const uint8_t *buf;
        int i;
-       __u64 poff;
-       __u64 plen;
-       __u64 extended = 0;
-       __u64 current;
-       __u64 next;
+       uint64_t poff;
+       uint64_t plen;
+       uint64_t extended = 0;
+       uint64_t current;
+       uint64_t next;
        int limit;
        int empty = 1;
        struct msdos_partition_entry *part;
@@ -113,8 +102,8 @@ int volume_id_probe_msdos_part_table(struct volume_id *id, __u64 off)
               VOLUME_ID_PARTITIONS_MAX * sizeof(struct volume_id_partition));
 
        for (i = 0; i < 4; i++) {
-               poff = (__u64) le32_to_cpu(part[i].start_sect) * BSIZE;
-               plen = (__u64) le32_to_cpu(part[i].nr_sects) * BSIZE;
+               poff = (uint64_t) le32_to_cpu(part[i].start_sect) * BSIZE;
+               plen = (uint64_t) le32_to_cpu(part[i].nr_sects) * BSIZE;
 
                if (plen == 0)
                        continue;
@@ -167,8 +156,8 @@ int volume_id_probe_msdos_part_table(struct volume_id *id, __u64 off)
                next = 0;
 
                for (i = 0; i < 4; i++) {
-                       poff = (__u64) le32_to_cpu(part[i].start_sect) * BSIZE;
-                       plen = (__u64) le32_to_cpu(part[i].nr_sects) * BSIZE;
+                       poff = (uint64_t) le32_to_cpu(part[i].start_sect) * BSIZE;
+                       plen = (uint64_t) le32_to_cpu(part[i].nr_sects) * BSIZE;
 
                        if (plen == 0)
                                continue;