From patchwork Thu Oct 28 21:36:36 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Andrew Morton X-Patchwork-Id: 12591241 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 044FCC433EF for ; Thu, 28 Oct 2021 21:36:40 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id AEE16610C8 for ; Thu, 28 Oct 2021 21:36:39 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org AEE16610C8 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=linux-foundation.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 502106B0087; Thu, 28 Oct 2021 17:36:39 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 48AAB6B0088; Thu, 28 Oct 2021 17:36:39 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 2DB106B0089; Thu, 28 Oct 2021 17:36:39 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0046.hostedemail.com [216.40.44.46]) by kanga.kvack.org (Postfix) with ESMTP id 038416B0087 for ; Thu, 28 Oct 2021 17:36:38 -0400 (EDT) Received: from smtpin19.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with ESMTP id 7E1E28249980 for ; Thu, 28 Oct 2021 21:36:38 +0000 (UTC) X-FDA: 78747155676.19.4321E48 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by imf13.hostedemail.com (Postfix) with ESMTP id D7CDF1049B49 for ; Thu, 28 Oct 2021 21:36:31 +0000 (UTC) Received: by mail.kernel.org (Postfix) with ESMTPSA id 0FC14610E7; Thu, 28 Oct 2021 21:36:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1635456997; bh=uVXX96cpryr4jYBl0p51ywZQ2aOWyCxUngA8ubIxcxU=; h=Date:From:To:Subject:In-Reply-To:From; b=SpB1huqAqkpz9HwrImHJg9jZTsqnAi7c8pE4mG9AsPn3uwJazUqHLKufoqaDESAqI Zvd/Lt4Sx/P3FREid55dt+gd/gp7Z4zHq+MK5XEUyurHUbcJM0WYeaoCYaql/kPq/5 xIuQuIK0o9/A1fEt6Ti9c4maV4oqdQxkk4vAavEQ= Date: Thu, 28 Oct 2021 14:36:36 -0700 From: Andrew Morton To: akpm@linux-foundation.org, davidcomponentone@gmail.com, linux-mm@kvack.org, mm-commits@vger.kernel.org, shuah@kernel.org, torvalds@linux-foundation.org, zealci@zte.com.cn, ziy@nvidia.com Subject: [patch 11/11] tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer Message-ID: <20211028213636.ffTjwzUhv%akpm@linux-foundation.org> In-Reply-To: <20211028143506.5f5d5e2cd1f768a1da864844@linux-foundation.org> User-Agent: s-nail v14.8.16 X-Rspamd-Server: rspam02 X-Rspamd-Queue-Id: D7CDF1049B49 X-Stat-Signature: j7jo8f3nj4jrmndaft4tpy5p7zsokbpy Authentication-Results: imf13.hostedemail.com; dkim=pass header.d=linux-foundation.org header.s=korg header.b=SpB1huqA; dmarc=none; spf=pass (imf13.hostedemail.com: domain of akpm@linux-foundation.org designates 198.145.29.99 as permitted sender) smtp.mailfrom=akpm@linux-foundation.org X-HE-Tag: 1635456991-222785 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: From: David Yang Subject: tools/testing/selftests/vm/split_huge_page_test.c: fix application of sizeof to pointer The coccinelle check report: "./tools/testing/selftests/vm/split_huge_page_test.c:344:36-42: ERROR: application of sizeof to pointer" Using the "strlen" to fix it. Link: https://lkml.kernel.org/r/20211012030116.184027-1-davidcomponentone@gmail.com Signed-off-by: David Yang Reported-by: Zeal Robot Cc: Zi Yan Cc: Shuah Khan Signed-off-by: Andrew Morton --- tools/testing/selftests/vm/split_huge_page_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/tools/testing/selftests/vm/split_huge_page_test.c~fix-application-of-sizeof-to-pointer +++ a/tools/testing/selftests/vm/split_huge_page_test.c @@ -341,7 +341,7 @@ void split_file_backed_thp(void) } /* write something to the file, so a file-backed THP can be allocated */ - num_written = write(fd, tmpfs_loc, sizeof(tmpfs_loc)); + num_written = write(fd, tmpfs_loc, strlen(tmpfs_loc) + 1); close(fd); if (num_written < 1) {