Received: by 10.192.165.148 with SMTP id m20csp5194572imm; Tue, 1 May 2018 10:35:38 -0700 (PDT) X-Google-Smtp-Source: AB8JxZpI1olDSTQNJTmL/swwPkBK4V10InPgKctSP4no983EBJg2H9eIXoAygwhdCIrtx2GLVCi/ X-Received: by 2002:a17:902:96a:: with SMTP id 97-v6mr17407272plm.266.1525196138569; Tue, 01 May 2018 10:35:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525196138; cv=none; d=google.com; s=arc-20160816; b=XekcufDvLaTmIEj8CvwkoHNPJXjofDiw5s7G8Ojgh0uBohUJXqMQvQUBfawYpfpzxo Z53hWy/B1GOlFqEGfIiP51NhwypI8PwKP0cnMD9iP+w+QGdHdsfSyNiYO1RklaM+Egui 68ITAajkD8iJWiproJQJ6uQoIl8rit/rBrS2UbJFESzIiFMo9AH9EBrmMF7Wn+czMZFg mnvFf2e6ppgAK/qignx0A/ueLklc/kbS/LPZWC3PQQw1zURs4Okdj2q3aT5uJRAc8J4y XzVwQk9NvvfUebtZWrzv8CXwIx/8Hzrgh3D7+bHfHFohYOiPM5TAmMWbYl5ro9OnbmUO f6mA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dmarc-filter:dkim-signature:dkim-signature :arc-authentication-results; bh=cyEH3FcpjZRXzjMweddmMmcWhyiGYySb8kP3j54tTpg=; b=1KGiNRx3cgGlIgLKh12+0ZQKFMHypQZEugE45GKRWc4Q+1O5Y4grI0QPD4z7ygoKnh jqzG2asF9B7eEJU4D02KozwqjXEHutsIX7e/2U2hcwskCnWrGDpH+UVt6tNdFrFbv0Jz 195GDUA7mRjtaGE93HxesmV6XuhjU/5odxJsTqXqvUU7y/IjLlxVZEKGr+RcGX7yQWjp LihvFNYsXvXb6Rj1M2ld3+azXQaXt4KWG8OGKpPIsm2xHsETLKFu3ChhYxwsx2B6rBK7 NF6b2KHjVnV9pBjTGd/1asCkCB7QO5caDamsJsiM5QpcGGoN2q/OXgghnJyTlUsh557G 66dg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@codeaurora.org header.s=default header.b=SRA8azDm; dkim=pass header.i=@codeaurora.org header.s=default header.b=SWF+owK8; 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 g8-v6si10572847pli.75.2018.05.01.10.35.24; Tue, 01 May 2018 10:35:38 -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=SRA8azDm; dkim=pass header.i=@codeaurora.org header.s=default header.b=SWF+owK8; 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 S1756175AbeEARfN (ORCPT + 99 others); Tue, 1 May 2018 13:35:13 -0400 Received: from smtp.codeaurora.org ([198.145.29.96]:42394 "EHLO smtp.codeaurora.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755035AbeEARfK (ORCPT ); Tue, 1 May 2018 13:35:10 -0400 Received: by smtp.codeaurora.org (Postfix, from userid 1000) id 5BF93601A0; Tue, 1 May 2018 17:35:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525196110; bh=n9ekbvU1UGXTYivk2W822lXHsuw7HeYSj8BS0cbGrRE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SRA8azDmIjYz/MvSi6bkHZbJ1OU1wZ1LH9huVVhIbGhbSSwRoOiC9TjSqKNWE7+aY TH2/loVKJX/kYemiz48120JNAv5IbpbBdtOPD2VXfZ3/ADS8OA4E9QhbT5iQWj3gFg C3KipLtW48NqN8q1Qb7y4AXesy43oGbCMdBH5Eb0= 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 localhost (i-global254.qualcomm.com [199.106.103.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: ilina@smtp.codeaurora.org) by smtp.codeaurora.org (Postfix) with ESMTPSA id 994A3601A0; Tue, 1 May 2018 17:35:08 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=codeaurora.org; s=default; t=1525196108; bh=n9ekbvU1UGXTYivk2W822lXHsuw7HeYSj8BS0cbGrRE=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=SWF+owK8Nn66XPipzSDuwlbdCHYL2YTgtftZ5673NBaYDDio+8VAEJGkY43Wq//Or wCRx1pzdp0v9KDANYBoEj3meeDij6QqDUkBvppzKGt1MynMd+ZWrIFlJSz87tAEx15 U7H3neXzerSA+1AqYp0hc5zZ8xhSvjjQvVTxdqzc= DMARC-Filter: OpenDMARC Filter v1.3.2 smtp.codeaurora.org 994A3601A0 Authentication-Results: pdx-caf-mail.web.codeaurora.org; dmarc=none (p=none dis=none) header.from=codeaurora.org Authentication-Results: pdx-caf-mail.web.codeaurora.org; spf=none smtp.mailfrom=ilina@codeaurora.org Date: Tue, 1 May 2018 11:35:07 -0600 From: Lina Iyer To: Doug Anderson Cc: Matthias Kaehlcke , Andy Gross , David Brown , linux-arm-msm@vger.kernel.org, "open list:ARM/QUALCOMM SUPPORT" , Rajendra Nayak , Bjorn Andersson , LKML , Stephen Boyd , Evan Green Subject: Re: [PATCH v6 05/10] drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS Message-ID: <20180501173507.GC23157@codeaurora.org> References: <20180425214111.GC243180@google.com> <20180427173943.GD6380@codeaurora.org> <20180427184017.GI243180@google.com> <20180427194559.GE6380@codeaurora.org> <20180427200605.GJ243180@google.com> <20180427213201.GA23157@codeaurora.org> <20180427215449.GA133494@google.com> <20180501161010.GB23157@codeaurora.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii; format=flowed Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.5 (2018-04-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, May 01 2018 at 10:42 -0600, Doug Anderson wrote: >Hi, > >On Tue, May 1, 2018 at 9:10 AM, Lina Iyer wrote: >> Yes, this is incorrect in its current form. This is what it should be - >> >> static int find_match(const struct tcs_group *tcs, const struct tcs_cmd >> *cmd, >> int len) >> { >> int i, j; >> >> /* Check for already cached commands */ >> for_each_set_bit(i, tcs->slots, MAX_TCS_SLOTS) { >> if (tcs->cmd_cache[i] != cmd[0].addr) >> continue; >> for (j = 0; j < len; j++) { >> WARN(tcs->cmd_cache[i + j] != cmd[j].addr, >> "Message does not match previous sequence.\n"); >> return -EINVAL; >> } > >If len > 0, won't the above always return -EINVAL? > > >> if (j == len - 1) >> return i; > >Care to explain how you could get here and the test "if (j == len - >1)" could be false? ;-P > True. Will fix it in the next spin correctly. --Lina