diff mbox series

[01/12] Cleanup: use #pragma once in all headers

Message ID 20231016165740.1374614-1-stefano.babic@swupdate.org
State Accepted
Delegated to: Stefano Babic
Headers show
Series [01/12] Cleanup: use #pragma once in all headers | expand

Commit Message

Stefano Babic Oct. 16, 2023, 4:57 p.m. UTC
There is a mix of #ifndef and #pragma once to check if a header is
already include. Drop the mix and use the pragma in all headers.

Uodate SPDX to current information.

Signed-off-by: Stefano Babic <stefano.babic@swupdate.org>
---
 include/bootloader.h         |  2 +-
 include/chained_handler.h    |  2 +-
 include/cpiohdr.h            |  7 ++-----
 include/delta_process.h      |  2 +-
 include/download_interface.h |  7 ++-----
 include/flash.h              |  7 ++-----
 include/fs_interface.h       |  6 ++----
 include/globals.h            |  8 ++------
 include/handler.h            |  8 ++------
 include/hw-compatibility.h   | 11 +++--------
 include/installer.h          |  7 ++-----
 include/installer_priv.h     |  8 ++------
 include/lua_util.h           | 12 +++---------
 include/mongoose_interface.h |  9 +++------
 include/multipart_parser.h   |  4 +---
 include/network_interface.h  | 10 +++-------
 include/network_ipc.h        | 10 +++-------
 include/parselib.h           | 10 +++-------
 include/parsers.h            |  9 +++------
 include/pctl.h               |  9 +++------
 include/progress.h           |  9 +++------
 include/progress_ipc.h       |  5 +----
 include/semver.h             |  5 +----
 include/server_utils.h       |  2 +-
 include/sslapi.h             |  6 +-----
 include/swupdate.h           |  9 +++------
 include/swupdate_dict.h      |  9 +++------
 include/swupdate_image.h     |  8 ++------
 include/swupdate_settings.h  |  9 +++------
 include/swupdate_status.h    | 10 +++-------
 include/swupdate_vars.h      |  5 +----
 include/util.h               |  8 +++-----
 include/versions.h           |  7 ++-----
 33 files changed, 71 insertions(+), 169 deletions(-)

Comments

Dominique Martinet Oct. 17, 2023, 2:20 a.m. UTC | #1
Stefano Babic wrote on Mon, Oct 16, 2023 at 06:57:29PM +0200:
> There is a mix of #ifndef and #pragma once to check if a header is
> already include. Drop the mix and use the pragma in all headers.

FWIW bsdqueue.h still has ifdef, but I assume that fils comes straight
from netbsd so it's best to not touch it.
Change looks good to me:
Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>

> Uodate SPDX to current information.

Uodate -> Update
Stefano Babic Oct. 17, 2023, 6:48 a.m. UTC | #2
Hi Dominique,

On 17.10.23 04:20, Dominique MARTINET wrote:
> Stefano Babic wrote on Mon, Oct 16, 2023 at 06:57:29PM +0200:
>> There is a mix of #ifndef and #pragma once to check if a header is
>> already include. Drop the mix and use the pragma in all headers.
> 
> FWIW bsdqueue.h still has ifdef, but I assume that fils comes straight
> from netbsd so it's best to not touch it.

Correct, the header was imported as it is, just adding SPDX to make it 
REUSE compliant.

Regards,
Stefano

> Change looks good to me:
> Reviewed-by: Dominique Martinet <dominique.martinet@atmark-techno.com>
> 
>> Uodate SPDX to current information.
> 
> Uodate -> Update
> 

I fix it when I merge, thanks.
diff mbox series

Patch

