lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241204150224.346606-1-mateusz.polchlopek@intel.com>
Date: Wed,  4 Dec 2024 16:02:24 +0100
From: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
To: intel-wired-lan@...ts.osuosl.org
Cc: netdev@...r.kernel.org,
	Mateusz Polchlopek <mateusz.polchlopek@...el.com>,
	Marcin Szycik <marcin.szycik@...ux.intel.com>
Subject: [Intel-wired-lan] [PATCH iwl-net v1] ice: move static_assert to declaration section

static_assert() needs to be placed in the declaration section,
so move it there in ice_cfg_tx_topo() function.

Current code causes following warnings on some gcc versions:
error: ISO C90 forbids mixed declarations and code
[-Werror=declaration-after-statement]

Fixes: c188afdc3611 ("ice: fix memleak in ice_init_tx_topology()")
Reviewed-by: Marcin Szycik <marcin.szycik@...ux.intel.com>
Signed-off-by: Mateusz Polchlopek <mateusz.polchlopek@...el.com>
---
 drivers/net/ethernet/intel/ice/ice_ddp.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/intel/ice/ice_ddp.c b/drivers/net/ethernet/intel/ice/ice_ddp.c
index 69d5b1a28491..e885f84520ba 100644
--- a/drivers/net/ethernet/intel/ice/ice_ddp.c
+++ b/drivers/net/ethernet/intel/ice/ice_ddp.c
@@ -2388,6 +2388,8 @@ int ice_cfg_tx_topo(struct ice_hw *hw, const void *buf, u32 len)
 	int status;
 	u8 flags;
 
+	static_assert(ICE_PKG_BUF_SIZE == ICE_AQ_MAX_BUF_LEN);
+
 	if (!buf || !len)
 		return -EINVAL;
 
@@ -2482,7 +2484,6 @@ int ice_cfg_tx_topo(struct ice_hw *hw, const void *buf, u32 len)
 	}
 
 	/* Get the new topology buffer, reuse current topo copy mem */
-	static_assert(ICE_PKG_BUF_SIZE == ICE_AQ_MAX_BUF_LEN);
 	new_topo = topo;
 	memcpy(new_topo, (u8 *)section + offset, size);
 
-- 
2.38.1


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