From patchwork Tue Oct 12 03:01:16 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: David Yang X-Patchwork-Id: 12551331 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 6BEE0C433EF for ; Tue, 12 Oct 2021 03:01:34 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 0585460D43 for ; Tue, 12 Oct 2021 03:01:33 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org 0585460D43 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=gmail.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=kvack.org Received: by kanga.kvack.org (Postfix) id 3E32D6B006C; Mon, 11 Oct 2021 23:01:33 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 392246B0071; Mon, 11 Oct 2021 23:01:33 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 28136900002; Mon, 11 Oct 2021 23:01:33 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0079.hostedemail.com [216.40.44.79]) by kanga.kvack.org (Postfix) with ESMTP id 17D916B006C for ; Mon, 11 Oct 2021 23:01:33 -0400 (EDT) Received: from smtpin17.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay04.hostedemail.com (Postfix) with ESMTP id B225B2DD73 for ; Tue, 12 Oct 2021 03:01:32 +0000 (UTC) X-FDA: 78686284824.17.59BE826 Received: from mail-pf1-f172.google.com (mail-pf1-f172.google.com [209.85.210.172]) by imf16.hostedemail.com (Postfix) with ESMTP id 7131BF00234C for ; Tue, 12 Oct 2021 03:01:32 +0000 (UTC) Received: by mail-pf1-f172.google.com with SMTP id h125so6413080pfe.0 for ; Mon, 11 Oct 2021 20:01:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AMCytzgSZ3FsdSOFb5Ppvpt7FDy4HICMnNT5RYUnNMY=; b=ZZvCI+IWpcOzBSZFRoQ4p0Uh3753QA+4/hnULh2LKdY3+zrsOnKTHtHUVuBmEkcwKn Bqho4lQWmwJfqma+V+v534dMUd9h5dvFhuyIgW4w5gvgGxA/doVG0TlGMC2Y8A0I+LkZ LLdylk14M5dbHKRuNIEdSVjbo3HadhJZ0jfhS8XrP9oZiGZrpGx+zmAse9SpucwThh9/ x+55iuYsk2lXxwGz1NlhSxGdYdjCmRdiqBzAxHLy9cvHoe8lYccBWrecZK+ryjfZdE+n eTYgvy0V1Iu5aNf6fIQ+526DMiF8fKp/0S5rzRRKiocNTp5g33JKLU/TjxJ/oMaTQuhZ FWxQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=AMCytzgSZ3FsdSOFb5Ppvpt7FDy4HICMnNT5RYUnNMY=; b=kbxIrBWFa1qPJjcYIeWfVz0z3i8YMCd7UBH2WAC2XxWdW8/+84BjLVfMb6JVxRE5jK eAEJ9ImopklEqFxIyAXcbSd7V+i00rCF8oe3+js7oA82uwBg0L8CDT8A4ICSW/9Io2jp yqGmJvaBHp5rcaaXHDR1TcWrpJyhA4bf7LxTbi1LDlXhGWiNWXqRpvMEM33z7mfHG0Rx yWC8MRfChNtrBsWnUkcSLIlY20uMB1vzZ0PtsbbBQ8OnQ5H5Bcxg9/nQdfwAObIu7XfY PjVYsSypTelUDNIONpXrv917VByy+/aOlux4Hx76ch7Uwh6myAIOzrc9IngSBCx9Ga3Y jRRQ== X-Gm-Message-State: AOAM531IIy5GYGoEPh6sf9Y/6QyqjGX69i5RLZLfnNXs4yzepvS1WKo4 rSs6t7T+q0GKvJGxc6D1TI4= X-Google-Smtp-Source: ABdhPJySfeA3NkPC4FfFwnhlWMrGmUc41lxkXJ2BoSb4GTmdEWlk9TDD8NGtVRczHibbvSWS6EWVpA== X-Received: by 2002:a05:6a00:ac6:b029:374:a33b:a74 with SMTP id c6-20020a056a000ac6b0290374a33b0a74mr29664983pfl.51.1634007691395; Mon, 11 Oct 2021 20:01:31 -0700 (PDT) Received: from debian11-dev-61.localdomain (192.243.120.180.16clouds.com. [192.243.120.180]) by smtp.gmail.com with ESMTPSA id e15sm8739432pfc.134.2021.10.11.20.01.28 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 11 Oct 2021 20:01:31 -0700 (PDT) From: davidcomponentone@gmail.com To: akpm@linux-foundation.org Cc: shuah@kernel.org, linux-mm@kvack.org, linux-kselftest@vger.kernel.org, linux-kernel@vger.kernel.org, David Yang , Zeal Robot Subject: [PATCH] Fix application of sizeof to pointer Date: Tue, 12 Oct 2021 11:01:16 +0800 Message-Id: <20211012030116.184027-1-davidcomponentone@gmail.com> X-Mailer: git-send-email 2.30.2 MIME-Version: 1.0 X-Rspamd-Server: rspam01 X-Rspamd-Queue-Id: 7131BF00234C X-Stat-Signature: tiysj9kq8co5ekbkk8i7tssx8nj8xwrd Authentication-Results: imf16.hostedemail.com; dkim=pass header.d=gmail.com header.s=20210112 header.b=ZZvCI+IW; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (imf16.hostedemail.com: domain of davidcomponentone@gmail.com designates 209.85.210.172 as permitted sender) smtp.mailfrom=davidcomponentone@gmail.com X-HE-Tag: 1634007692-642099 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 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. Reported-by: Zeal Robot Signed-off-by: David Yang --- tools/testing/selftests/vm/split_huge_page_test.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/testing/selftests/vm/split_huge_page_test.c b/tools/testing/selftests/vm/split_huge_page_test.c index 1af16d2c2a0a..52497b7b9f1d 100644 --- a/tools/testing/selftests/vm/split_huge_page_test.c +++ b/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) {