diff --git a/include/bootloader.h b/include/bootloader.h
index 171181ec..365d6dc3 100644
--- a/include/bootloader.h
+++ b/include/bootloader.h
@@ -1,6 +1,6 @@ 
 /*
  * (C) Copyright 2017
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
diff --git a/include/chained_handler.h b/include/chained_handler.h
index 3ab82fa7..fdd831dd 100644
--- a/include/chained_handler.h
+++ b/include/chained_handler.h
@@ -1,6 +1,6 @@ 
 /*
  * (C) Copyright 2022
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
diff --git a/include/cpiohdr.h b/include/cpiohdr.h
index 0be844a9..c909af94 100644
--- a/include/cpiohdr.h
+++ b/include/cpiohdr.h
@@ -1,6 +1,6 @@ 
 /*
  * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
@@ -11,8 +11,7 @@ 
  * but just what is needed by swupdate
  */
 
-#ifndef _CPIOHDR_SWUPD_H
-#define _CPIOHDR_SWUPD_H
+#pragma once
 
 /* Global swupdate defines */
 #include <stdbool.h>
@@ -61,5 +60,3 @@  int extract_cpio_header(int fd, struct filehdr *fhdr, unsigned long *offset);
 int extract_img_from_cpio(int fd, unsigned long offset, struct filehdr *fdh);
 void extract_padding(int fd);
 bool swupdate_verify_chksum(const uint32_t chk1, struct filehdr *fhdr);
