X-Git-Url: https://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=blobdiff_plain;f=extras%2Fvolume_id%2Fvolume_id%2Fmsdos.c;h=ab18fc35850bd93396ea6ae020562a5b99139d65;hb=09c2bab517c58d9447660a9584822c8de6b641f0;hp=47c94456e48652eeb48104590ff4a1ae109fdc87;hpb=138068d690d79e71239d3e776f01560afbabc1cb;p=elogind.git diff --git a/extras/volume_id/volume_id/msdos.c b/extras/volume_id/volume_id/msdos.c index 47c94456e..ab18fc358 100644 --- a/extras/volume_id/volume_id/msdos.c +++ b/extras/volume_id/volume_id/msdos.c @@ -3,19 +3,9 @@ * * Copyright (C) 2004 Kay Sievers * - * 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 #include #include -#include #include "volume_id.h" #include "logging.h" @@ -40,16 +29,16 @@ #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;