From 032115fc27090a8079fb08b732d1d3afe5312aa4 Mon Sep 17 00:00:00 2001 From: krw Date: Sat, 12 Jun 2021 17:19:13 +0000 Subject: [PATCH] GPT_get_header() and GPT_get_partition_table() are only used in gpt.c. Move declarations and rename to get_header() and get_partition_table(). No functional change. --- sbin/fdisk/gpt.c | 20 +++++++++++--------- sbin/fdisk/gpt.h | 4 +--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/sbin/fdisk/gpt.c b/sbin/fdisk/gpt.c index 8154ec37a6d..e7a565820f9 100644 --- a/sbin/fdisk/gpt.c +++ b/sbin/fdisk/gpt.c @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.c,v 1.23 2021/06/12 14:28:30 krw Exp $ */ +/* $OpenBSD: gpt.c,v 1.24 2021/06/12 17:19:13 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -46,9 +46,11 @@ struct gpt_partition **sort_gpt(void); int lba_start_cmp(const void *e1, const void *e2); int lba_free(uint64_t *, uint64_t *); int add_partition(const uint8_t *, const char *, uint64_t); +int get_header(off_t); +int get_partition_table(void); int -GPT_get_header(off_t where) +get_header(off_t where) { char *secbuf; uint64_t partlastlba; @@ -149,7 +151,7 @@ GPT_get_header(off_t where) } int -GPT_get_partition_table(void) +get_partition_table(void) { ssize_t len; off_t off, where; @@ -200,22 +202,22 @@ GPT_read(int which) switch (which) { case PRIMARYGPT: - valid = GPT_get_header(GPTSECTOR); + valid = get_header(GPTSECTOR); break; case SECONDARYGPT: - valid = GPT_get_header(DL_GETDSIZE(&dl) - 1); + valid = get_header(DL_GETDSIZE(&dl) - 1); break; case ANYGPT: - valid = GPT_get_header(GPTSECTOR); - if (valid != 0 || GPT_get_partition_table() != 0) - valid = GPT_get_header(DL_GETDSIZE(&dl) - 1); + valid = get_header(GPTSECTOR); + if (valid != 0 || get_partition_table() != 0) + valid = get_header(DL_GETDSIZE(&dl) - 1); break; default: return; } if (valid == 0) - valid = GPT_get_partition_table(); + valid = get_partition_table(); if (valid != 0) { /* No valid GPT found. Zap any artifacts. */ diff --git a/sbin/fdisk/gpt.h b/sbin/fdisk/gpt.h index d32c9fde4c5..93a8e4796f7 100644 --- a/sbin/fdisk/gpt.h +++ b/sbin/fdisk/gpt.h @@ -1,4 +1,4 @@ -/* $OpenBSD: gpt.h,v 1.10 2021/05/19 21:49:07 krw Exp $ */ +/* $OpenBSD: gpt.h,v 1.11 2021/06/12 17:19:13 krw Exp $ */ /* * Copyright (c) 2015 Markus Muller * Copyright (c) 2015 Kenneth R Westerback @@ -17,8 +17,6 @@ */ void GPT_read(int); -int GPT_get_header(off_t); -int GPT_get_partition_table(void); int GPT_get_lba_start(unsigned int); int GPT_get_lba_end(unsigned int); -- 2.20.1