-
-#endif
diff --git a/include/delta_process.h b/include/delta_process.h
index 51d1e042..ace40742 100644
--- a/include/delta_process.h
+++ b/include/delta_process.h
@@ -1,6 +1,6 @@ 
 /*
  * (C) Copyright 2021
- * Stefano Babic, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
diff --git a/include/download_interface.h b/include/download_interface.h
index 8e031306..6cc099d0 100644
--- a/include/download_interface.h
+++ b/include/download_interface.h
@@ -1,13 +1,12 @@ 
 /*
  * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
 
-#ifndef _DWL_INTERFACE_H
-#define _DWL_INTERFACE_H
+#pragma once
 
 /*
  * This is used by swupdate to start the Downloader Process
@@ -15,5 +14,3 @@ 
 int start_download_server(const char *cfgfname, int argc, char *argv[]);
 
 void download_print_help(void);
-
-#endif
diff --git a/include/flash.h b/include/flash.h
index 3f730799..9a055a72 100644
--- a/include/flash.h
+++ b/include/flash.h
@@ -1,13 +1,12 @@ 
 /*
  * (C) Copyright 2014
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
 
-#ifndef _FLASH_PART_H
-#define _FLASH_PART_H
+#pragma once
 
 #include <stdint.h>
 #include <libmtd.h>
@@ -58,5 +57,3 @@  struct flash_description *get_flash_info(void);
 #define isNand(flash, index) \
 	(flash->mtd_info[index].mtd.type == MTD_NANDFLASH || \
 	 flash->mtd_info[index].mtd.type == MTD_MLCNANDFLASH)
-
-#endif
diff --git a/include/fs_interface.h b/include/fs_interface.h
index dabdec3f..cab3dec6 100644
--- a/include/fs_interface.h
+++ b/include/fs_interface.h
@@ -1,11 +1,10 @@ 
 /*
- * Copyright (C) 2021 Stefano Babic <sbabic@denx.de>
+ * Copyright (C) 2021 Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _FS_INTERFACE_H
-#define _FS_INTERFACE_H
+#pragma once
 
 char *diskformat_fs_detect(char *device);
 int diskformat_fs_exists(char *device, char *fstype);
@@ -24,4 +23,3 @@  extern int ext_mkfs(const char *device_name, const char *fstype, unsigned long f
 #if defined (CONFIG_BTRFS_FILESYSTEM) 
 extern int btrfs_mkfs(const char *device_name, const char *fstype);
 #endif
-#endif
diff --git a/include/globals.h b/include/globals.h
index a30ec7c6..8aeb3f4d 100644
--- a/include/globals.h
+++ b/include/globals.h
@@ -1,12 +1,11 @@ 
 /*
  * (C) Copyright 2014
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _GLOBALS_H
-#define _GLOBALS_H
+#pragma once
 
 #define BANNER "SWUpdate v" SWU_VER "\n"
 
@@ -31,6 +30,3 @@ 
 #define SCRIPTS_DIR_SUFFIX	"scripts/"
 #define DATADST_DIR_SUFFIX	"datadst/"
 #define BOOT_SCRIPT_SUFFIX	"boot-script"
-
-#endif
-
diff --git a/include/handler.h b/include/handler.h
index 40ff9c04..b0b18149 100644
--- a/include/handler.h
+++ b/include/handler.h
@@ -1,14 +1,12 @@ 
 /*
  * (C) Copyright 2012-2013
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
- * 	on behalf of ifm electronic GmbH
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
 
-#ifndef _HANDLER_H
-#define _HANDLER_H
+#pragma once
 
 struct img_type;
 typedef enum {
@@ -58,5 +56,3 @@  struct installer_handler *find_handler(struct img_type *img);
 void print_registered_handlers(void);
 struct installer_handler *get_next_handler(void);
 unsigned int get_handler_mask(struct img_type *img);
-
-#endif
diff --git a/include/hw-compatibility.h b/include/hw-compatibility.h
index 3c2dca82..97d43c24 100644
--- a/include/hw-compatibility.h
+++ b/include/hw-compatibility.h
@@ -1,13 +1,11 @@ 
 /*
- * (C) Copyright 2023
- * Stefano Babic, sbabic@denx.de.
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_HW_COMPATIBILITY_H
-#define _SWUPDATE_HW_COMPATIBILITY_H
-
+#pragma once
 #include "bsdqueue.h"
 #include "globals.h"
 
@@ -21,6 +19,3 @@  LIST_HEAD(hwlist, hw_type);
 
 int check_hw_compatibility(struct hw_type *hwt, struct hwlist *hardware);
 int get_hw_revision(struct hw_type *hw);
-
-#endif
-
diff --git a/include/installer.h b/include/installer.h
index 80aa4426..613ecc71 100644
--- a/include/installer.h
+++ b/include/installer.h
@@ -1,13 +1,12 @@ 
 /*
  * (C) Copyright 2013
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
 
-#ifndef _INSTALLER_H
-#define _INSTALLER_H
+#pragma once
 
 #include <stdbool.h>
 #include "swupdate.h"
@@ -23,5 +22,3 @@  int install_from_file(const char *filename, bool check);
 int postupdate(struct swupdate_cfg *swcfg, const char *info);
 int preupdatecmd(struct swupdate_cfg *swcfg);
 void cleanup_files(struct swupdate_cfg *software);
-
-#endif
diff --git a/include/installer_priv.h b/include/installer_priv.h
index 901dbf4e..d1e3a4df 100644
--- a/include/installer_priv.h
+++ b/include/installer_priv.h
@@ -1,13 +1,11 @@ 
 /*
  * (C) Copyright 2020
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _INSTALLER_PRIV_H
-#define _INSTALLER_PRIV_H
-
+#pragma once
 #include "swupdate_status.h"
 #include "network_ipc.h"
 
@@ -20,5 +18,3 @@  struct installer {
 	struct swupdate_request req;
 	struct swupdate_cfg *software;
 };
-
-#endif
diff --git a/include/lua_util.h b/include/lua_util.h
index 4974eeb7..1d00bf82 100644
--- a/include/lua_util.h
+++ b/include/lua_util.h
@@ -1,14 +1,11 @@ 
 /*
- * (C) Copyright 2013
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
- * 	on behalf of ifm electronic GmbH
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _LUA_UTIL_H
-#define _LUA_UTIL_H
-
+#pragma once
 #ifdef CONFIG_LUA
 #include "lua.h"
 #include "lauxlib.h"
@@ -92,6 +89,3 @@  static inline int lua_parser_fn(lua_State __attribute__ ((__unused__)) *L,
 			 struct img_type __attribute__ ((__unused__)) *img) { return -1; }
 static inline int lua_handlers_init(void) { return 0; }
 #endif
-
-
-#endif
diff --git a/include/mongoose_interface.h b/include/mongoose_interface.h
index 845f7cbf..3ed7b4fb 100644
--- a/include/mongoose_interface.h
+++ b/include/mongoose_interface.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2012-2014
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2012-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _MONGOOSE_INTERFACE_H
-#define _MONGOOSE_INTERFACE_H
+#pragma once
 
 /*
  * Max number of command line options
@@ -19,5 +18,3 @@ 
 int start_mongoose(const char *cfgfname, int argc, char *argv[]);
 
 void mongoose_print_help(void);
-
-#endif
diff --git a/include/multipart_parser.h b/include/multipart_parser.h
index 0282e50a..71e4440d 100644
--- a/include/multipart_parser.h
+++ b/include/multipart_parser.h
@@ -3,8 +3,7 @@ 
  *
  * SPDX-License-Identifier: MIT
  */
