Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 31 May 2021 18:57:15 GMT
From:      Dmitry Chagin <dchagin@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 19593f775c23 - main - linux(4); Retire unnecessary __packed attribute from some struct's definition.
Message-ID:  <202105311857.14VIvFrf004731@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by dchagin:

URL: https://cgit.FreeBSD.org/src/commit/?id=19593f775c23623571cac4cf638996f5c11e91f4

commit 19593f775c23623571cac4cf638996f5c11e91f4
Author:     Dmitry Chagin <dchagin@FreeBSD.org>
AuthorDate: 2021-05-31 18:56:34 +0000
Commit:     Dmitry Chagin <dchagin@FreeBSD.org>
CommitDate: 2021-05-31 18:56:34 +0000

    linux(4); Retire unnecessary __packed attribute from some struct's
    definition.
    
    Differential Revision:  https://reviews.freebsd.org/D30482
    MFC after:              2 weeks
---
 sys/amd64/linux/linux.h   |  5 +++--
 sys/amd64/linux32/linux.h | 53 ++++++++++++++++++++++++-----------------------
 sys/arm64/linux/linux.h   |  5 +++--
 sys/i386/linux/linux.h    |  2 +-
 4 files changed, 34 insertions(+), 31 deletions(-)

diff --git a/sys/amd64/linux/linux.h b/sys/amd64/linux/linux.h
index 4e27fd51a72d..a9ed66689b64 100644
--- a/sys/amd64/linux/linux.h
+++ b/sys/amd64/linux/linux.h
@@ -369,7 +369,8 @@ struct l_ifmap {
 	u_char		irq;
 	u_char		dma;
 	u_char		port;
-} __packed;
+	/* 3 bytes spare */
+};
 
 struct l_ifreq {
 	union {
@@ -389,7 +390,7 @@ struct l_ifreq {
 		char		ifru_slave[LINUX_IFNAMSIZ];
 		l_uintptr_t	ifru_data;
 	} ifr_ifru;
-} __packed;
+};
 
 #define	ifr_name	ifr_ifrn.ifrn_name	/* Interface name */
 #define	ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address */
diff --git a/sys/amd64/linux32/linux.h b/sys/amd64/linux32/linux.h
index 286b9b52801c..6f26974a75a1 100644
--- a/sys/amd64/linux32/linux.h
+++ b/sys/amd64/linux32/linux.h
@@ -89,7 +89,7 @@ typedef	l_ulong		l_fd_mask;
 
 typedef struct {
 	l_int		val[2];
-} __packed l_fsid_t;
+} l_fsid_t;
 
 typedef struct {
 	l_time_t	tv_sec;
@@ -114,7 +114,7 @@ struct l___sysctl_args
 	l_uintptr_t	newval;
 	l_size_t	newlen;
 	l_ulong		__spare[4];
-} __packed;
+};
 
 /* Resource limits */
 #define	LINUX_RLIMIT_CPU	0
@@ -133,7 +133,7 @@ struct l___sysctl_args
 struct l_rlimit {
 	l_ulong rlim_cur;
 	l_ulong rlim_max;
-} __packed;
+};
 
 struct l_rusage {
 	l_timeval ru_utime;
@@ -152,7 +152,7 @@ struct l_rusage {
 	l_long	ru_nsignals;
 	l_long	ru_nvcsw;
 	l_long	ru_nivcsw;
-} __packed;
+};
 
 struct l_mmap_argv {
 	l_uintptr_t	addr;
@@ -169,7 +169,7 @@ struct l_mmap_argv {
 struct l_timespec {
 	l_time_t	tv_sec;
 	l_long		tv_nsec;
-} __packed;
+};
 
 struct l_newstat {
 	l_ushort	st_dev;
@@ -189,7 +189,7 @@ struct l_newstat {
 	struct l_timespec	st_ctim;
 	l_ulong		__unused4;
 	l_ulong		__unused5;
-} __packed;
+};
 
 struct l_stat {
 	l_ushort	st_dev;
@@ -271,7 +271,7 @@ typedef struct {
 	l_osigset_t	lsa_mask;
 	l_ulong		lsa_flags;
 	l_uintptr_t	lsa_restorer;
-} __packed l_osigaction_t;
+} l_osigaction_t;
 
 typedef struct {
 	l_handler_t	lsa_handler;
@@ -284,7 +284,7 @@ typedef struct {
 	l_uintptr_t	ss_sp;
 	l_int		ss_flags;
 	l_size_t	ss_size;
-} __packed l_stack_t;
+} l_stack_t;
 
 /* The Linux sigcontext, pretty much a standard 386 trapframe. */
 struct l_sigcontext {
@@ -310,7 +310,7 @@ struct l_sigcontext {
 	l_uint		sc_387;
 	l_uint		sc_mask;
 	l_uint		sc_cr2;
-} __packed;
+};
 
 struct l_ucontext {
 	l_ulong		uc_flags;
@@ -338,7 +338,7 @@ typedef struct l_siginfo {
 		struct {
 			l_pid_t		_pid;
 			l_uid_t		_uid;
-		} __packed _kill;
+		} _kill;
 
 		struct {
 			l_timer_t	_tid;
@@ -346,13 +346,13 @@ typedef struct l_siginfo {
 			char		_pad[sizeof(l_uid_t) - sizeof(l_int)];
 			l_sigval_t	_sigval;
 			l_int		_sys_private;
-		} __packed _timer;
+		} _timer;
 
 		struct {
 			l_pid_t		_pid;		/* sender's pid */
 			l_uid_t		_uid;		/* sender's uid */
 			l_sigval_t	_sigval;
-		} __packed _rt;
+		} _rt;
 
 		struct {
 			l_pid_t		_pid;		/* which child */
@@ -360,18 +360,18 @@ typedef struct l_siginfo {
 			l_int		_status;	/* exit code */
 			l_clock_t	_utime;
 			l_clock_t	_stime;
-		} __packed _sigchld;
+		} _sigchld;
 
 		struct {
 			l_uintptr_t	_addr;	/* Faulting insn/memory ref. */
-		} __packed _sigfault;
+		} _sigfault;
 
 		struct {
 			l_long		_band;	/* POLL_IN,POLL_OUT,POLL_MSG */
 			l_int		_fd;
-		} __packed _sigpoll;
+		} _sigpoll;
 	} _sifields;
