From patchwork Wed Nov 7 15:06:24 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Xiang Xiao X-Patchwork-Id: 10672529 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5FB6B175A for ; Wed, 7 Nov 2018 15:07:17 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4DC852C3C8 for ; Wed, 7 Nov 2018 15:07:17 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3FE9F2C440; Wed, 7 Nov 2018 15:07:17 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-8.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FROM,MAILING_LIST_MULTI,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id CAFDA2C3C8 for ; Wed, 7 Nov 2018 15:07:16 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727604AbeKHAiB (ORCPT ); Wed, 7 Nov 2018 19:38:01 -0500 Received: from mail-pg1-f194.google.com ([209.85.215.194]:43225 "EHLO mail-pg1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726635AbeKHAiA (ORCPT ); Wed, 7 Nov 2018 19:38:00 -0500 Received: by mail-pg1-f194.google.com with SMTP id n10-v6so7420721pgv.10 for ; Wed, 07 Nov 2018 07:07:16 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=MSucxdR2ttJTrEJ3zQBwu4wZz4/CgAVrpG8ip7E2M20=; b=gqGbdIlxtN8JZJu9yTNg03ksWOMdcxba2RNpzrY6o6Gt1xP8k7LfiCS1BZDbWCklKx ZVIEMmW92VDiLKFDl7ROBmXRV7tmHjOpfmEuluMnjBHIPsbr4IAEvrQ6WhBfsZzZ1k1o B3QT7iDT66sbsrFkCD5CNaVzqiVJKwQ0egzHtJNg4nzUqzkeS/7lsnZsNfxLr6abdjn8 3AT6dCxRQ+dvX6k0NZBaQcx8u831iOcq7TYsvg9gDFC7e8yXprFLfIeFszCVj8CxMUtw xPbmwIfuh22BumD7iJ3owr1M6mGmGGjo26H09bUxOKrtZGDUMVPRNYikE9eQrH84PdSS 9tnw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=MSucxdR2ttJTrEJ3zQBwu4wZz4/CgAVrpG8ip7E2M20=; b=M8IVAmNBEiShYc5HtO5ZO9fSnyf1wWZHjds3OmPf2MDF43jPUQhbbN80jEfECsEMHC LdngdWrhZk7oPPl5izcOTbSBzUJ+WvcGkp1EOgsYz7ne5Q+SaYNcloCH2TKXKnkyiHCb VNn6qGoafp9JFqEt/cIiligDzSsQWOYIaxUihZqIiAKHGz4e5drdM5rMt0Eo/kl8wyq0 ZORuIKC5HEaGefyafdCe03HGS17uF6sU3gRTasfV125XlDvI+dLu43DGdfXYhgtakxsg 8lffmcydFN75UbCYic35YMLpMKQbVdC5K/lWciW+mn+YPTllSVZ+WvEp+RRmurL1y4LT 6qRg== X-Gm-Message-State: AGRZ1gK6VlbwW5x9ywTnfZZWKhInaZZ63CK/6nhYQePdkZqKB0LYDim0 /QW51XE9Whw0U0TPyTefo4Fdn8ybpo0= X-Google-Smtp-Source: AJdET5f9NcJub3GDvkQW+3pTdB4y36JdzpAoBHgZqGnTJZ5BkSb54ko3qNUDqo2cHWoebufDdmProA== X-Received: by 2002:a62:85:: with SMTP id 127-v6mr587338pfa.24.1541603235372; Wed, 07 Nov 2018 07:07:15 -0800 (PST) Received: from localhost.localdomain ([43.224.245.179]) by smtp.gmail.com with ESMTPSA id 62sm867373pgc.61.2018.11.07.07.07.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 07 Nov 2018 07:07:14 -0800 (PST) From: Xiang Xiao X-Google-Original-From: Xiang Xiao To: linux-remoteproc@vger.kernel.org, bjorn.andersson@linaro.org Cc: Xiang Xiao Subject: [PATCH] remoteproc: debug: remove strlen call in rproc_trace_read Date: Wed, 7 Nov 2018 23:06:24 +0800 Message-Id: <1541603184-26652-1-git-send-email-xiaoxiang@xiaomi.com> X-Mailer: git-send-email 2.7.4 Sender: linux-remoteproc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP because the trace buffer may contain the binary data Signed-off-by: Xiang Xiao --- drivers/remoteproc/remoteproc_debugfs.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/drivers/remoteproc/remoteproc_debugfs.c b/drivers/remoteproc/remoteproc_debugfs.c index e90135c..0808466 100644 --- a/drivers/remoteproc/remoteproc_debugfs.c +++ b/drivers/remoteproc/remoteproc_debugfs.c @@ -48,9 +48,8 @@ static ssize_t rproc_trace_read(struct file *filp, char __user *userbuf, size_t count, loff_t *ppos) { struct rproc_mem_entry *trace = filp->private_data; - int len = strnlen(trace->va, trace->len); - return simple_read_from_buffer(userbuf, count, ppos, trace->va, len); + return simple_read_from_buffer(userbuf, count, ppos, trace->va, trace->len); } static const struct file_operations trace_rproc_ops = {