-#ifndef _multipart_parser_h
-#define _multipart_parser_h
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -46,4 +45,3 @@  void *multipart_parser_get_data(multipart_parser * p);
 #ifdef __cplusplus
 }				/* extern "C" */
 #endif
-#endif
diff --git a/include/network_interface.h b/include/network_interface.h
index 5f138ad4..a636d990 100644
--- a/include/network_interface.h
+++ b/include/network_interface.h
@@ -1,14 +1,11 @@ 
 /*
- * (C) Copyright 2013
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de
- * 	on behalf of ifm electronic GmbH
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _NETWORK_INTERFACE_H
-#define _NETWORK_INTERFACE_H
-
+#pragma once
 void *network_initializer(void *data);
 void *network_thread(void *data);
 int listener_create(const char *path, int type);
@@ -16,4 +13,3 @@  int listener_create(const char *path, int type);
 extern bool stream_wkup;
 extern pthread_mutex_t stream_mutex;
 extern pthread_cond_t stream_cond;
-#endif
diff --git a/include/network_ipc.h b/include/network_ipc.h
index 4ce8ff4e..e0ef14a3 100644
--- a/include/network_ipc.h
+++ b/include/network_ipc.h
@@ -1,13 +1,11 @@ 
 /*
- * (C) Copyright 2008-2017
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
- * 	on behalf of ifm electronic GmbH
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     LGPL-2.1-or-later
  */
 
-#ifndef _IPC_H
-#define _IPC_H
+#pragma once
 
 #include <stdlib.h>
 #include <stdbool.h>
@@ -157,5 +155,3 @@  int swupdate_set_version_range(const char *minversion,
 #ifdef __cplusplus
 }   // extern "C"
 #endif
-
-#endif
diff --git a/include/parselib.h b/include/parselib.h
index a027d53a..7baf555d 100644
--- a/include/parselib.h
+++ b/include/parselib.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2016-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _PARSE_LIBRARY_H
-#define _PARSE_LIBRARY_H
+#pragma once
 
 #include <assert.h>
 #include <stdbool.h>
@@ -112,6 +111,3 @@  bool set_find_path(const char **nodes, const char *newpath, char **tmp);
 	d[0] = '\0'; \
 	GET_FIELD_STRING(p, e, name, d); \
 } while (0)
-
-
-#endif
diff --git a/include/parsers.h b/include/parsers.h
index e13f3b0d..0e94c2b6 100644
--- a/include/parsers.h
+++ b/include/parsers.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2008-2013
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _RECOVERY_PARSERS_H
-#define _RECOVERY_PARSERS_H
+#pragma once
 
 #include "generated/autoconf.h"
 
@@ -22,5 +21,3 @@  int parse(struct swupdate_cfg *swcfg, const char *filename);
 int parse_cfg (struct swupdate_cfg *swcfg, const char *filename);
 int parse_json(struct swupdate_cfg *swcfg, const char *filename);
 int parse_external(struct swupdate_cfg *swcfg, const char *filename);
-#endif
-
diff --git a/include/pctl.h b/include/pctl.h
index f8e2f9b0..d59f8319 100644
--- a/include/pctl.h
+++ b/include/pctl.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2016-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_PCTL_H
-#define _SWUPDATE_PCTL_H
+#pragma once
 
 #include <swupdate_status.h>
 #include <sys/types.h>
@@ -54,5 +53,3 @@  int pctl_getfd_from_type(sourcetype s);
 const char *pctl_getname_from_type(sourcetype s);
 int run_system_cmd(const char *cmd);
 int run_function_background(void *fn, int argc, char **argv);
