From patchwork Mon Jun 10 13:47:51 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: 10985005 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 66FD276 for ; Mon, 10 Jun 2019 14:05:30 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 56F2E27480 for ; Mon, 10 Jun 2019 14:05:30 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4AC1F2808F; Mon, 10 Jun 2019 14:05:30 +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 4462D27480 for ; Mon, 10 Jun 2019 14:05:29 +0000 (UTC) Received: from gabe.freedesktop.org (localhost [127.0.0.1]) by gabe.freedesktop.org (Postfix) with ESMTP id B7789890DF; Mon, 10 Jun 2019 14:05:26 +0000 (UTC) X-Original-To: dri-devel@lists.freedesktop.org Delivered-To: dri-devel@lists.freedesktop.org Received: from NAM04-CO1-obe.outbound.protection.outlook.com (mail-eopbgr690054.outbound.protection.outlook.com [40.107.69.54]) by gabe.freedesktop.org (Postfix) with ESMTPS id 55F8C890DF for ; Mon, 10 Jun 2019 14:05:25 +0000 (UTC) Received: from MN2PR12CA0028.namprd12.prod.outlook.com (2603:10b6:208:a8::41) by DM6PR12MB2668.namprd12.prod.outlook.com (2603:10b6:5:4a::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1965.12; Mon, 10 Jun 2019 14:05:23 +0000 Received: from BY2NAM03FT055.eop-NAM03.prod.protection.outlook.com (2a01:111:f400:7e4a::203) by MN2PR12CA0028.outlook.office365.com (2603:10b6:208:a8::41) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1965.15 via Frontend Transport; Mon, 10 Jun 2019 14:05:23 +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 BY2NAM03FT055.mail.protection.outlook.com (10.152.85.245) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1965.12 via Frontend Transport; Mon, 10 Jun 2019 14:05:23 +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; Mon, 10 Jun 2019 09:05:22 -0500 From: Dingchen Zhang To: Subject: [PATCH] drm: remove the newline for CRC source name. Date: Mon, 10 Jun 2019 09:47:51 -0400 Message-ID: <20190610134751.14356-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)(396003)(376002)(39860400002)(136003)(346002)(2980300002)(428003)(199004)(189003)(1076003)(8676002)(5660300002)(6916009)(86362001)(16586007)(426003)(50226002)(77096007)(47776003)(54906003)(2351001)(53936002)(336012)(186003)(53416004)(81156014)(44832011)(6666004)(356004)(486006)(478600001)(81166006)(2906002)(316002)(26005)(2616005)(126002)(72206003)(476003)(50466002)(7696005)(4326008)(51416003)(68736007)(48376002)(36756003)(8936002)(70586007)(70206006)(14444005)(305945005); DIR:OUT; SFP:1101; SCL:1; SRVR:DM6PR12MB2668; H:SATLEXCHOV01.amd.com; FPR:; SPF:None; LANG:en; PTR:InfoDomainNonexistent; A:1; MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b2bb9f38-bfe4-4209-cf69-08d6edacae3e X-Microsoft-Antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(1401327)(2017052603328); SRVR:DM6PR12MB2668; X-MS-TrafficTypeDiagnostic: DM6PR12MB2668: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:1186; X-Forefront-PRVS: 0064B3273C X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: wXaawJHhaWrcyehlsMFbMPQ+kw/1SFJJqf9Q23XEft047s6MpX07j7xRAwP5KzPejuFOUfI5lV+8smIkvT83D+2oh+0EklEYyBjHtu+rLQpxhPSUy/Of89W/DKlqdCH2JugV9sbUgsnlWQ8BUiK77WYftAeyhyOgFM2XXnuGnDXTze/L7QrLyezTo1poCmZdBKsweJzpHR7vMbDn2NqO4kwpkf4wAN/7dhlmakpNIzPVmj69cwzQ/le7Yy+5KsRXE1on7GHo5LVNXK7luSyXpKz8WhCsMwDM5hqhOfEEsW9jksCOTRD/5x9kBckFGFSjec7hJrVO7xUoFtE0OsYKZJWpGm/PofeUZsd5t+Zo9rF3+VPTmIC3BVLv5vD6pLLWm4yVfLHSwPA7YkqOPEQbrW24ZgNP8yIhQrTkGLdKILw= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Jun 2019 14:05:23.0771 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b2bb9f38-bfe4-4209-cf69-08d6edacae3e 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: DM6PR12MB2668 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=SNvJwHx7xXdq3CAa7ISGLq/I8Wo6Tgulg+jBEGAyWAI=; b=NPxdDgWFmX+mf+g26V5ioYIi4rmut28w/Pz9HQMqEGWFukUFS/oneSTGpcFm0o/JaZt7fl/sHUFRTxJNuYUmtbBbtL93lnSjMEx1lnQfFC7/W95lv8oVCA79Xg28bPGCJBcGAFfOtOIm+BXn3yTlOXGQT8a/E/njrsbZFAz6EiY= 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. 'len-1' is the index to replace the newline of CRC source name. v3: typo fix (Sam) 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 --- 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)