From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C29821A5B9E for ; Fri, 20 Feb 2026 23:36:15 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=205.220.168.131 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771630577; cv=none; b=UbkJYaUBiB+3x1cbPhy+rfq3Fxr+cpaMSdqBlxrvEFFOYNEhppmhiA/X74EwLlhTDhblXSaOp+tE+GA11d7u84zykSQGSOWtM79QPA7Y4Y1GYWY58o/9391Rk3sGPre5NitLECQSfiONgCZfMNz0X9iXbo/vkVWVg4LhITpow+4= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771630577; c=relaxed/simple; bh=Sy6oXzoaOmP445ImcelGg3uJV3WSYuEW5jJwrUXkC/0=; h=Message-ID:Date:MIME-Version:Subject:To:Cc:References:From: In-Reply-To:Content-Type; b=iWqCXFpihJXCXTTTKSDqD5OiWwsEusgqJXx9riVruZznlGZfjOnrCI1Xzi1AmnZjJiukuu5oONF/hPctRal7kkPSoN2ow+uO47ysHqISXruLtsUqBybVQPyPRAXL6Wbe7DrZz98iVxh7nfz8HfbzlJdR2zuWkJ9dHzSbQVbeJNI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com; spf=pass smtp.mailfrom=oss.qualcomm.com; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b=JdtxsZ/A; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b=aAGynS+2; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=oss.qualcomm.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=qualcomm.com header.i=@qualcomm.com header.b="JdtxsZ/A"; dkim=pass (2048-bit key) header.d=oss.qualcomm.com header.i=@oss.qualcomm.com header.b="aAGynS+2" Received: from pps.filterd (m0279865.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.11/8.18.1.11) with ESMTP id 61KHXFLB353479 for ; Fri, 20 Feb 2026 23:36:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=qualcomm.com; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to; s=qcppdkim1; bh= 8tydhh+6EmL3dAFMyH+Z+MIJDast/WxcYSEgk1cAR6c=; b=JdtxsZ/AA3+mxTq1 rX2PZW4K+OILbGabe22w1LvF5sY0Y84/YyonHdJtau5p6oyjzn2wYsZPFr7wN+ia 5WTewdXs1oveaLVxzDg61kuyjjGrcd3QyKtaRTrYPnJsuoftxS3neyJS+zRGK2qz eVacvN9h3cmIL7wvI3lB00Rz/LPxFOqhmwRArNb/V6CsAA+gDKalLBelTpmrCNAg /nQ06wKx7+zqYpU+0uVXtbf9ZdQdlSwnKZ2mplchIDX3TpUMTyizX9cTlhFjZkBd KJKMuG+BTCP+lZN9pDgpb2+q05LPWYzQpH0mSa5rgTnLpVvK06j4KQve3T+gzPEq wVFGhQ== Received: from mail-dy1-f200.google.com (mail-dy1-f200.google.com [74.125.82.200]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 4cev3xgua2-1 (version=TLSv1.3 cipher=TLS_AES_128_GCM_SHA256 bits=128 verify=NOT) for ; Fri, 20 Feb 2026 23:36:14 +0000 (GMT) Received: by mail-dy1-f200.google.com with SMTP id 5a478bee46e88-2ba8a461dd9so47238663eec.1 for ; Fri, 20 Feb 2026 15:36:14 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oss.qualcomm.com; s=google; t=1771630574; x=1772235374; darn=vger.kernel.org; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date:message-id:reply-to; bh=8tydhh+6EmL3dAFMyH+Z+MIJDast/WxcYSEgk1cAR6c=; b=aAGynS+2ox/xnKNluy4SQ24fvANxoJ77qqAiMcmjjM60EuAyOprnHi0NhvNe3Fp+kR fZawLaAZTZt9URUL2mjEfVnq6U7YmpF2BFP56AjO0mozRLxRjJrZnG5VL5tXtWuB5NUI TZYLNtIuNEiYsWJmYdXAn8jcVYtYvXKnm+53NqK47cjdnBvHpPHkEY6NsJVDK1r0bFDx y/SUv1Ex34N/sL8CXw7wt39gigmAG6+QEZWGQrTETy/E3az4EF3cuPczzCVfEcqoONCQ ETvaivybwJYnjoIHy3MKwEofAFQqCBo8BOzD0ujyIk2A/PjAJcu8dLaMN4bqW35DWyvR P3xw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1771630574; x=1772235374; h=content-transfer-encoding:in-reply-to:content-language:from :references:cc:to:subject:user-agent:mime-version:date:message-id :x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=8tydhh+6EmL3dAFMyH+Z+MIJDast/WxcYSEgk1cAR6c=; b=uEfn/EKdfrblfT509Ry5jenspWopUFsr2wL2cgskvUDhwjsbJUnCaByLAZRaMFIsVj 3effxfEwZ6mlV+AVipExMNbg9ose+hsaggweHuUcj6M6JUGMt6trUMUIJ0xXk7q0dkHn 69VO/cuxaCgslyaVSBNUZ66XwdXeybn3VbCxD3yhSwCyqs9DYd8+9EhaCS5YMA9+wwoM u2nX7ycDJkufJOCJejLj//0KAyeMSPPV7ktOWm8gZrcvPRlXAOkbs+o/zzOZXYzgHxyL IdICzX9sj6TbjwXFyvkYROm4Sdap/UHc4XQUOAXX0YeiRgO9GtUnVoHLD+EFud+m+AI5 LUHQ== X-Forwarded-Encrypted: i=1; AJvYcCW8Ory8DWaJyvCWMjTUSZFNkBhXgjVQyFSd+VMeGEdM9LX97DiIeI5g5Pcv1tusLVzpOe6pR8LbtXXd0t8=@vger.kernel.org X-Gm-Message-State: AOJu0Yy84vmy8zP8PGGoIu8gBST67GsKk9bHK9WgXOCdVYUAjICR7hod CBPFSWsSkkXK3sPm+wCVvPstWmefbELRw9gTn7TOKi6ZCMMxH077vatKDWWx7lrjqXJN1hzFKip Kn24piThlGIm+AHsHTIjRUs1+pkQrJStnY63nvbJr9VaeD06AEhaassjCPKUaA87BFvI= X-Gm-Gg: AZuq6aJCdOIy4zEkSHL6t8gFdP51VjRvIEMPQOqYoyfWJ2RZwLI4TKuuuVr32ICls+e YOxQfhBbUpkn7w1y7ih0WBc8xFrijUif5qwKlPqMiH5ze4q0jY0LrXRaUUjdlEBx/QesGPa5LUs SgH6bvCPlyMWR8MMjsFacaj6lmpkUvQzaQPYSZw4WldxwgfjYFPQZz+XR6eVO7f7fSCB7RiHWNq br/uTKloKDlI/M5FDsd9+PqX9uF3HC2VOsta301eC1f3umK1r4MJXGahFXzad5GnHlJiUHdTWA+ CxkAIkVmlTfzs1orkYDJLupRvK1AZhpwiV7i43wMSzecdFIAPee77saz8bIAcwC01gHyUVME7lD VFo59/mkL858mAtRa01D6+pue3lwA5vzRMwmyMI/W6RsL8fK24GUw9PryY6fOyHODs9NCHqHbQw 0U/a5GowiOW1fRWA== X-Received: by 2002:a05:693c:2293:b0:2ba:8ae0:856f with SMTP id 5a478bee46e88-2bd7bb53936mr730848eec.15.1771630574130; Fri, 20 Feb 2026 15:36:14 -0800 (PST) X-Received: by 2002:a05:693c:2293:b0:2ba:8ae0:856f with SMTP id 5a478bee46e88-2bd7bb53936mr730837eec.15.1771630573489; Fri, 20 Feb 2026 15:36:13 -0800 (PST) Received: from [192.168.1.41] (c-24-130-122-79.hsd1.ca.comcast.net. [24.130.122.79]) by smtp.gmail.com with ESMTPSA id a92af1059eb24-1276af207d6sm964856c88.5.2026.02.20.15.36.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Fri, 20 Feb 2026 15:36:12 -0800 (PST) Message-ID: Date: Fri, 20 Feb 2026 15:36:11 -0800 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v2][next] wifi: ath6kl: wmi: Avoid -Wflex-array-member-not-at-end warning To: "Gustavo A. R. Silva" , "Gustavo A. R. Silva" Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org References: <6305fbc7-8210-4f4d-b719-30ba038611af@embeddedor.com> From: Jeff Johnson Content-Language: en-US In-Reply-To: <6305fbc7-8210-4f4d-b719-30ba038611af@embeddedor.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Proofpoint-Spam-Details-Enc: AW1haW4tMjYwMjIwMDE5NSBTYWx0ZWRfX0Gyr8yB4+6pJ D8vdtVI06p4yt21kC2cEXQCOgJEmjnkQGkfhbtOlngXRISj1MWbDnoYmUuqqBXsDin48RUWsACo YbFaLcNkrMJazRVzcJrhDQGFE9nx/dQpL+sDmgwV1h1EaBpZTdM9L0AU0FDh95SxtyObKisoPkJ UaXzuzdFBIP8jaFeYD4ftRyFMuvJGCyA3LlzZXEA7HFfu8VIGyIFiKG/+vx+Q19BmCKAC5ZBKFT ivo15CNAQiTF47F1obb0eZ+0qwBWdfDlq7vhwv+zR3TjUQDZZhekBkPkvxorYTn5Ks60uLlfli0 G8h/bAiB9dyTX0kFduIfbpSGpK47920XyEvHhgoaICPg6JhJnuLSc5H9v89DvQ75Kg1sbOUnf+D fYyRoXFUvlgPi4UGzlcMbSeK6AHlK7hPDFapCxvUWYUrALpVeVXG0e+6GoSoHM6iUqhcLgSbYTf YZ4plwBKm+OxkJuxAzw== X-Authority-Analysis: v=2.4 cv=F41at6hN c=1 sm=1 tr=0 ts=6998efee cx=c_pps a=PfFC4Oe2JQzmKTvty2cRDw==:117 a=Tg7Z00WN3eLgNEO9NLUKUQ==:17 a=IkcTkHD0fZMA:10 a=HzLeVaNsDn8A:10 a=s4-Qcg_JpJYA:10 a=VkNPw1HP01LnGYTKEx00:22 a=Mpw57Om8IfrbqaoTuvik:22 a=GgsMoib0sEa3-_RKJdDe:22 a=Qanu7G-BKPL3DVzRuT4A:9 a=QEXdDO2ut3YA:10 a=6Ab_bkdmUrQuMsNx7PHu:22 X-Proofpoint-ORIG-GUID: aTpJqk4CpU1GFXaATw2Mxpd9j2UJsJ7b X-Proofpoint-GUID: aTpJqk4CpU1GFXaATw2Mxpd9j2UJsJ7b X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1121,Hydra:6.1.51,FMLib:17.12.100.49 definitions=2026-02-20_04,2026-02-20_04,2025-10-01_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 bulkscore=0 phishscore=0 adultscore=0 malwarescore=0 clxscore=1015 spamscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 classifier=typeunknown authscore=0 authtc= authcc= route=outbound adjust=0 reason=mlx scancount=1 engine=8.22.0-2601150000 definitions=main-2602200195 On 2/18/2026 1:38 AM, Gustavo A. R. Silva wrote: > >>> @@ -1652,7 +1656,7 @@ struct roam_ctrl_cmd { >>> union { >>> u8 bssid[ETH_ALEN]; /* WMI_FORCE_ROAM */ >>> u8 roam_mode; /* WMI_SET_ROAM_MODE */ >>> - struct bss_bias_info bss; /* WMI_SET_HOST_BIAS */ >>> + struct bss_bias_info_hdr bss; /* WMI_SET_HOST_BIAS */ >>> struct low_rssi_scan_params params; /* WMI_SET_LRSSI_SCAN_PARAMS >>> */ >>> } __packed info; >> >> That bss member appears to be completely unused >> (bssid, roam_mode, and params are used) >> >> So IMO the better solution is to remove bss from the union. >> And I think struct bss_bias and struct bss_bias_info can also be removed. > > Even if they're not used, are you sure they aren't there simply > to define the memory layout of struct roam_ctrl_cmd? > > As Kees commented[1], struct roam_ctrl_cmd appears to be a > hardware interface... See below: > > drivers/net/wireless/ath/ath6kl/wmi.c: > 755 /* > 756 * Mechanism to modify the roaming behavior in the firmware. The lower rssi > 757 * at which the station has to roam can be passed with > 758 * WMI_SET_LRSSI_SCAN_PARAMS. Subtract 96 from RSSI to get the signal level > 759 * in dBm. > 760 */ > 761 int ath6kl_wmi_set_roam_lrssi_cmd(struct wmi *wmi, u8 lrssi) > 762 { > 763 struct sk_buff *skb; > 764 struct roam_ctrl_cmd *cmd; > 765 > 766 skb = ath6kl_wmi_get_new_buf(sizeof(*cmd)); > 767 if (!skb) > 768 return -ENOMEM; > 769 > 770 cmd = (struct roam_ctrl_cmd *) skb->data; > ... > } yes, it defines a hardware interface. But note the 'info' is a union, and each member of the union is there to support a specific value of roam_ctrl. And since the WMI_SET_HOST_BIAS roam_ctrl is not used, the only important thing to consider with your patch is that the location of the roam_ctrl field must not change, and hence the size of union info must not change. pahole of the original: struct roam_ctrl_cmd { union { u8 bssid[6]; /* 0 6 */ u8 roam_mode; /* 0 1 */ struct bss_bias_info bss; /* 0 1 */ struct low_rssi_scan_params params; /* 0 8 */ } info; /* 0 8 */ u8 roam_ctrl; /* 8 1 */ /* size: 9, cachelines: 1, members: 2 */ /* last cacheline: 9 bytes */ } __attribute__((__packed__)); pahole with struct bss removed: struct roam_ctrl_cmd { union { u8 bssid[6]; /* 0 6 */ u8 roam_mode; /* 0 1 */ struct low_rssi_scan_params params; /* 0 8 */ } info; /* 0 8 */ u8 roam_ctrl; /* 8 1 */ /* size: 9, cachelines: 1, members: 2 */ /* last cacheline: 9 bytes */ } __attribute__((__packed__)); So the size of the message and the location of roam_ctrl is unchanged. /jeff