-
-#endif
diff --git a/include/progress.h b/include/progress.h
index 513b26db..de680f47 100644
--- a/include/progress.h
+++ b/include/progress.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2016-2023
+ * Stefano Babic, <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _INSTALL_PROGRESS_H
-#define _INSTALL_PROGRESS_H
+#pragma once
 
 #include <swupdate_status.h>
 #include <progress_ipc.h>
@@ -28,5 +27,3 @@  void swupdate_progress_info(RECOVERY_STATUS status, int cause, const char *msg);
 void swupdate_download_update(unsigned int perc, unsigned long long totalbytes, sourcetype source);
 
 void *progress_bar_thread (void *data);
-
-#endif
diff --git a/include/progress_ipc.h b/include/progress_ipc.h
index 5d0be1ca..e00a081f 100644
--- a/include/progress_ipc.h
+++ b/include/progress_ipc.h
@@ -5,8 +5,7 @@ 
  * SPDX-License-Identifier:     LGPL-2.1-or-later
  */
 
-#ifndef _PROGRESS_IPC_H
-#define _PROGRESS_IPC_H
+#pragma once
 
 #include <stdbool.h>
 #include <swupdate_status.h>
@@ -55,5 +54,3 @@  int progress_ipc_receive(int *connfd, struct progress_msg *msg);
 #ifdef __cplusplus
 }   // extern "C"
 #endif
-
-#endif
diff --git a/include/semver.h b/include/semver.h
index e4d92950..37f85a75 100644
--- a/include/semver.h
+++ b/include/semver.h
@@ -6,8 +6,7 @@ 
  * SPDX-License-Identifier: MIT
  */
 
-#ifndef __SEMVER_H
-#define __SEMVER_H
+#pragma once
 
 #ifdef __cplusplus
 extern "C" {
@@ -102,5 +101,3 @@  semver_clean (char *s);
 #ifdef __cplusplus
 }
 #endif
-
-#endif
diff --git a/include/server_utils.h b/include/server_utils.h
index 8b249d51..9cca3a90 100644
--- a/include/server_utils.h
+++ b/include/server_utils.h
@@ -1,6 +1,6 @@ 
 /*
  * (C) Copyright 2018
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
diff --git a/include/sslapi.h b/include/sslapi.h
index 4668fe78..9f5b061c 100644
--- a/include/sslapi.h
+++ b/include/sslapi.h
@@ -5,8 +5,7 @@ 
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_SSL_H
-#define _SWUPDATE_SSL_H
+#pragma once
 
 #include <stdint.h>
 #include "util.h"
@@ -221,6 +220,3 @@  UNUSED static inline struct swupdate_digest *swupdate_DECRYPT_init(
 #define SSL_PURPOSE_CODE_SIGN  -1
 #define SSL_PURPOSE_DEFAULT -1
 #endif
-
-#endif
-
diff --git a/include/swupdate.h b/include/swupdate.h
index 3e1d160f..8f768a72 100644
--- a/include/swupdate.h
+++ b/include/swupdate.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2012-2014
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2013-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_H
-#define _SWUPDATE_H
+#pragma once
 
 #include <sys/types.h>
 #include <stdbool.h>
@@ -111,5 +110,3 @@  struct swupdate_cfg {
 int cpio_scan(int fd, struct swupdate_cfg *cfg, off_t start);
 struct swupdate_cfg *get_swupdate_cfg(void);
 void free_image(struct img_type *img);
-
-#endif
diff --git a/include/swupdate_dict.h b/include/swupdate_dict.h
index 0e949895..eb6f0ff0 100644
--- a/include/swupdate_dict.h
+++ b/include/swupdate_dict.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2016-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWDICT_H
-#define _SWDICT_H
+#pragma once
 
 #include <bsdqueue.h>
 
@@ -35,5 +34,3 @@  int dict_insert_value(struct dict *dictionary, const char *key, const char *valu
 void dict_remove(struct dict *dictionary, const char *key);
 void dict_drop_db(struct dict *dictionary);
 int dict_parse_script(struct dict *dictionary, const char *script);
-
-#endif
diff --git a/include/swupdate_image.h b/include/swupdate_image.h
index 7f6c015f..592a886b 100644
--- a/include/swupdate_image.h
+++ b/include/swupdate_image.h
@@ -1,12 +1,11 @@ 
 /*
  * (C) Copyright 2023
- * Stefano Babic, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_IMAGE_H
-#define _SWUPDATE_IMAGE_H
+#pragma once
 
 #include <sys/types.h>
 #include <stdbool.h>
@@ -72,6 +71,3 @@  struct img_type {
 };
 
 LIST_HEAD(imglist, img_type);
-
-#endif
-
diff --git a/include/swupdate_settings.h b/include/swupdate_settings.h
index 108b9fb2..073cc7cc 100644
--- a/include/swupdate_settings.h
+++ b/include/swupdate_settings.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2016-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_SETTINGS_H
-#define _SWUPDATE_SETTINGS_H
+#pragma once
 
 #include <unistd.h>
 
@@ -69,5 +68,3 @@  static inline int settings_into_dict(void __attribute__ ((__unused__)) *settings
 	return -1;
 }
 #endif
-
-#endif
diff --git a/include/swupdate_status.h b/include/swupdate_status.h
index 29eea0f5..6d737cbc 100644
--- a/include/swupdate_status.h
+++ b/include/swupdate_status.h
@@ -1,13 +1,11 @@ 
 /*
- * (C) Copyright 2015-2017
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2015-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     LGPL-2.1-or-later
  */
 
