Received: by 2002:a25:8b91:0:0:0:0:0 with SMTP id j17csp1502067ybl; Sun, 19 Jan 2020 04:44:07 -0800 (PST) X-Google-Smtp-Source: APXvYqyyATH14T8jAPFJV6OlcSRtC/eCA3OB+jKcFPnhcTEyfByb7ksTAWi2DOJTEZVgMtelhCl+ X-Received: by 2002:a9d:402:: with SMTP id 2mr11579139otc.357.1579437847247; Sun, 19 Jan 2020 04:44:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1579437847; cv=none; d=google.com; s=arc-20160816; b=DBp0m5N6aksBWVB5RhARtJVoy3DAKZTu1SfqxIsEeVKVFn0umhmw/7PLv+i8PNVnn+ 7VSZCJoqZ8/Aau/Alv2fECrunA0biYgoRrR4lY0cKn7XghRen5k4pRdKm4+BgAcx6rYU xlo4ZShPVZlTliV4i9QnIKS1cN9p+G13eSf0uAfGaqaOF3oGM2KWYZI3SGXqizGICgku IFjSCaV3xSAOv1OB/MgsuvoK0Ims306tx6jKRRBaX1UwWMjPqAIB68TKgUZBY02Hcn5u +7lF38iMLJFV0FuftdrfCkW4ijenb0NACfGppw4oeQY2rRdUQoKb6KtrKZDwYhr+3Ao3 C0Qw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=xbtk5Bv7yrMAgGD+0bH5UxgPIcEG+3HacPmmlLSu2sg=; b=sjk2V41E6sEAM7t0kSkJQLBQELxDRNbPSjoTYCLUl5gHD3Eol0Cyx+uSUGAR7pCnb4 5u27xWxjiO/sbyIjHH7ekPdJIFhVEX6lu8T9RHiIjlCiSxErvaMfkF9qCaizMoP/2HWw pXfeS1LjBGWfFIVLcYihzwM8vTIMU9mVTbbWhUw9FVAYDS1ZOlSDafQbiT5xvMEhH+IK a3onD1aPuCzt4Epx4lLh8StXOMhvrkeN83OVhPJx37iDf8AQu8p9iTWrBPO50v3Zci+Z /sVJeCzqB6Libud/OTBRQIQg4jRsGuauGYCih9Gq1qIPl9XAuY65lLfqR9zuugUASNT2 kZGA== ARC-Authentication-Results: i=1; mx.google.com; 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 x7si15624692oia.165.2020.01.19.04.43.43; Sun, 19 Jan 2020 04:44:07 -0800 (PST) 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; 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 S1726867AbgASMl5 (ORCPT + 99 others); Sun, 19 Jan 2020 07:41:57 -0500 Received: from szxga05-in.huawei.com ([45.249.212.191]:9199 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726778AbgASMl5 (ORCPT ); Sun, 19 Jan 2020 07:41:57 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.58]) by Forcepoint Email with ESMTP id 2B7E7B8D7D2AF1843CC5; Sun, 19 Jan 2020 20:41:54 +0800 (CST) Received: from localhost.localdomain.localdomain (10.175.113.25) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.439.0; Sun, 19 Jan 2020 20:41:44 +0800 From: Chen Zhou To: , , CC: , Subject: [PATCH -next] lkdtm: remove unnecessary terminated-null assign Date: Sun, 19 Jan 2020 20:36:59 +0800 Message-ID: <20200119123659.29950-1-chenzhou10@huawei.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 7BIT Content-Type: text/plain; charset=US-ASCII X-Originating-IP: [10.175.113.25] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org scnprintf implementation of kernel guarantees that its result is terminated with null byte if size is larger than 0. So we don't need to set terminated-null again. Signed-off-by: Chen Zhou --- drivers/misc/lkdtm/core.c | 1 - 1 file changed, 1 deletion(-) diff --git a/drivers/misc/lkdtm/core.c b/drivers/misc/lkdtm/core.c index ee0d6e7..5ad2630 100644 --- a/drivers/misc/lkdtm/core.c +++ b/drivers/misc/lkdtm/core.c @@ -341,7 +341,6 @@ static ssize_t lkdtm_debugfs_read(struct file *f, char __user *user_buf, n += scnprintf(buf + n, PAGE_SIZE - n, "%s\n", crashtypes[i].name); } - buf[n] = '\0'; out = simple_read_from_buffer(user_buf, count, off, buf, n); -- 2.7.4