From patchwork Fri Aug 19 19:37:02 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Johnson X-Patchwork-Id: 12949152 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C48CAC32771 for ; Fri, 19 Aug 2022 19:37:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1351107AbiHSThZ (ORCPT ); Fri, 19 Aug 2022 15:37:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37008 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229469AbiHSThZ (ORCPT ); Fri, 19 Aug 2022 15:37:25 -0400 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 754B3111C11 for ; Fri, 19 Aug 2022 12:37:24 -0700 (PDT) Received: from pps.filterd (m0279863.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27JJHkJo032396; Fri, 19 Aug 2022 19:37:20 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=from : to : cc : subject : date : message-id : mime-version : content-transfer-encoding : content-type; s=qcppdkim1; bh=Lrz+YB/LxPq4wRFMtpoO1VF54SwkxsM5I09mZCDtYng=; b=g0QdVgeKeAlcG9pv0k45Kg+2rA2U5uEulCgwof4gP3dGuZ7JBLf5iWHn4ILa0s503JdZ AC9/xU05ZqLX49VdWK3iGhAuRZo1hKhOT6jxpax05Kh0ISppaHDf1nst+CgOwVRUdnN7 lH9cTUmSkVf3qTALlHCjbCvvLvK0nnILzRNsYmyOYkWyfU5eM12uOxtm60RM2KPnh1gQ 3Liu5hvh/CB4tLLg6PRhBErmogJ1Cbkz9ozFyO3JJ5ateyKwc/9JnXBYy0IsKosQ37Yf CgcbbT5JfVbVikyYFlktjmqtGzqw7Ii7kymxkmMeRqGn9NzNyoJqEEWSTroBvOn/X5iR JA== Received: from nalasppmta04.qualcomm.com (Global_NAT1.qualcomm.com [129.46.96.20]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3j26jaj3b8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Aug 2022 19:37:19 +0000 Received: from nalasex01a.na.qualcomm.com (nalasex01a.na.qualcomm.com [10.47.209.196]) by NALASPPMTA04.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 27JJbJ32001109 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 19 Aug 2022 19:37:19 GMT Received: from quicinc.com (10.49.16.6) 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.986.22; Fri, 19 Aug 2022 12:37:18 -0700 From: Jeff Johnson To: Manivannan Sadhasivam , Hemant Kumar CC: , , Jeff Johnson Subject: [PATCH v2] mhi: make mhi_controller_config::event_cfg const Date: Fri, 19 Aug 2022 12:37:02 -0700 Message-ID: <20220819193702.24697-1-quic_jjohnson@quicinc.com> X-Mailer: git-send-email 2.37.0 MIME-Version: 1.0 X-Originating-IP: [10.49.16.6] X-ClientProxiedBy: nalasex01b.na.qualcomm.com (10.47.209.197) 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: __XJTcaxYzIrLvR9EkWXnrCBRLqP07SR X-Proofpoint-GUID: __XJTcaxYzIrLvR9EkWXnrCBRLqP07SR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-19_10,2022-08-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 mlxlogscore=945 impostorscore=0 malwarescore=0 priorityscore=1501 mlxscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 suspectscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208190073 Precedence: bulk List-ID: X-Mailing-List: linux-arm-msm@vger.kernel.org Currently the event_cfg pointer in struct mhi_controller_config is not defined as a const pointer. This prevents clients from registering a read-only configuration unless they use a typecast. Since the event_cfg should not be modified once registered, add the const qualifier to event_cfg. This is aligned with the definition of ch_cfg. Signed-off-by: Jeff Johnson --- include/linux/mhi.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/linux/mhi.h b/include/linux/mhi.h index a5441ad33c74..ada2f18af4d6 100644 --- a/include/linux/mhi.h +++ b/include/linux/mhi.h @@ -281,7 +281,7 @@ struct mhi_controller_config { u32 num_channels; const struct mhi_channel_config *ch_cfg; u32 num_events; - struct mhi_event_config *event_cfg; + const struct mhi_event_config *event_cfg; bool use_bounce_buf; bool m2_no_db; };