-} __packed l_siginfo_t;
+} l_siginfo_t;
 
 #define	lsi_pid		_sifields._kill._pid
 #define	lsi_uid		_sifields._kill._uid
@@ -391,17 +391,17 @@ typedef struct l_siginfo {
 struct l_fpreg {
 	u_int16_t	significand[4];
 	u_int16_t	exponent;
-} __packed;
+};
 
 struct l_fpxreg {
 	u_int16_t	significand[4];
 	u_int16_t	exponent;
 	u_int16_t	padding[3];
-} __packed;
+};
 
 struct l_xmmreg {
 	u_int32_t	element[4];
-} __packed;
+};
 
 struct l_fpstate {
 	/* Regular FPU environment */
@@ -423,7 +423,7 @@ struct l_fpstate {
 	struct l_fpxreg		_fxsr_st[8];	/* reg data is ignored. */
 	struct l_xmmreg		_xmm[8];
 	u_int32_t		padding[56];
-} __packed;
+};
 
 /*
  * We make the stack look like Linux expects it when calling a signal
@@ -437,7 +437,7 @@ struct l_sigframe {
 	struct l_fpstate	sf_fpstate;
 	l_uint			sf_extramask[1];
 	l_handler_t		sf_handler;
-} __packed;
+};
 
 struct l_rt_sigframe {
 	l_int			sf_sig;
@@ -461,7 +461,7 @@ union l_semun {
 	l_uintptr_t	array;
 	l_uintptr_t	__buf;
 	l_uintptr_t	__pad;
-} __packed;
+};
 
 struct l_ifmap {
 	l_ulong		mem_start;
@@ -470,7 +470,8 @@ struct l_ifmap {
 	u_char		irq;
 	u_char		dma;
 	u_char		port;
-} __packed;
+	/* 3 bytes spare */
+};
 
 struct l_ifreq {
 	union {
@@ -490,7 +491,7 @@ struct l_ifreq {
 		char		ifru_slave[LINUX_IFNAMSIZ];
 		l_uintptr_t	ifru_data;
 	} ifr_ifru;
-} __packed;
+};
 
 #define	ifr_name	ifr_ifrn.ifrn_name	/* Interface name */
 #define	ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address */
@@ -502,7 +503,7 @@ struct l_ifconf {
 		l_uintptr_t	ifcu_buf;
 		l_uintptr_t	ifcu_req;
 	} ifc_ifcu;
-} __packed;
+};
 
 #define	ifc_buf		ifc_ifcu.ifcu_buf
 #define	ifc_req		ifc_ifcu.ifcu_req
@@ -526,7 +527,7 @@ struct l_pollfd {
 	l_int		fd;
 	l_short		events;
 	l_short		revents;
-} __packed;
+};
 
 struct l_user_desc {
 	l_uint		entry_number;
diff --git a/sys/arm64/linux/linux.h b/sys/arm64/linux/linux.h
index f3cf03dffd66..5d4739223275 100644
--- a/sys/arm64/linux/linux.h
+++ b/sys/arm64/linux/linux.h
@@ -258,7 +258,8 @@ struct l_ifmap {
 	u_char		irq;
 	u_char		dma;
 	u_char		port;
-} __packed;
+	/* 3 bytes spare*/
+};
 
 struct l_ifreq {
 	union {
@@ -278,7 +279,7 @@ struct l_ifreq {
 		char		ifru_slave[LINUX_IFNAMSIZ];
 		l_uintptr_t	ifru_data;
 	} ifr_ifru;
-} __packed;
+};
 
 #define	ifr_name	ifr_ifrn.ifrn_name	/* Interface name */
 #define	ifr_hwaddr	ifr_ifru.ifru_hwaddr	/* MAC address */
diff --git a/sys/i386/linux/linux.h b/sys/i386/linux/linux.h
index ab78a9649511..7a8de667e176 100644
--- a/sys/i386/linux/linux.h
+++ b/sys/i386/linux/linux.h
@@ -132,7 +132,7 @@ struct l_mmap_argv {
 	l_int		flags;
 	l_int		fd;
 	l_off_t		pgoff;
-} __packed;
+};
 
 /*
  * stat family of syscalls



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202105311857.14VIvFrf004731>