Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys remove __packed attribute from struct ieee80211_radiotap...



details:   https://anonhg.NetBSD.org/src/rev/d8a02b131fed
branches:  trunk
changeset: 455058:d8a02b131fed
user:      mrg <mrg%NetBSD.org@localhost>
date:      Sat Oct 05 23:27:20 2019 +0000

description:
remove __packed attribute from struct ieee80211_radiotap_header
and all the structures that include it.

this should not change anything while avoiding packed vs alignment
warnings from GCC 8, and potentially pessimised code generation
due to the packed marker (there are no misaligned members, just
that the per-device parts may end unaligned.)

all consumers of these members are done from the properly aligned
packet members directly, or, as a union with a 64 byte member,
also properly aligned.  codegen didn't appear to change, except
for the definition of sizeof(struct driver_[rt]x_radiotap_header)
in debug info, which is not directly used anywhere.

diffstat:

 sys/dev/ic/anvar.h                |   6 ++--
 sys/dev/ic/athnvar.h              |   6 ++--
 sys/dev/ic/atwvar.h               |   6 ++--
 sys/dev/ic/malovar.h              |   4 +-
 sys/dev/ic/mfireg.h               |  43 +++++++++++++++++++-------------------
 sys/dev/ic/nvmereg.h              |   6 ++--
 sys/dev/ic/rt2560var.h            |   6 ++--
 sys/dev/ic/rt2661var.h            |   6 ++--
 sys/dev/ic/rt2860var.h            |   6 ++--
 sys/dev/ic/rtwvar.h               |   6 ++--
 sys/dev/ic/wivar.h                |   6 ++--
 sys/dev/pci/if_ipwvar.h           |   6 ++--
 sys/dev/pci/if_iwmvar.h           |   6 ++--
 sys/dev/pci/if_iwnvar.h           |   6 ++--
 sys/dev/pci/if_rtwnreg.h          |   6 ++--
 sys/dev/usb/if_otusvar.h          |   6 ++--
 sys/dev/usb/if_rumvar.h           |   6 ++--
 sys/dev/usb/if_runvar.h           |   6 ++--
 sys/dev/usb/if_upgtvar.h          |   6 ++--
 sys/dev/usb/if_uralvar.h          |   6 ++--
 sys/dev/usb/if_urtwnvar.h         |   6 ++--
 sys/dev/usb/if_urtwreg.h          |   4 +-
 sys/dev/usb/if_zydreg.h           |   6 ++--
 sys/net80211/ieee80211_radiotap.h |   4 +-
 24 files changed, 87 insertions(+), 88 deletions(-)

diffs (truncated from 757 to 300 lines):

diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/anvar.h
--- a/sys/dev/ic/anvar.h        Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/anvar.h        Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: anvar.h,v 1.21 2017/02/02 10:05:35 nonaka Exp $        */
+/*     $NetBSD: anvar.h,v 1.22 2019/10/05 23:27:20 mrg Exp $   */
 /*
  * Copyright (c) 1997, 1998, 1999
  *     Bill Paul <wpaul%ctr.columbia.edu@localhost>.  All rights reserved.
@@ -86,7 +86,7 @@
         u_int16_t                               ar_chan_freq;
         u_int16_t                               ar_chan_flags;
         int8_t                                  ar_antsignal;
-} __packed;
+};
 
 #define AN_TX_RADIOTAP_PRESENT  ((1 << IEEE80211_RADIOTAP_FLAGS) | \
                                  (1 << IEEE80211_RADIOTAP_RATE) | \
@@ -98,7 +98,7 @@
         u_int8_t                                at_rate;
         u_int16_t                               at_chan_freq;
         u_int16_t                               at_chan_flags;
-} __packed;
+};
 
 #define        AN_GAPLEN_MAX   8
 
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/athnvar.h
--- a/sys/dev/ic/athnvar.h      Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/athnvar.h      Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: athnvar.h,v 1.7 2019/09/13 07:55:06 msaitoh Exp $      */
+/*     $NetBSD: athnvar.h,v 1.8 2019/10/05 23:27:20 mrg Exp $  */
 /*     $OpenBSD: athnvar.h,v 1.34 2013/10/21 16:13:49 stsp Exp $       */
 
 /*-
@@ -75,7 +75,7 @@
        uint16_t        wr_chan_flags;
        int8_t          wr_dbm_antsignal;
        uint8_t         wr_antenna;
-} __packed;
+};
 
 #define ATHN_RX_RADIOTAP_PRESENT                                       \
        (1 << IEEE80211_RADIOTAP_TSFT |                                 \
@@ -91,7 +91,7 @@
        uint8_t         wt_rate;
        uint16_t        wt_chan_freq;
        uint16_t        wt_chan_flags;
-} __packed;
+};
 
 #define ATHN_TX_RADIOTAP_PRESENT                                       \
        (1 << IEEE80211_RADIOTAP_FLAGS |                                \
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/atwvar.h
--- a/sys/dev/ic/atwvar.h       Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/atwvar.h       Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: atwvar.h,v 1.39 2018/04/19 21:50:08 christos Exp $     */
+/*     $NetBSD: atwvar.h,v 1.40 2019/10/05 23:27:20 mrg Exp $  */
 
 /*
  * Copyright (c) 2003, 2004 The NetBSD Foundation, Inc.  All rights reserved.
@@ -146,7 +146,7 @@
        uint16_t                                ar_chan_freq;
        uint16_t                                ar_chan_flags;
        uint8_t                                 ar_antsignal;
-} __packed;
+};
 
 #define ATW_TX_RADIOTAP_PRESENT        ((1 << IEEE80211_RADIOTAP_RATE) | \
                                 (1 << IEEE80211_RADIOTAP_CHANNEL))
@@ -157,7 +157,7 @@
        uint8_t                                 at_pad;
        uint16_t                                at_chan_freq;
        uint16_t                                at_chan_flags;
-} __packed;
+};
 
 enum atw_revision {
        ATW_REVISION_AB = 0x11, /* ADM8211A */
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/malovar.h
--- a/sys/dev/ic/malovar.h      Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/malovar.h      Sat Oct 05 23:27:20 2019 +0000
@@ -59,7 +59,7 @@
        uint8_t                                 wr_flags;
        uint16_t                                wr_chan_freq;
        uint16_t                                wr_chan_flags;
-} __packed;
+};
 
 #define MALO_TX_RADIOTAP_PRESENT                                       \
        ((1 << IEEE80211_RADIOTAP_FLAGS) |                              \
@@ -72,7 +72,7 @@
        uint8_t                                 wt_rate;
        uint16_t                                wt_chan_freq;
        uint16_t                                wt_chan_flags;
-} __packed;
+};
 
 struct malo_softc {
        device_t                sc_dev;
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/mfireg.h
--- a/sys/dev/ic/mfireg.h       Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/mfireg.h       Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: mfireg.h,v 1.9 2018/11/24 18:10:29 bouyer Exp $ */
+/* $NetBSD: mfireg.h,v 1.10 2019/10/05 23:27:20 mrg Exp $ */
 /* $OpenBSD: mfireg.h,v 1.24 2006/06/19 19:05:45 marco Exp $ */
 /*
  * Copyright (c) 2006 Marco Peereboom <marco%peereboom.us@localhost>
@@ -269,7 +269,7 @@
        uint8_t                 b[MFI_MBOX_SIZE];
        uint16_t                s[6];
        uint32_t                w[3];
-} __packed __aligned(4);
+};
 
 /* mfi completion codes */
 typedef enum {
@@ -417,13 +417,13 @@
 /* sense buffer */
 struct mfi_sense {
        uint8_t                 mse_data[MFI_SENSE_SIZE];
-} __packed;
+};
 
 /* scatter gather elements */
 struct mfi_sg32 {
        uint32_t                addr;
        uint32_t                len;
-} __packed;
+};
 
 struct mfi_sg64 {
        uint64_t                addr;
@@ -434,14 +434,14 @@
        uint64_t                addr;
        uint32_t                len;
        uint32_t                flags;
-} __packed;
+};
 
 
 union mfi_sgl {
        struct mfi_sg32         sg32[1];
        struct mfi_sg64         sg64[1];
        struct mfi_sg_ieee      sg_ieee[1];
-} __packed;
+};
 
 /* message frame */
 struct mfi_frame_header {
@@ -458,7 +458,7 @@
        uint16_t                mfh_flags;
        uint16_t                mfh_timeout;
        uint32_t                mfh_data_len;
-} __packed;
+};
 
 union mfi_sgl_frame {
        struct mfi_sg32         sge32[8];
@@ -514,7 +514,7 @@
        uint32_t                mdf_opcode;
        union mfi_mbox          mdf_mbox;
        union mfi_sgl           mdf_sgl;
-} __packed;
+};
 #define MFI_DCMD_MBOX_PEND_FLAG        0x1
 
 struct mfi_abort_frame {
@@ -524,7 +524,7 @@
        uint32_t                maf_abort_mfi_addr_lo;
        uint32_t                maf_abort_mfi_addr_hi;
        uint32_t                maf_reserved[6];
-} __packed;
+};
 
 struct mfi_smp_frame {
        struct mfi_frame_header msf_header;
@@ -562,10 +562,9 @@
                uint16_t        locale;
                uint8_t         reserved;
                int8_t          class;
-       } __packed              mec_members;
-
+       }                       mec_members;
        uint32_t                mec_word;
