From patchwork Tue Jul 19 09:42:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Carpenter X-Patchwork-Id: 12922300 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 kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by smtp.lore.kernel.org (Postfix) with ESMTP id D06A5C433EF for ; Tue, 19 Jul 2022 09:43:09 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 20A716B0071; Tue, 19 Jul 2022 05:43:09 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id 1BBAC6B0073; Tue, 19 Jul 2022 05:43:09 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 035C56B0074; Tue, 19 Jul 2022 05:43:08 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0010.hostedemail.com [216.40.44.10]) by kanga.kvack.org (Postfix) with ESMTP id E871D6B0071 for ; Tue, 19 Jul 2022 05:43:08 -0400 (EDT) Received: from smtpin30.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay06.hostedemail.com (Postfix) with ESMTP id BFCE235382 for ; Tue, 19 Jul 2022 09:43:08 +0000 (UTC) X-FDA: 79703360856.30.762999B Received: from mx0a-00069f02.pphosted.com (mx0a-00069f02.pphosted.com [205.220.165.32]) by imf18.hostedemail.com (Postfix) with ESMTP id 3375E1C0086 for ; Tue, 19 Jul 2022 09:43:06 +0000 (UTC) Received: from pps.filterd (m0246627.ppops.net [127.0.0.1]) by mx0b-00069f02.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 26J87KFO032504; Tue, 19 Jul 2022 09:43:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=date : from : to : cc : subject : message-id : content-type : mime-version; s=corp-2022-7-12; bh=v7nTjnE4RTqkS/nk33ornVWy4i7HA3xUdMEjn7YRZbs=; b=WPWZLqqCgTRgzy01rB2ooiGvq/2KJcows+8KpeRaGWgQAKfBIwvgCLH9KliRfbbDGN5W Tarfq2xpJ4eIFBuc0cr28sJHA+Pn4MWhoVxdVBSIJ+8UGWrgkZvxuTfOzpxpdtk+ZYx7 MBb89UyIyL/ZUGfrltwhQlGApkbI+jsiuOxGC9IlAbmuhhWVIEDiil7VkfPohXajCvXu N73SrWf9x6yLSosP4qv1vQKLuisOHjuDwxoTA+o2CiWPQ0fNxdwvmBnKciaLi9lfoW4P s2u3LEMhfdrswoLFXd7bz69JsL/pR0gkKoQt43HG0VnXZXGg6dN3GZTTvAcpbJXVy8Pb LA== Received: from phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (phxpaimrmta03.appoci.oracle.com [138.1.37.129]) by mx0b-00069f02.pphosted.com (PPS) with ESMTPS id 3hbkx0wtbf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jul 2022 09:43:00 +0000 Received: from pps.filterd (phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com [127.0.0.1]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (8.17.1.5/8.17.1.5) with ESMTP id 26J8ZggP039198; Tue, 19 Jul 2022 09:43:00 GMT Received: from nam12-bn8-obe.outbound.protection.outlook.com (mail-bn8nam12lp2172.outbound.protection.outlook.com [104.47.55.172]) by phxpaimrmta03.imrmtpd1.prodappphxaev1.oraclevcn.com (PPS) with ESMTPS id 3hc1k4k370-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Jul 2022 09:43:00 +0000 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=GR2cDm9ZYclF3TKlJ+JFYbP0s2xnuoOQ4210bpoK3Np5LZGZtkdf84hbwN0f3qqBoOywGbzp/tyGoPTF/dexsFDfwyF4hE7Gw/YzcmKivdDRMGpNlS8sFRozCpZWeRviJA2NqD+6EnUab8M6o3B4km/mPAr17f393L51fWo8V7xaJjBRm+hBbQ2N5+iGpikJYC/vXnR8NQ74R1gy7lhgVCbaJqASfMybNyqCrD83xpSRtzNAPyi/upSTlT3kZPk4ioyOg7XYKyYkaUco5bDnXhaFKMTbKk8d2jKAyTu7xuWyAQQAZzIX68QNGl3rAxtEYEyqj5sRzpH1baHMUW2orQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=v7nTjnE4RTqkS/nk33ornVWy4i7HA3xUdMEjn7YRZbs=; b=kfrwqzQ57EcEVY81JfrXRW2n3afsbnDQhxF93FaJrw//A4E+9VbZBIS+xl7uX5B+QDymA2C/+j4iZJtAp+gUjbjf+ggh9pLopaspasXXYAD8BlLWd+h0zs/+aQWqdCDsJtuGSdBDUJYdotYpdKGfCFMVk5U5Sb5o1Y+wwOEXgmgjOLdCrTK/8JMtsrPN7f6XUqDLgjOhm4qOqjfFb4839q6aypROtH0tsZLTUqiduofA1QoFc3fGCD34TWySCH/pyw+4NjTgbV0YTzw/uscWkW00O1b2vDjbhzj/aNp03lZs74Zk16itjLjHJsh6JjGH6s16aoPflUQ1REkg5krxNg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=oracle.com; dmarc=pass action=none header.from=oracle.com; dkim=pass header.d=oracle.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.onmicrosoft.com; s=selector2-oracle-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=v7nTjnE4RTqkS/nk33ornVWy4i7HA3xUdMEjn7YRZbs=; b=FkD2MUk3rNy8nK8hf7gRKktK6ql9GXM+YLjn6pw2K2opcHvL/hSrI3+8n55G1m3Cactp8YGSbdEhjh1yP/gg3ZdcsIf9C8bGm+6K4Tz7uMjWQ8gkKyjIKIqTXKH48PKYbLSVkR7/bHhy8A3dInkFgnzmNazAf3qQsWfbApT4b8M= Received: from MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) by BLAPR10MB4946.namprd10.prod.outlook.com (2603:10b6:208:323::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5438.14; Tue, 19 Jul 2022 09:42:57 +0000 Received: from MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b]) by MWHPR1001MB2365.namprd10.prod.outlook.com ([fe80::5020:9b82:5917:40b%6]) with mapi id 15.20.5438.023; Tue, 19 Jul 2022 09:42:57 +0000 Date: Tue, 19 Jul 2022 12:42:48 +0300 From: Dan Carpenter To: Andrew Morton , Mike Kravetz Cc: Shuah Khan , linux-mm@kvack.org, linux-kselftest@vger.kernel.org, kernel-janitors@vger.kernel.org Subject: [PATCH] selftests/vm: silence uninitialized variable warning Message-ID: Content-Disposition: inline X-Mailer: git-send-email haha only kidding X-ClientProxiedBy: ZR0P278CA0055.CHEP278.PROD.OUTLOOK.COM (2603:10a6:910:21::6) To MWHPR1001MB2365.namprd10.prod.outlook.com (2603:10b6:301:2d::28) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 52a85800-eab9-4c60-0d00-08da696b0ff8 X-MS-TrafficTypeDiagnostic: BLAPR10MB4946:EE_ X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: u1Ii/h75icPUHIbKnpfD4X74WJqvV7FvRNA31xmE0r4VMHzv4bIX6cbYIHDbgKQKM9Dri8yknA3aaULIgnBj5CoeqrhGN5WYpOfcCO5OI5Na2ze3J8IMe4Zl/KF4vt31rIlGYlQLA6MA3qkD5V4OKhVt7OgFBd4zixASiAigE9e872lkujQThEpwQb7PothFGoCYcRgfjMRKAq0mnsQ5/mq1I84VLrtfJ7NarRnUPJvLXFDPRoWnUMvpghqX20hagGj07UK6WwAxxHUIPG/rixXMyk1eSl+yejQpn5ExaNLEdKMhtdUtJzSIWQElq1VZmQq566cZrWcEVcfPytNPhO0cS1EdNZJ9z48l1w1Z4gnPxe0ZwgCJHtKKn7eZz5rpXS8/ocMNCqV5kOvCzaHbQNAe190jbMZuDcWe8P+JeG+oKxoV8UsOnnkZGkzWOa+0IVdVNVaJ4IlsAlcg72AR5ak34Pf3FyosWN9ITz45n7+UqUZpCfUkzeuSbIjPwEj3gsEXOjMN+kBrzur62EIZf5QNmYRPCvt0XGRQB8cPrAQe6bvKA28ZCkXcS8k6G5H/hpZEkT4Xsj3Ta8nZGZDi44+VjHYLzWA2fYeYBmqD48kK37ypiJmj2A/fod89WQcjoayQK71Ir+DCh4VqclgEq9il16xaM8l8kWP1gxf0XBvHjSV4EEeTt+0b4TK8gOZ4jWKSEX37EKwwsx+R+Dxg3Kd3gjFXo/oolxbphdr8fevC1zcgws7sOwd6hub89MnsZ6Hq5j6vXnPLp8y2mGKuaqF7u7O/WSHAdVvfSIUhYZM9/nkJkYrYEGsMRvNJ2JBa X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MWHPR1001MB2365.namprd10.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230016)(7916004)(396003)(376002)(136003)(366004)(39860400002)(346002)(6666004)(33716001)(52116002)(110136005)(4326008)(66946007)(66476007)(66556008)(316002)(86362001)(6486002)(8676002)(478600001)(2906002)(38100700002)(8936002)(38350700002)(41300700001)(83380400001)(6636002)(6512007)(26005)(9686003)(6506007)(44832011)(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uURHbCetZa2F6J4H3dDi3McPXk0iCpqoRuOzFZ1D+x1SPUYq4w5vS+oLUKq5gZh/RCbhFIewM/z2GQ7pqDS1HyGW8t0xI3w003L7qjVf5/e8ZLL0efIwSosyFJ2cGQTZf40J91BVMqa2AKBclhjnLgkiJKEyY8h/k8Vg5rkqkC/Ugc2MEpdCS75gMq0MO7DSbufimI2xTB0P4FWI2deEZWHo9Hv3lE0NF7x+yNLXSH8FFTcP2brxed5/zQ+YRxNkLvvI2/6PGfarh1ql1P45OAlPldEYdrse+CvRCW1Dn8xIYhC/kk4RsLDhZzAOKUGjPcuinwUHlS4Dl+nWfrFX5Tk81JaIUpk0Qx+kTl4mxUmUbQ/z65mHdooBeM2dDBgeQFGt6bQp7RkqzI99166CXxchy12g5TM0q/ptHIWHNMJ2i3LRKOEt4LdPqfzizv6cqcrFg/MC4O8jA9CPm/pAtQU2NGw8YH9wyORoseii3aOxbA0xNkarH9Sw5xy7jtL1Mt+JK5DVH+iBx/1pIuFc/qjZDul0MLnvy3wLr6FnOaCXhBTA/0fL4No9grDz7jjuakUWMcMKTr28tZKVu9to1VodPsaqQwF5Pg5BocfjINciauT4RMdA== X-OriginatorOrg: oracle.com X-MS-Exchange-CrossTenant-Network-Message-Id: 52a85800-eab9-4c60-0d00-08da696b0ff8 X-MS-Exchange-CrossTenant-AuthSource: MWHPR1001MB2365.namprd10.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 19 Jul 2022 09:42:57.8084 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 4e2c6054-71cb-48f1-bd6c-3a9705aca71b X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: c9YtdA0pWCtXcp6rrihfK8nqnxowSVnn4rNzCEKxKUNlfhWbep3x4ZWwJynsDQeQKsnGLhmDYj1WckbYwkRVjQYSUgBqX9GLgLT/yd2NhWM= X-MS-Exchange-Transport-CrossTenantHeadersStamped: BLAPR10MB4946 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.883,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-07-18_22,2022-07-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 bulkscore=0 suspectscore=0 mlxlogscore=999 malwarescore=0 adultscore=0 mlxscore=0 spamscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2206140000 definitions=main-2207190041 X-Proofpoint-GUID: aakwHGYXTPYvQHBg8sAlVkFlX0qOSZkI X-Proofpoint-ORIG-GUID: aakwHGYXTPYvQHBg8sAlVkFlX0qOSZkI ARC-Seal: i=2; s=arc-20220608; d=hostedemail.com; t=1658223787; a=rsa-sha256; cv=pass; b=5W06hD6GeTh7q7qY6YkvSZVay6wq5o6jvwaXkuzQxt8MqVlxi/U2sn/5IjEiEKDlNAi5Mb w1DigU42VTsqmAQFDy2OxOfIyRpWkszVzEVfPxishxOUzgJf35GGSYDClwnE0Y05mgxxMr dNpQAgL0fzVZlVCWdE7Chbz5MEgyWI4= ARC-Authentication-Results: i=2; imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=WPWZLqqC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FkD2MUk3; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf18.hostedemail.com: domain of dan.carpenter@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=dan.carpenter@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1658223787; h=from:from:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type:content-transfer-encoding:in-reply-to: references:dkim-signature; bh=v7nTjnE4RTqkS/nk33ornVWy4i7HA3xUdMEjn7YRZbs=; b=rIfHirJ2h7rxa8HKu6RLzqjGWGRrowq8wCiiS2vAolIKRuIdQIMLSmjmw7MNe8iFZxzXvk ZdU7JHPSBngX0q0+dJLUJXcc2MzkCzFbPR9K7WiodLE/tHnh1xZg82UjD/kXffkWYcNP/0 aVZF/ujcLHmjGoy/XEpEkoeBzUp8CKs= X-Rspam-User: Authentication-Results: imf18.hostedemail.com; dkim=pass header.d=oracle.com header.s=corp-2022-7-12 header.b=WPWZLqqC; dkim=pass header.d=oracle.onmicrosoft.com header.s=selector2-oracle-onmicrosoft-com header.b=FkD2MUk3; dmarc=pass (policy=none) header.from=oracle.com; spf=none (imf18.hostedemail.com: domain of dan.carpenter@oracle.com has no SPF policy when checking 205.220.165.32) smtp.mailfrom=dan.carpenter@oracle.com; arc=pass ("microsoft.com:s=arcselector9901:i=1") X-Stat-Signature: 6tqs1d39s4ycbsnpkxrkk1nao69g18mz X-Rspamd-Queue-Id: 3375E1C0086 X-Rspamd-Server: rspam02 X-HE-Tag: 1658223786-695725 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: This code just reads from memory without caring about the data itself. However static checkers complain that "tmp" is never properly initialized. Initialize it to zero and change the name to "dummy" to show that we don't care about the value stored in it. Fixes: c4b6cb884011 ("selftests/vm: add hugetlb madvise MADV_DONTNEED MADV_REMOVE test") Signed-off-by: Dan Carpenter Acked-by: Souptick Joarder (HPE) Reviewed-by: Mike Kravetz --- tools/testing/selftests/vm/hugetlb-madvise.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/tools/testing/selftests/vm/hugetlb-madvise.c b/tools/testing/selftests/vm/hugetlb-madvise.c index 6c6af40f5747..3c9943131881 100644 --- a/tools/testing/selftests/vm/hugetlb-madvise.c +++ b/tools/testing/selftests/vm/hugetlb-madvise.c @@ -89,10 +89,11 @@ void write_fault_pages(void *addr, unsigned long nr_pages) void read_fault_pages(void *addr, unsigned long nr_pages) { - unsigned long i, tmp; + unsigned long dummy = 0; + unsigned long i; for (i = 0; i < nr_pages; i++) - tmp += *((unsigned long *)(addr + (i * huge_page_size))); + dummy += *((unsigned long *)(addr + (i * huge_page_size))); } int main(int argc, char **argv)