Received: by 10.192.165.148 with SMTP id m20csp5140675imm; Tue, 1 May 2018 09:43:29 -0700 (PDT) X-Google-Smtp-Source: AB8JxZo3ga0DX0AAd4nuUbPEtDhpKZxUCREX8BSZWRTwO0I5IouKn+2uY49VyHlVykIN9vTNQoSc X-Received: by 10.98.144.153 with SMTP id q25mr12063246pfk.66.1525193009330; Tue, 01 May 2018 09:43:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1525193009; cv=none; d=google.com; s=arc-20160816; b=wCLUxI9FVKKW++Nuz+gqV1ARsizjEt5asifV5jTs6YOvq+VguZKLSHQ91m4G1LGKv9 oxah4XLUbvQjihlkWKy71N2VzKLCer5aqBOjT7LblsUc9L03O6xMLOjy+EwJUod/ek2Z 4B8Xrh5aNC8Js+qdvEKlc0cdW6JwaSm2KTuLPnv3yGZN/qKznOttk64WevpQZO+vOEHA H7VF7xZLtC2oHxNU/1+eMitWRYycT+sjDRZzZhGkCkDEsRzEp4eUlYizX4YZH/vhbbBK fOj9sZu6wagV4xoPajGwEynYLaVc3q8MhKcKNQqkXzuDLrVKVm+WzuPp5dakS8NCwT/0 MXtg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature:dkim-signature :arc-authentication-results; bh=3xQ4IbYh66pjbbWbmt6xXNqx6W5PKbdaSnYBqYbd4nc=; b=SwJnXY9+SaIlRg+hNYL2tCKEDNi0zP56hPKszWUBdJfYcfDoET57TVbM6muCs7p6Qs r1+6e/N9WcZyHDS3AHWBwwpLWG6RW3ERm38MGWdpewO03WOtz965bPUbe+e7uVPAXSJC 95C2QRQJLZrPzgWfkcG9D4gVGB5WEs3KuIdyU5Uj99d760rpRjFPQcRCC3zoAHZx9dt0 TdyfdCACbxTeNXNuBvDFAIZDlyo1O2GlDjlaeY0e98rLTN5iFV9ubeFFH77f7A9F2EgV EbSyaAhX+GSr7IbMybvLAm2/h2k5xbfywChQHDx7GuxX82LM0KFEvhgG251oaCnL7xFo RsBw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@google.com header.s=20161025 header.b=swNLM7AU; dkim=fail header.i=@chromium.org header.s=google header.b=BS6AoT4R; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b3-v6si3996366plc.14.2018.05.01.09.43.15; Tue, 01 May 2018 09:43:29 -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=fail header.i=@google.com header.s=20161025 header.b=swNLM7AU; dkim=fail header.i=@chromium.org header.s=google header.b=BS6AoT4R; 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756046AbeEAQnA (ORCPT + 99 others); Tue, 1 May 2018 12:43:00 -0400 Received: from mail-ua0-f180.google.com ([209.85.217.180]:39545 "EHLO mail-ua0-f180.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754727AbeEAQm6 (ORCPT ); Tue, 1 May 2018 12:42:58 -0400 Received: by mail-ua0-f180.google.com with SMTP id g10so7704540ual.6 for ; Tue, 01 May 2018 09:42:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3xQ4IbYh66pjbbWbmt6xXNqx6W5PKbdaSnYBqYbd4nc=; b=swNLM7AUPgYdQsmiKUcIa+pSSQ+NzcjTJzsgRP8i/cxQN9mxbJ3ESRx6yrD6HufTOl 7ywX2DF3Jlsbn1eNXhZLreHzogL5iRXI07fLh20YeeBvu1v/Z182qw38v4Pry7+dn4zo W2X+sVWJHu6vxq5nhDMoZ5O6gZuiNfqU3JQPOg6lAZQ6Xe9dUVxoQmCVC+c7HF4UlWEs NPIwqLjNMbywYBjYhma8AmkcH+e7J3bsq9Ra//S3wjA8SaopIsWBDL5L/tYFl9j5R3zN KQMnJ5OZWyp3kKXOxFh58TmHkuqEU6s5xmeeP6krApQi8cPuXZHFo3EbzmLy7+29dZ0a qX5w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=3xQ4IbYh66pjbbWbmt6xXNqx6W5PKbdaSnYBqYbd4nc=; b=BS6AoT4Rs+ZGajc97RCUWjN0Qs7wRsNBhUSThG6fRHY8GgTLvUFPlecL+bBC2aE3CD 5o3CoatN2pkNjhuwNWR4O5U4oB8McHMCROFkyKA3XRZi0tSdw1QJl2JqHoRxogSuS9ju CFHw6j9VqrlAF73G4taod4DgoLNHIi2zWxchg= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=3xQ4IbYh66pjbbWbmt6xXNqx6W5PKbdaSnYBqYbd4nc=; b=JxZvd9Y8InmGyUeFln4Y7WO6OY6SmQyoj24XvpE1mxZTNeqiJuSsObkEdyJn/N8b8m qy7h7/3XQF5uaTbeo4UrMbaxjG7/kKZUDjNw8FRbF4V7SL9obv2PXmOsCF/TvZsBrDqx FIW4xwQJj+khPeTTjuZjviphQybvi2ALwIpCXrod/CSSSN7GLZny8JEh74ls0GEUS9TH TctJLeiiC/GeNiGzz14c6bellWly8sc8cA+oputlMGi7m6aVbWDDJowlQN9L8OIHvrxY la0xtEPOFhW0gUb+s8sfdeabjFc5EOc/wCSvh0moaNnpCgqbPCpX4QM8MfrYR6XxL2+Q Qknw== X-Gm-Message-State: ALQs6tAH2U8Cp1ZIO3lZdlDGoTzMHdFITUydHDnFOrtADapDmXydRB2K EuJMLArbeVfHrdEI6Zb/+dHuwBB5jNWg8cRK4Kl7jg== X-Received: by 10.159.51.227 with SMTP id y35mr13769050uab.121.1525192976793; Tue, 01 May 2018 09:42:56 -0700 (PDT) MIME-Version: 1.0 Received: by 10.31.48.82 with HTTP; Tue, 1 May 2018 09:42:55 -0700 (PDT) In-Reply-To: <20180501161010.GB23157@codeaurora.org> References: <20180419221635.17849-1-ilina@codeaurora.org> <20180419221635.17849-6-ilina@codeaurora.org> <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> From: Doug Anderson Date: Tue, 1 May 2018 09:42:55 -0700 X-Google-Sender-Auth: 9oniv0X0tNXHvhPD_d_s3Cs1Y5s Message-ID: Subject: Re: [PATCH v6 05/10] drivers: qcom: rpmh-rsc: write sleep/wake requests to TCS To: Lina Iyer 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 Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 -Doug