From owner-svn-src-head@freebsd.org Thu Apr 6 15:42:14 2017 Return-Path: Delivered-To: svn-src-head@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 101FFD3261D; Thu, 6 Apr 2017 15:42:14 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id DEABE784; Thu, 6 Apr 2017 15:42:13 +0000 (UTC) (envelope-from tsoome@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id v36FgDRE027945; Thu, 6 Apr 2017 15:42:13 GMT (envelope-from tsoome@FreeBSD.org) Received: (from tsoome@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id v36FgDBe027944; Thu, 6 Apr 2017 15:42:13 GMT (envelope-from tsoome@FreeBSD.org) Message-Id: <201704061542.v36FgDBe027944@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: tsoome set sender to tsoome@FreeBSD.org using -f From: Toomas Soome Date: Thu, 6 Apr 2017 15:42:12 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r316577 - head/sys/boot/common X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 06 Apr 2017 15:42:14 -0000 Author: tsoome Date: Thu Apr 6 15:42:12 2017 New Revision: 316577 URL: https://svnweb.freebsd.org/changeset/base/316577 Log: loader: part.c cstyle cleanup The description tells it all, as an side note, I am using uint8_t instead of u_char as the partition table data really is handled as byte stream, not char array. Reviewed by: allanjude, imp Differential Revision: https://reviews.freebsd.org/D10180 Modified: head/sys/boot/common/part.c Modified: head/sys/boot/common/part.c ============================================================================== --- head/sys/boot/common/part.c Thu Apr 6 15:19:18 2017 (r316576) +++ head/sys/boot/common/part.c Thu Apr 6 15:42:12 2017 (r316577) @@ -42,7 +42,7 @@ __FBSDID("$FreeBSD$"); #include #ifdef PART_DEBUG -#define DEBUG(fmt, args...) printf("%s: " fmt "\n" , __func__ , ## args) +#define DEBUG(fmt, args...) printf("%s: " fmt "\n", __func__, ## args) #else #define DEBUG(fmt, args...) #endif @@ -145,7 +145,7 @@ gpt_parttype(uuid_t type) return (PART_UNKNOWN); } -static struct gpt_hdr* +static struct gpt_hdr * gpt_checkhdr(struct gpt_hdr *hdr, uint64_t lba_self, uint64_t lba_last, uint16_t sectorsize) { @@ -199,7 +199,7 @@ gpt_checkhdr(struct gpt_hdr *hdr, uint64 } static int -gpt_checktbl(const struct gpt_hdr *hdr, u_char *tbl, size_t size, +gpt_checktbl(const struct gpt_hdr *hdr, uint8_t *tbl, size_t size, uint64_t lba_last) { struct gpt_ent *ent; @@ -226,13 +226,13 @@ gpt_checktbl(const struct gpt_hdr *hdr, return (0); } -static struct ptable* +static struct ptable * ptable_gptread(struct ptable *table, void *dev, diskread_t dread) { struct pentry *entry; struct gpt_hdr *phdr, hdr; struct gpt_ent *ent; - u_char *buf, *tbl; + uint8_t *buf, *tbl; uint64_t offset; int pri, sec; size_t size, i; @@ -379,7 +379,7 @@ mbr_parttype(uint8_t type) return (PART_UNKNOWN); } -static struct ptable* +static struct ptable * ptable_ebrread(struct ptable *table, void *dev, diskread_t dread) { struct dos_partition *dp; @@ -457,13 +457,13 @@ bsd_parttype(uint8_t type) return (PART_UNKNOWN); } -static struct ptable* +static struct ptable * ptable_bsdread(struct ptable *table, void *dev, diskread_t dread) { struct disklabel *dl; struct partition *part; struct pentry *entry; - u_char *buf; + uint8_t *buf; uint32_t raw_offset; int i; @@ -539,12 +539,12 @@ vtoc8_parttype(uint16_t type) return (PART_UNKNOWN); } -static struct ptable* +static struct ptable * ptable_vtoc8read(struct ptable *table, void *dev, diskread_t dread) { struct pentry *entry; struct vtoc8 *dl; - u_char *buf; + uint8_t *buf; uint16_t sum, heads, sectors; int i; @@ -603,13 +603,13 @@ out: } #endif /* LOADER_VTOC8_SUPPORT */ -struct ptable* +struct ptable * ptable_open(void *dev, uint64_t sectors, uint16_t sectorsize, diskread_t *dread) { struct dos_partition *dp; struct ptable *table; - u_char *buf; + uint8_t *buf; int i, count; #ifdef LOADER_MBR_SUPPORT struct pentry *entry; @@ -795,14 +795,14 @@ ptable_getpart(const struct ptable *tabl * 5: Active FAT/FAT32 slice * 6: non-active FAT/FAT32 slice */ -#define PREF_RAWDISK 0 -#define PREF_FBSD_ACT 1 -#define PREF_FBSD 2 -#define PREF_LINUX_ACT 3 -#define PREF_LINUX 4 -#define PREF_DOS_ACT 5 -#define PREF_DOS 6 -#define PREF_NONE 7 +#define PREF_RAWDISK 0 +#define PREF_FBSD_ACT 1 +#define PREF_FBSD 2 +#define PREF_LINUX_ACT 3 +#define PREF_LINUX 4 +#define PREF_DOS_ACT 5 +#define PREF_DOS 6 +#define PREF_NONE 7 int ptable_getbestpart(const struct ptable *table, struct ptable_entry *part) { @@ -884,12 +884,12 @@ ptable_iterate(const struct ptable *tabl #endif #ifdef LOADER_VTOC8_SUPPORT if (table->type == PTABLE_VTOC8) - sprintf(name, "%c", (u_char) 'a' + + sprintf(name, "%c", (uint8_t) 'a' + entry->part.index); else #endif if (table->type == PTABLE_BSD) - sprintf(name, "%c", (u_char) 'a' + + sprintf(name, "%c", (uint8_t) 'a' + entry->part.index); if ((ret = iter(arg, name, &entry->part)) != 0) return (ret);