Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp2508043rdb; Mon, 5 Feb 2024 08:36:49 -0800 (PST) X-Google-Smtp-Source: AGHT+IH5ZttnK69Y0YUDjxiW9DP8hNnvqF/U3WfbabhWzIroZQ7yvlCh8prdKWFMsxs0ouGJZJtU X-Received: by 2002:a17:906:2931:b0:a37:37c3:c178 with SMTP id v17-20020a170906293100b00a3737c3c178mr4548899ejd.47.1707151009146; Mon, 05 Feb 2024 08:36:49 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1707151009; cv=pass; d=google.com; s=arc-20160816; b=HMoDw2FUHrUTezG1Nu0orRWC67Ae+kBO9y4cSDI/yCVn/VMoMrlr48Y/fOAINn303I 3Tgl9qo2dU1HWp4bky4TPTvW73zjPOELuhQB/0zHUDU8ck+qjzrOCHF9MwVLSsejk7pT ke4sbfdyQJucMcC9InLD59wZVPXO1IoYe0o2idK/k/vOn7jdS13X3Bgn9vq81t4lzK45 +unFvf64b6Ozit42Tk4V+PFae3EO4mxXE+UgGc886o4AxojobbH/RR6wYR9iH/n9XeM3 fvw6oAOGXWtuZCkPfU9qyQx/29aKDo2Ztl6G7pn/rYVSt0t6Hpigpx7w/evcLvY8hkPt NmbA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:date:message-id:dkim-signature; bh=VVBUDGI/7j74ztZpyPUEHLAkWrecmj/YVlNVycV5kaQ=; fh=zQeSWNYWVAQpFL869pNvmwCTY26h74uqmE6HlphQfAU=; b=iod0qHPq3B4dXjZvHlWkhap+XuFlvpPyWf6XtZXxyKzbHVmqu1Bj2hsam7ySuBF7lc 5N06xMvgeyUgHHKge5P5p1jMs0oGDNsa6wwuWVdOrJ3ePp/mPhurgkobSPj3rrwGREpd e1JXK+Vk+Axx61UlaFh3RNPB8VcDMep0+1/fpWPM4mmXblE+L8w+YTM/rnfGP4T3NHWu V49lZG1yqMUvv+CMNROWM96jvpwjmYeHE62Y/RkYwXOTDz63or68HRM0ZZGfXr6DjMFC LdYVpSzVprObyOdYsY565UFPsw1ShelqmcU122+ac1ibSBVj/ZnCoWM02UzUP4tHiSo8 PYWg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FmmuM+LX; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3138-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com X-Forwarded-Encrypted: i=1; AJvYcCU+NLPsqN8FFUKVNziSyIuoVYyBtb0LNXlUk0Q4o1jdgpB9uU96w4rL4lV9tAnGLa5iKqiE1Ljc/VLDu6gm6QlVgk12wVpkNFct6UpXlA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [2604:1380:4601:e00::3]) by mx.google.com with ESMTPS id oy11-20020a170907104b00b00a35a5da4ae4si12538ejb.173.2024.02.05.08.36.49 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 05 Feb 2024 08:36:49 -0800 (PST) Received-SPF: pass (google.com: domain of linux-wireless+bounces-3138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) client-ip=2604:1380:4601:e00::3; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=FmmuM+LX; arc=pass (i=1 spf=pass spfdomain=quicinc.com dkim=pass dkdomain=quicinc.com dmarc=pass fromdomain=quicinc.com); spf=pass (google.com: domain of linux-wireless+bounces-3138-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:4601:e00::3 as permitted sender) smtp.mailfrom="linux-wireless+bounces-3138-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 64BF81F22971 for ; Mon, 5 Feb 2024 16:36:25 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 97EEC3C097; Mon, 5 Feb 2024 16:35:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b="FmmuM+LX" X-Original-To: linux-wireless@vger.kernel.org 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 667DB3CF4B for ; Mon, 5 Feb 2024 16:35: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=1707150917; cv=none; b=bI4x4egQ+44cypX7YiYGHbvzu7/OMCG3G7vJPCxrBuvcCKIwG6/SlV/6Pz7n+CQp+CnGbb/YjZTJNOQZnk4WJcWu72bcjmsQnErw7CLs6c8t5QDNCgBvBqlFzb0U+281Dr4ciSIgz+cwkaPzZ3Cs02q827ewnEieoFbniu01YZE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707150917; c=relaxed/simple; bh=Y3V6qmHl5CT9j8T65pC48CXsIiBBtyyjEG3AuQ1tnRs=; h=Message-ID:Date:MIME-Version:Subject:To:CC:References:From: In-Reply-To:Content-Type; b=AQq920sAqpGZAT3mX/4CYTAehQP04ZYTms10QhHq+t3VszsxfvjZrC5PmqVdvfa1c0DJrJUVNWTAS4QwRS3QsPE8ANBqdob7nsIYALzT8UZUe4KUZFk2KApSyIWej1ZlltzhaagfdbWZ1/UDPdW+R55EKBTFjAWP1RsuHYE3kxI= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com; spf=pass smtp.mailfrom=quicinc.com; dkim=pass (2048-bit key) header.d=quicinc.com header.i=@quicinc.com header.b=FmmuM+LX; arc=none smtp.client-ip=205.220.168.131 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=quicinc.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=quicinc.com Received: from pps.filterd (m0279862.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.24/8.17.1.24) with ESMTP id 415FU6gS021811; Mon, 5 Feb 2024 16:35:09 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= message-id:date:mime-version:subject:to:cc:references:from :in-reply-to:content-type:content-transfer-encoding; s= qcppdkim1; bh=VVBUDGI/7j74ztZpyPUEHLAkWrecmj/YVlNVycV5kaQ=; b=Fm muM+LXOXsKm/5arGTCbvC6908jaCRhwiLjSx4OVyQsr8lowdiCzQttZV/TSZdeSJ 04hF5dWOf72J0JTauCDDOY5LG3oqaHtl9LA57faH9sdhBqRlsJU9/nWqg1BDaC9Z 4Op9rpuMD2apgdSyPXhWHhmfdesUBMi9Ho4QPUa+bDFMONmDmOTScuboRYQajtkR Y//QGpAv1xplWab99wKNbWOo3K3FkFlwPJ73r84lSLK/6VifxTiAlf3Yd1pQcxF2 ek5pYgW2mLGsV4LiUqp3DQzErWC9+LiIB7yhtBhKkORZ1Box3S/NMTY6obqN8oW3 yUuFY5fU34nAt/TQbHHA== Received: from nalasppmta01.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3w2rvj9d67-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 05 Feb 2024 16:35:09 +0000 (GMT) Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA01.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 415GZ8DE030721 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 5 Feb 2024 16:35:08 GMT Received: from [10.110.62.200] (10.80.80.8) by nalasex01a.na.qualcomm.com (10.47.209.196) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.40; Mon, 5 Feb 2024 08:35:08 -0800 Message-ID: Date: Mon, 5 Feb 2024 08:35:07 -0800 Precedence: bulk X-Mailing-List: linux-wireless@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v6 04/11] wifi: ath12k: add P2P IE in beacon template Content-Language: en-US To: Kalle Valo , Kang Yang CC: , References: <20240130040303.370590-1-quic_kangyang@quicinc.com> <20240130040303.370590-5-quic_kangyang@quicinc.com> <87bk8usx6d.fsf@kernel.org> From: Jeff Johnson In-Reply-To: <87bk8usx6d.fsf@kernel.org> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 7bit X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nalasex01a.na.qualcomm.com (10.47.209.196) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: c1tPlce_qyVSogcM4QXR_gC8bgEHYYpK X-Proofpoint-GUID: c1tPlce_qyVSogcM4QXR_gC8bgEHYYpK X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.1011,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2024-02-05_10,2024-01-31_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 adultscore=0 phishscore=0 mlxlogscore=884 bulkscore=0 mlxscore=0 clxscore=1015 suspectscore=0 spamscore=0 impostorscore=0 lowpriorityscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2401310000 definitions=main-2402050126 On 2/5/2024 8:17 AM, Kalle Valo wrote: > Kang Yang writes: >> + if (WARN_ON(skb->len < ie_offset)) >> + return -EINVAL; >> + >> + ie = (u8 *)cfg80211_find_vendor_ie(oui, oui_type, >> + skb->data + ie_offset, >> + skb->len - ie_offset); > > So cfg80211_find_vendor_ie() returns: > > static inline const u8 * > cfg80211_find_vendor_ie(unsigned int oui, int oui_type, > const u8 *ies, unsigned int len) > > You are casting away the const here. I see that other drivers do the > same as the assumption is that the pointer points to the same buffer, > but I still don't really like casting away const. Thoughts? I'm not a fan of typecasting either. However, the problem here is that from the perspective of cfg80211_find_vendor_ie() the buffer is const (not modified in any way by the function), but from the perspective of every caller the buffer is part of a message that is in RAM. So you have to decide if you want to change the prototype to remove the const from cfg80211_find_vendor_ie() or if you want to keep the current semantic to cast away the const. This is one of the rare cases where I think the typecast is ok. /jeff