Received: by 2002:a05:6358:51dd:b0:131:369:b2a3 with SMTP id 29csp1245437rwl; Thu, 10 Aug 2023 08:25:16 -0700 (PDT) X-Google-Smtp-Source: AGHT+IETaGUuDpip6AGrt5kh3aB+o+AWl/xFIVxNn+H5OuquctLrstMOyBGj6+uD2x8zfgU8B1gl X-Received: by 2002:a17:903:1209:b0:1b8:5aba:509d with SMTP id l9-20020a170903120900b001b85aba509dmr2779833plh.21.1691681115630; Thu, 10 Aug 2023 08:25:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1691681115; cv=none; d=google.com; s=arc-20160816; b=TpfKNpk9fMTIRnyeUWJAnu5IqN7wGrmdNniZakxuVY5ep0cZ8/dBdjdlFl3GPQv6sL E6+MWmCkLd5r7FPxA9i+u1HAenLnjwjo5BhffLparItjoy0D4jyRLDdmXYtLXiHK0FBN Rz4BB8bYPL7lgVxfS5fU07GBKPPpj+lx+LblUcNoyf+Ldnrtwz3HEKwI6XJxsS2bRrBX Ydd3cptRyKhdo0UasFcmBEmOLdG3YyWhmcBpQE/aXPKIIMBrrWydkIcfldJ/4Kj9n3un 3XDcV7ayErRRNzbCaHFnSqaTwX6Xlb6kzjGyv9Qsw6q9qbqKgt/CXN5P+rRY/ynFMZag gGGw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=TK76T8JsuQV42EmOYZCZFwEvmN0wbaC53CusTjApZOo=; fh=DB7jFnyKmZuZ/OMnZWq53lfi4KmzXTqZDDG9uehdr2c=; b=0KutlceUK9AmYGXasLIcmzqB05BZltwS1VzVjbqyUHQZZmV8b1DKntU20Q16mRRUsB 4KvP7frFz57Qu4+AIcQ+U/m55BUM1FmUZC+6c0Q6aYuz1dvOstxYqcPP8r2lRMHcQ+59 LHiY7yIvlv/r4OstWwF4ba37eEHsm2xsVxD1LnFMNbqm+l8lMwce+8Nd3cYwhuY7iit5 UlSVgR5b7s/EBH5PXMFCeG8W3EusYpVzW+efDIEczLdvR9j74rgPtIxMr9EGb1w+EVsi xFNzVo2zGH1VLM5F6m43vc/QhdywK0Awpz6jQXCc9vnOWbjlZ2PWGp76SEjQO1k/ntw7 B2hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DXQlG2zn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i12-20020a17090332cc00b001b6ae9f8bb1si1757882plr.75.2023.08.10.08.25.02; Thu, 10 Aug 2023 08:25:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=DXQlG2zn; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=quicinc.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235983AbjHJPEf (ORCPT + 99 others); Thu, 10 Aug 2023 11:04:35 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55770 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231825AbjHJPEd (ORCPT ); Thu, 10 Aug 2023 11:04:33 -0400 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2978C2686; Thu, 10 Aug 2023 08:04:33 -0700 (PDT) Received: from pps.filterd (m0279873.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 37AALjq9021976; Thu, 10 Aug 2023 15:04:29 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=TK76T8JsuQV42EmOYZCZFwEvmN0wbaC53CusTjApZOo=; b=DXQlG2znAcULfBWopl2byj6nzFXGpD366to0hTbkIHfV9dTvr/IkL/XLJvlCC8v2l7XE fWLeBCMK/rUnyo8KEwwTSnxUSpxiDcmr8dPzz7kWWVgh9fofcYc21TX6bIetyWql8oCB 4nadcL60/5PAJEVpMK8iifRct2LI2sbvd6iV4jeyrsd99E8PsDmp7+HZ+VVATrePQwdm G+fMM4GRAYEFE3NCk2sRuSuJAk+YrJ0fRdVb3Wt5KVvRFsB32pF0bI89XoH+MtQZIbCu yQaSNjoQkr5Z4+BNKWlbRWLzV4qZC8Bq9pu6AOvYEt8zxBmyGKRCWty5VssnlU9Bs0b3 9A== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3scr39hdbj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 15:04:29 +0000 Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA02.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTPS id 37AF4SwC028561 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 10 Aug 2023 15:04:28 GMT Received: from [10.216.45.127] (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1118.30; Thu, 10 Aug 2023 08:04:24 -0700 Message-ID: <54d108d9-abfc-6b8e-7c1a-c93eef265575@quicinc.com> Date: Thu, 10 Aug 2023 20:34:21 +0530 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.13.0 Subject: Re: [PATCH 2/6] soc: qcom: llcc: Refactor llcc driver to support multiple configuration Content-Language: en-US To: Bryan O'Donoghue , Komal Bajaj , , , , , , , CC: , , References: <20230810061140.15608-1-quic_kbajaj@quicinc.com> <20230810061140.15608-3-quic_kbajaj@quicinc.com> <79ccb7c0-dc4b-87a7-3721-488f3ef3b192@linaro.org> From: Mukesh Ojha In-Reply-To: <79ccb7c0-dc4b-87a7-3721-488f3ef3b192@linaro.org> Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 8bit X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: SFqwyGv90PO2KqXVPSq6LP3y4IXeYjhS X-Proofpoint-ORIG-GUID: SFqwyGv90PO2KqXVPSq6LP3y4IXeYjhS X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.267,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-08-10_12,2023-08-10_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 lowpriorityscore=0 malwarescore=0 suspectscore=0 spamscore=0 phishscore=0 adultscore=0 mlxlogscore=719 clxscore=1011 mlxscore=0 impostorscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2306200000 definitions=main-2308100128 X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,NICE_REPLY_A, RCVD_IN_DNSWL_BLOCKED,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 8/10/2023 5:52 PM, Bryan O'Donoghue wrote: > On 10/08/2023 07:11, Komal Bajaj wrote: >> +    if (!cfgs || cfgs->num_config != DEF_NUM_CFG) { >> +        ret = -EINVAL; >> +        goto err; >> +    } >> +    cfg = &cfgs->llcc_config[DEF_NUM_CFG - 1]; > > This is a bit of a redundant check. > > You add in the check for num_config != 1, then deref llc_config[0] but > in patch #4 you get an index and check that index against num_config I would take this blame on me to suggest this..,but i was trying to avoid the hard-coding initially done for [1], now, num_config[2] converted to ARRAY_SIZE(), i find no harm in checking cfgs->num_config > DEF_NUM_CFG since, anyways it will move to different function in #4. [1] https://lore.kernel.org/lkml/39b4bafd-410f-cae8-13ae-e18d751b51a2@quicinc.com/ [2] .num_cfgs = 1, -Mukesh > > I'm not seeing how at this point in your series, how num_config could be > anything other than 1. > > I'd do away with the DEF_NUM_CFG define in this code/series completely. > > num_config should encode all the necessary detail we need, DEF_NUM_CFG > just adds noise. > > --- > bod