From patchwork Wed Mar 4 04:20:07 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Shannon Nelson X-Patchwork-Id: 1248789 X-Patchwork-Delegate: davem@davemloft.net Return-Path: X-Original-To: patchwork-incoming-netdev@ozlabs.org Delivered-To: patchwork-incoming-netdev@ozlabs.org Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=netdev-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=pensando.io Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=pensando.io header.i=@pensando.io header.a=rsa-sha256 header.s=google header.b=NyGAEY5R; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 48XLJr2DDZz9sP7 for ; Wed, 4 Mar 2020 15:20:28 +1100 (AEDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727692AbgCDEU1 (ORCPT ); Tue, 3 Mar 2020 23:20:27 -0500 Received: from mail-pg1-f195.google.com ([209.85.215.195]:42250 "EHLO mail-pg1-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727327AbgCDEU0 (ORCPT ); Tue, 3 Mar 2020 23:20:26 -0500 Received: by mail-pg1-f195.google.com with SMTP id h8so344309pgs.9 for ; Tue, 03 Mar 2020 20:20:24 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pensando.io; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=KKBKvNcJGY1TZuV+ovrL2wWJl2GnYYxVCVyMuW9EBv0=; b=NyGAEY5R1dSBgmNdQWCt6UwzSQEQxhz1EzfyvMuNzJlpyY2UGPOMmJzS8nrrDyO1Lx 4xonKPgx+6/f5K7Qhz5m9j+2SlcJkzKriu7poaF2TomCrCXaIvXHooI+st4OaSHx0pMt 7wHkiGgOGhqI7wwWsrr3mtMRY7JH4EnHHyFNaayvu/xmVNw/USmtwmzl/3qQ0U32/DdP TzOu25eCdSf+LcWlM2xJtgGdFzgERFTnEfqHpjFPzu1BxUBicERwot9KdLpir6GdhbkS 7Ny4Cm3axIiT1X8DmZFrP/4oeYiLkSWaPoVcD37ZGZybJ7a0yc+eIODBV5U2CmuOmCKa ZIrA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=KKBKvNcJGY1TZuV+ovrL2wWJl2GnYYxVCVyMuW9EBv0=; b=qig/wKe16Epdfh1nWnsOoLP0teBwGpy1Ji1gA7QglhyT8niOA3TMu9TjpEeEDKKoCP oqrtPc7t5ti1ekNABKWCABpGhy6rvjJuXcbV/f9UdZaPcC97SONJVCYe0b/bLN4K6Kd+ Z7OW4NfCWr0LX88RzXbM1Kgbe/Ymq+gS8hlOyNfOLsZfguKsQvUOJuXkHCYa1/Fxfpot rbzbhacqn9CPprr0FS0tmNh6817kbKTQY5PTy0KmyYcQhkAIRuaIxh60bXGfGi39lW7j IUnNmDiTWio8nuwwePftA74fzEW4Z2mbf97xnk+R02KLWts7P+zo/CgxuiP5apCcC5Fp jIOw== X-Gm-Message-State: ANhLgQ2cGByLqwzsO/HApLYDPeWKqia1u/NjNsIYCt8Ly6H+8QLDHqS5 coAxMTOPaxXLU23QKAf7Dafpx1XpCko= X-Google-Smtp-Source: ADFU+vsrsm23z67vx+/wnFffUGyeUaVcIpCNPhTr9/VSvCpMqsZjmyCuitkuBCnlp6O6bwH5yO3T5A== X-Received: by 2002:a62:e70e:: with SMTP id s14mr1177259pfh.115.1583295623769; Tue, 03 Mar 2020 20:20:23 -0800 (PST) Received: from driver-dev1.pensando.io ([12.226.153.42]) by smtp.gmail.com with ESMTPSA id c2sm671702pjo.28.2020.03.03.20.20.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 03 Mar 2020 20:20:23 -0800 (PST) From: Shannon Nelson To: davem@davemloft.net, netdev@vger.kernel.org Cc: Shannon Nelson Subject: [PATCH v2 net-next 2/8] ionic: remove pragma packed Date: Tue, 3 Mar 2020 20:20:07 -0800 Message-Id: <20200304042013.51970-3-snelson@pensando.io> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200304042013.51970-1-snelson@pensando.io> References: <20200304042013.51970-1-snelson@pensando.io> Sender: netdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org Replace the misguided "#pragma packed" with tags on each struct/union definition that actually needs it. This is safer and more efficient on the various compilers and architectures. Signed-off-by: Shannon Nelson --- .../net/ethernet/pensando/ionic/ionic_if.h | 38 +++++++++---------- 1 file changed, 17 insertions(+), 21 deletions(-) diff --git a/drivers/net/ethernet/pensando/ionic/ionic_if.h b/drivers/net/ethernet/pensando/ionic/ionic_if.h index ce07c2931a72..74697c25cd40 100644 --- a/drivers/net/ethernet/pensando/ionic/ionic_if.h +++ b/drivers/net/ethernet/pensando/ionic/ionic_if.h @@ -4,8 +4,6 @@ #ifndef _IONIC_IF_H_ #define _IONIC_IF_H_ -#pragma pack(push, 1) - #define IONIC_DEV_INFO_SIGNATURE 0x44455649 /* 'DEVI' */ #define IONIC_DEV_INFO_VERSION 1 #define IONIC_IFNAMSIZ 16 @@ -366,7 +364,7 @@ union ionic_lif_config { u8 rsvd2[2]; __le64 features; __le32 queue_count[IONIC_QTYPE_MAX]; - }; + } __attribute__((packed)); __le32 words[64]; }; @@ -417,7 +415,7 @@ union ionic_lif_identity { __le32 max_frame_size; u8 rsvd2[106]; union ionic_lif_config config; - } eth; + } __attribute__((packed)) eth; struct { u8 version; @@ -439,8 +437,8 @@ union ionic_lif_identity { struct ionic_lif_logical_qtype rq_qtype; struct ionic_lif_logical_qtype cq_qtype; struct ionic_lif_logical_qtype eq_qtype; - } rdma; - }; + } __attribute((packed)) rdma; + } __attribute((packed)); __le32 words[512]; }; @@ -526,7 +524,7 @@ struct ionic_q_init_cmd { __le64 sg_ring_base; __le32 eq_index; u8 rsvd2[16]; -}; +} __attribute__((packed)); /** * struct ionic_q_init_comp - Queue init command completion @@ -1095,7 +1093,7 @@ struct ionic_port_status { u8 status; u8 rsvd[51]; struct ionic_xcvr_status xcvr; -}; +} __attribute((packed)); /** * struct ionic_port_identify_cmd - Port identify command @@ -1251,7 +1249,7 @@ struct ionic_port_getattr_comp { u8 pause_type; u8 loopback_mode; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1319,7 +1317,7 @@ struct ionic_dev_setattr_cmd { char name[IONIC_IFNAMSIZ]; __le64 features; u8 rsvd2[60]; - }; + } __attribute__((packed)); }; /** @@ -1334,7 +1332,7 @@ struct ionic_dev_setattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1361,7 +1359,7 @@ struct ionic_dev_getattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1426,7 +1424,7 @@ struct ionic_lif_setattr_cmd { } rss; u8 stats_ctl; u8 rsvd[60]; - }; + } __attribute__((packed)); }; /** @@ -1444,7 +1442,7 @@ struct ionic_lif_setattr_comp { union { __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1483,7 +1481,7 @@ struct ionic_lif_getattr_comp { u8 mac[6]; __le64 features; u8 rsvd2[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -1688,7 +1686,7 @@ struct ionic_vf_setattr_cmd { u8 linkstate; __le64 stats_pa; u8 pad[60]; - }; + } __attribute__((packed)); }; struct ionic_vf_setattr_comp { @@ -1726,7 +1724,7 @@ struct ionic_vf_getattr_comp { u8 linkstate; __le64 stats_pa; u8 pad[11]; - }; + } __attribute__((packed)); u8 color; }; @@ -2471,7 +2469,7 @@ union ionic_dev_cmd_regs { union ionic_dev_cmd_comp comp; u8 rsvd[48]; u32 data[478]; - }; + } __attribute__((packed)); u32 words[512]; }; @@ -2484,7 +2482,7 @@ union ionic_dev_regs { struct { union ionic_dev_info_regs info; union ionic_dev_cmd_regs devcmd; - }; + } __attribute__((packed)); __le32 words[1024]; }; @@ -2574,6 +2572,4 @@ struct ionic_identity { union ionic_qos_identity qos; }; -#pragma pack(pop) - #endif /* _IONIC_IF_H_ */