-} __packed;
+};
 
 struct mfi_evt_log_info {
        uint32_t                mel_newest_seq_num;
@@ -573,30 +572,30 @@
        uint32_t                mel_clear_seq_num;
        uint32_t                mel_shutdown_seq_num;
        uint32_t                mel_boot_seq_num;
-} __packed;
+};
 
 struct mfi_progress {
        uint16_t                mp_progress;
        uint16_t                mp_elapsed_seconds;
-} __packed;
+};
 
 struct mfi_evtarg_ld {
        uint16_t                mel_target_id;
        uint8_t                 mel_ld_index;
        uint8_t                 mel_reserved;
-} __packed;
+};
 
 struct mfi_evtarg_pd {
        uint16_t                mep_device_id;
        uint8_t                 mep_encl_index;
        uint8_t                 mep_slot_number;
-} __packed;
+};
 
 struct mfi_evtarg_pd_state {
        struct mfi_evtarg_pd    pd;
        uint32_t                prev_state;
        uint32_t                new_state;
-} __packed;
+};
 
 struct mfi_evtarg_pd_address {
        uint16_t                device_id;
@@ -606,22 +605,22 @@
                struct {
                        uint8_t                 encl_index;
                        uint8_t                 slot_number;
-               } __packed              pd_address;
+               }                       pd_address;
                struct {
                        uint8_t                 encl_position;
                        uint8_t                 encl_connector_index;
-               } __packed              encl_address;
-       } __packed              address;
+               }                       encl_address;
+       }                       address;
 
         uint8_t                        scsi_dev_type;
 
        union {
                uint8_t                 port_bitmap;
                uint8_t                 port_numbers;
-       } __packed              connected;
+       }                       connected;
 
        uint64_t                sas_addr[2];
-} __packed __aligned(8);
+};
 
 struct mfi_evt_detail {
        uint32_t                                med_seq_num;
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/nvmereg.h
--- a/sys/dev/ic/nvmereg.h      Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/nvmereg.h      Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: nvmereg.h,v 1.13 2018/12/01 18:25:39 jdolecek Exp $    */
+/*     $NetBSD: nvmereg.h,v 1.14 2019/10/05 23:27:20 mrg Exp $ */
 /*     $OpenBSD: nvmereg.h,v 1.10 2016/04/14 11:18:32 dlg Exp $ */
 
 /*
@@ -136,7 +136,7 @@
        union {
                uint64_t        prp[2];
                struct nvme_sge sge;
-       } __packed      entry;
+       } entry;
 
        uint32_t        cdw10;
        uint32_t        cdw11;
@@ -189,7 +189,7 @@
        union {
                uint64_t        prp[2];
                struct nvme_sge sge;
-       } __packed      entry;
+       } entry;
 
        uint64_t        slba;   /* Starting LBA */
 
diff -r 7998383a1aa1 -r d8a02b131fed sys/dev/ic/rt2560var.h
--- a/sys/dev/ic/rt2560var.h    Sat Oct 05 22:37:49 2019 +0000
+++ b/sys/dev/ic/rt2560var.h    Sat Oct 05 23:27:20 2019 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: rt2560var.h,v 1.10 2017/02/02 10:05:35 nonaka Exp $    */
+/*     $NetBSD: rt2560var.h,v 1.11 2019/10/05 23:27:20 mrg Exp $       */
 /*     $OpenBSD: rt2560var.h,v 1.2 2006/01/14 12:43:27 damien Exp $  */
 
 /*-
@@ -27,7 +27,7 @@
        uint16_t        wr_chan_flags;
        uint8_t         wr_antenna;
        uint8_t         wr_antsignal;
-} __packed;
+};
 



Home | Main Index | Thread Index | Old Index