From patchwork Fri Jun 7 21:38:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Zhang, Dingchen (David)" X-Patchwork-Id: 10982795 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 9D1EB14C0 for ; Fri, 7 Jun 2019 21:57:11 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8138B212D5 for ; Fri, 7 Jun 2019 21:57:11 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 71D9B27F54; Fri, 7 Jun 2019 21:57:11 +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=-5.2 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from gabe.freedesktop.org (gabe.freedesktop.org [131.252.210.177]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E3A8A212D5 for ; Fri, 7 Jun 2019 21:57:10 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id 74323890C7; Fri, 7 Jun 2019 21:57:09 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM03-CO1-obe.outbound.protection.outlook.com (mail-eopbgr790051.outbound.protection.outlook.com [40.107.79.51]) by gabe.freedesktop.org (Postfix) with ESMTPS id D98B2890C7 for ; Fri, 7 Jun 2019 21:57:08 +0000 (UTC) Received: from MWHPR12CA0069.namprd12.prod.outlook.com (2603:10b6:300:103::31) by MWHPR12MB1279.namprd12.prod.outlook.com (2603:10b6:300:d::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12; Fri, 7 Jun 2019 21:57:06 +0000 Received: from CO1NAM03FT064.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e48::200) by MWHPR12CA0069.outlook.office365.com (2603:10b6:300:103::31) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1965.13 via Frontend Transport; Fri, 7 Jun 2019 21:57:06 +0000 Received-SPF: None (protection.outlook.com: amd.com does not designate permitted sender hosts) Received: from SATLEXCHOV01.amd.com (165.204.84.17) by CO1NAM03FT064.mail.protection.outlook.com (10.152.81.77) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1965.12 via Frontend Transport; Fri, 7 Jun 2019 21:57:06 +0000 Received: from Jiraiya.amd.com (10.180.168.240) by SATLEXCHOV01.amd.com (10.181.40.71) with Microsoft SMTP Server id 14.3.389.1; Fri, 7 Jun 2019 16:57:05 -0500 From: Dingchen Zhang To: Subject: [PATCH] drm: remove the newline for CRC source name. Date: Fri, 7 Jun 2019 17:38:17 -0400 Message-ID: <20190607213817.11767-1-dingchen.zhang@amd.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:165.204.84.17; IPV:NLI; CTRY:US; EFV:NLI; SFV:NSPM; SFS:(10009020)(346002)(396003)(376002)(39860400002)(136003)(2980300002)(428003)(189003)(199004)(81166006)(53936002)(81156014)(426003)(8936002)(8676002)(2906002)(50226002)(478600001)(356004)(16586007)(4326008)(51416003)(68736007)(7696005)(5660300002)(6666004)(336012)(48376002)(14444005)(86362001)(50466002)(1076003)(126002)(72206003)(2616005)(2351001)(54906003)(44832011)(36756003)(6916009)(186003)(26005)(77096007)(47776003)(316002)(486006)(305945005)(53416004)(70206006)(70586007)(476003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR12MB1279; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; MX:1; A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 66df2217-9cb3-4f8c-e612-08d6eb9314fe X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:MWHPR12MB1279; X-MS-TrafficTypeDiagnostic: MWHPR12MB1279: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-Forefront-PRVS: 0061C35778 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: 7RgCagIN9RRRunTuo/1kmp8pHknXq5tjeQu/qxoVneG3Qs2ra+91LC+rUI5pIEAaUUOtRpDu/6awhRqQ/hVjmUYgXiCqqWLhb5v2CQnspeHa+wLR/gOZr2vvYo1ge4yx/Xt6AVYkJkvJqMUy0G1BeAZD9VBWUMBVwo2hqIKMNDaM9Xtdr0FFlpC0T0+hHFXI7A1xxYorBzkv0Zd7ZkCS6yBAB7s2jlZJsy+ElMP8CIzsE9iclVp1p2pD3O9YihG1+TVcIGPvtJCpQaLs2bJks/Nhtd6o8Ie5Scmtgc+gN9iNMl9LAZ/mnp1F7N2hqv4KFVK3m7KxBHqKTmZA492Xbrwv+SVjzx/CIgcgosRCrATGSDrG3lJ4/564OYju+KoS5iqid1+uQKmrl0Zaboz7fBJHYQWEmJ/QqDp+q7obJSA= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 07 Jun 2019 21:57:06.2481 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 66df2217-9cb3-4f8c-e612-08d6eb9314fe X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=3dd8961f-e488-4e60-8e11-a82d994e183d; Ip=[165.204.84.17]; Helo=[SATLEXCHOV01.amd.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR12MB1279 X-Mailman-Original-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amdcloud.onmicrosoft.com; s=selector1-amdcloud-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=P8kg5yfYUrgy8WOJ7va8iqg86hUMfvzWYFMKz+6I/BQ=; b=FMAfYcso2/LLbGl2yDlaSDlQDJZZL0nIv8RSqT144t0gzEUTP/bVxB0U2gtfsX8sJom/LR5UDbsm2c34QTJY4kmvEO2OrxtZLgWiT2kY8qAk4rLWYAX1iH1TKDqyNN8YWf7uzoz+fX+to6nlfF0jhMLJky4kHQKj0OOnKIdp84w= X-Mailman-Original-Authentication-Results: spf=none (sender IP is 165.204.84.17) smtp.mailfrom=amd.com; ravnborg.org; dkim=none (message not signed) header.d=none;ravnborg.org; dmarc=permerror action=none header.from=amd.com; X-BeenThere: dri-devel@lists.freedesktop.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: Direct Rendering Infrastructure - Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Leo Li , Sam Ravnborg , Dingchen Zhang Errors-To: dri-devel-bounces@lists.freedesktop.org Sender: "dri-devel" X-Virus-Scanned: ClamAV using ClamSMTP userspace may transfer a newline, and this terminating newline is replaced by a '\0' to avoid followup issues. 'n-1' is the index to replace the newline of CRC source name. v2: update patch subject, body and format. (Sam) Cc: Leo Li Cc: Harry Wentland Cc: Sam Ravnborg Signed-off-by: Dingchen Zhang Reviewed-by: Sam Ravnborg Reviewed-by: Sam Ravnborg --- drivers/gpu/drm/drm_debugfs_crc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/gpu/drm/drm_debugfs_crc.c b/drivers/gpu/drm/drm_debugfs_crc.c index 585169f0dcc5..dac267e840af 100644 --- a/drivers/gpu/drm/drm_debugfs_crc.c +++ b/drivers/gpu/drm/drm_debugfs_crc.c @@ -131,8 +131,8 @@ static ssize_t crc_control_write(struct file *file, const char __user *ubuf, if (IS_ERR(source)) return PTR_ERR(source); - if (source[len] == '\n') - source[len] = '\0'; + if (source[len - 1] == '\n') + source[len - 1] = '\0'; ret = crtc->funcs->verify_crc_source(crtc, source, &values_cnt); if (ret)