-#ifndef _SWUPDATE_STATUS_H
-#define _SWUPDATE_STATUS_H
-
+#pragma once
 #ifdef __cplusplus
 extern "C" {
 #endif
@@ -42,5 +40,3 @@  typedef enum {
 #ifdef __cplusplus
 }   // extern "C"
 #endif
-
-#endif
diff --git a/include/swupdate_vars.h b/include/swupdate_vars.h
index 0334f427..cbff84e5 100644
--- a/include/swupdate_vars.h
+++ b/include/swupdate_vars.h
@@ -5,8 +5,7 @@ 
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWVARS_H
-#define _SWVARS_H
+#pragma once
 
 #include <libuboot.h>
 
@@ -15,5 +14,3 @@  int swupdate_vars_apply_list(const char *filename, const char *namespace);
 char *swupdate_vars_get(const char *name, const char *namespace);
 int swupdate_vars_set(const char *name, const char *value, const char *namespace);
 int swupdate_vars_unset(const char *name, const char *namespace);
-
-#endif
diff --git a/include/util.h b/include/util.h
index 4202caa4..dc0b957b 100644
--- a/include/util.h
+++ b/include/util.h
@@ -1,12 +1,11 @@ 
 /*
- * (C) Copyright 2012-2016
- * Stefano Babic, DENX Software Engineering, sbabic@denx.de.
+ * (C) Copyright 2012-2023
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _UTIL_H
-#define _UTIL_H
+#pragma once
 
 #include <fcntl.h>
 #include <stdint.h>
@@ -272,4 +271,3 @@  int swupdate_umount(const char *dir);
 
 /* Date / Time utilities */
 char *swupdate_time_iso8601(struct timeval *tv);
-#endif
diff --git a/include/versions.h b/include/versions.h
index b85f7189..7f883be2 100644
--- a/include/versions.h
+++ b/include/versions.h
@@ -1,15 +1,12 @@ 
 /*
  * (C) Copyright 2023
- * Stefano Babic, sbabic@denx.de.
+ * Stefano Babic <stefano.babic@swupdate.org>
  *
  * SPDX-License-Identifier:     GPL-2.0-only
  */
 
-#ifndef _SWUPDATE_VERSION_H
-#define _SWUPDATE_VERSION_H
+#pragma once
 
 #include "swupdate_settings.h"
 void get_sw_versions(swupdate_cfg_handle *handle, struct swupdate_cfg *sw);
 
-#endif
-