Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1144980imm; Wed, 23 May 2018 11:00:01 -0700 (PDT) X-Google-Smtp-Source: AB8JxZrbHnIArH9buCn+AKVCgC+6bIjd4+Al+E59TEEVU+FqfqBkwKaoD3klqohZgvzwIdxwW81F X-Received: by 2002:a17:902:20e5:: with SMTP id v34-v6mr3930388plg.127.1527098401605; Wed, 23 May 2018 11:00:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527098401; cv=none; d=google.com; s=arc-20160816; b=dSeCBbMsVq1up3qnMNAps/ZEFYSobr+GNwEaIlWnPn5qHcduPmKm6blFM+HE3s96Qz Wk+mNbWDCtBUCuNVTpr72ReIdMgIau2M9x2bgobg1daV4nlw/YHHOkmU2OZzblT0/Y2f H7xfhSG+ESKUrP6omaAJjdWXxHatqRiKd2Wsgvc/Q2eWrMyhMTByIpTQNmvWeERu/YL5 Y/vLyeZFEizOha1kbilkj2iINwnp6GD0KxMnc+U1ieQ8yOfNvHsQM+MFbdI6HzAOWYTi wNZg+buJn2LuHZpQVH89Ld/ZRbbEJ4PdlHOa2AX8MzoKQl0CylMqeTEleRoNIY/1WGSi uSeA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:message-id:references :in-reply-to:subject:cc:to:from:date:content-transfer-encoding :mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=tFKPsllNDP5Un8r6imqVTcue8TdOHxwMqAGzPFFwo30=; b=WFSlVqxkHYhc5OS72pTqmMHV4P3GuHBr4o+QOXbCM/pbfNvwDYSdVLFiKpaAoce37H +xd8/pvVuXPFRW97KAyb9bfi1LCfhOABEdYF+Zx+4hkcvNu+7WmRUCw3hLQaUzhbPHHC lSv6GDbSY2t1bCRq24PfLumcxqKhK61ENBqthGpSsFXduLL4PjheShTUvP1Ng4oy+GZH Gp+4U0eIn1r7z15tFvvU/mF4HW75sN6X2r4YCCL/3bu0KzxwnawPIn+PBW/wLGlUhfut ojBwE9xXhqYfxQ/7JWfO4oAd5rBgpCCHOeECaLyf6Ni2j6mfkwYFiSdbDNX01DG1qZgu SXHg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=CgHMLrsq; dkim=pass header.i=@codeaurora.org header.s=default header.b=CgHMLrsq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j127-v6si14910534pgc.204.2018.05.23.10.59.46; Wed, 23 May 2018 11:00:01 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=CgHMLrsq; dkim=pass header.i=@codeaurora.org header.s=default header.b=CgHMLrsq; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933958AbeEWR7P (ORCPT + 99 others); Wed, 23 May 2018 13:59:15 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:36308 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933949AbeEWR7I (ORCPT ); Wed, 23 May 2018 13:59:08 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id C32F56090E; Wed, 23 May 2018 17:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527098347; bh=KzyIRAe47INYd8q6GZEWVLjLJfHn8yCJgfacqglzce0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CgHMLrsqeLz454BJDl4anvwOh1wB+iszH+xEg0aKG0/LYPlNknHw158ilKLDLcsPY lAWgz0r4eCIy4KD2zM1Ei6PyggOaVZ11CayW/7HtFCi8IKfmYR50wHM4tyywfqXdRK UtU4LWtyEBRU/bbQ1G2EgxB4I64vji34yqzJ/PNk= X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on pdx-caf-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.8 required=2.0 tests=ALL_TRUSTED,BAYES_00, DKIM_SIGNED,T_DKIM_INVALID autolearn=no autolearn_force=no version=3.4.0 Received: from mail.codeaurora.org (localhost.localdomain [127.0.0.1]) by smtp.codeaurora.org (Postfix) with ESMTP id 136816047C; Wed, 23 May 2018 17:59:07 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1527098347; bh=KzyIRAe47INYd8q6GZEWVLjLJfHn8yCJgfacqglzce0=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=CgHMLrsqeLz454BJDl4anvwOh1wB+iszH+xEg0aKG0/LYPlNknHw158ilKLDLcsPY lAWgz0r4eCIy4KD2zM1Ei6PyggOaVZ11CayW/7HtFCi8IKfmYR50wHM4tyywfqXdRK UtU4LWtyEBRU/bbQ1G2EgxB4I64vji34yqzJ/PNk= MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Wed, 23 May 2018 10:59:07 -0700 From: rishabhb@codeaurora.org To: Andy Shevchenko Cc: linux-arm Mailing List , linux-arm-msm@vger.kernel.org, devicetree , Linux Kernel Mailing List , linux-arm@lists.infradead.org, tsoni@codeaurora.org, ckadabi@codeaurora.org, Evan Green , Rob Herring Subject: Re: [PATCH v7 2/2] drivers: soc: Add LLCC driver In-Reply-To: References: <1526492623-20527-1-git-send-email-rishabhb@codeaurora.org> <1526492623-20527-3-git-send-email-rishabhb@codeaurora.org> Message-ID: X-Sender: rishabhb@codeaurora.org User-Agent: Roundcube Webmail/1.2.5 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2018-05-22 12:38, Andy Shevchenko wrote: > On Tue, May 22, 2018 at 9:33 PM, wrote: >> On 2018-05-18 14:01, Andy Shevchenko wrote: >>> On Wed, May 16, 2018 at 8:43 PM, Rishabh Bhatnagar >>> wrote: > >>>> +#define ACTIVATE 0x1 >>>> +#define DEACTIVATE 0x2 >>>> +#define ACT_CTRL_OPCODE_ACTIVATE 0x1 >>>> +#define ACT_CTRL_OPCODE_DEACTIVATE 0x2 >>>> +#define ACT_CTRL_ACT_TRIG 0x1 >>> >>> >>> Are these bits? Perhaps BIT() ? >>> >> isn't it just better to use fixed size as u suggest in the next >> comment? > > If the are bits, use BIT() macro. > >>>> +struct llcc_slice_desc *llcc_slice_getd(u32 uid) >>>> +{ >>>> + const struct llcc_slice_config *cfg; >>>> + struct llcc_slice_desc *desc; >>>> + u32 sz, count = 0; >>>> + >>>> + cfg = drv_data->cfg; >>>> + sz = drv_data->cfg_size; >>>> + >>> >>> >>>> + while (cfg && count < sz) { >>>> + if (cfg->usecase_id == uid) >>>> + break; >>>> + cfg++; >>>> + count++; >>>> + } >>>> + if (cfg == NULL || count == sz) >>>> + return ERR_PTR(-ENODEV); >>> >>> >>> if (!cfg) >>> return ERR_PTR(-ENODEV); >>> >>> while (cfg->... != uid) { >>> cfg++; >>> count++; >>> } >>> >>> if (count == sz) >>> return ... >>> >>> Though I would rather put it to for () loop. >>> >> In each while loop iteration the cfg pointer needs to be checked for >> NULL. What if the usecase id never matches the uid passed by client >> and we keep iterating. At some point it will crash. > > do { > if (!cfg || count == sz) > return ...(-ENODEV); > ... > } while (...); > > Though, as I said for-loop will look slightly better I think. > >>>> + ret = llcc_update_act_ctrl(desc->slice_id, act_ctrl_val, >>>> + DEACTIVATE); >>> >>> >>> Perhaps one line (~83 characters here is OK) ? >> >> The checkpatch script complains about such lines. > > So what if it just 3 characters out? > Many upstream reviewers have objection to lines crossing over 80 characters I have gotten reviews to reduce the line length even if its like 81~82 characters. Can we keep this as it is? I have addressed all other comments and will send out the next patch by today. >>>> + ret = llcc_update_act_ctrl(desc->slice_id, act_ctrl_val, >>>> + ACTIVATE); > >>> Ditto. > >>>> + attr1_cfg = bcast_off + >>>> + >>>> LLCC_TRP_ATTR1_CFGn(llcc_table[i].slice_id); >>>> + attr0_cfg = bcast_off + >>>> + >>>> LLCC_TRP_ATTR0_CFGn(llcc_table[i].slice_id); > >>> Ditto. > >>>> + attr1_val |= llcc_table[i].probe_target_ways << >>>> + ATTR1_PROBE_TARGET_WAYS_SHIFT; >>>> + attr1_val |= llcc_table[i].fixed_size << >>>> + ATTR1_FIXED_SIZE_SHIFT; >>>> + attr1_val |= llcc_table[i].priority << >>>> ATTR1_PRIORITY_SHIFT; > >>> foo |= >>> bar << SHIFT; >>> >>> would look slightly better. > > Did you consider this option ?