From patchwork Mon Oct 14 18:39:18 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pintu Kumar X-Patchwork-Id: 13835390 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 3E06AD1813C for ; Mon, 14 Oct 2024 18:39:49 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id CB16F6B0093; Mon, 14 Oct 2024 14:39:48 -0400 (EDT) Received: by kanga.kvack.org (Postfix, from userid 40) id C617B6B0095; Mon, 14 Oct 2024 14:39:48 -0400 (EDT) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id B292A6B0096; Mon, 14 Oct 2024 14:39:48 -0400 (EDT) X-Delivered-To: linux-mm@kvack.org Received: from relay.hostedemail.com (smtprelay0011.hostedemail.com [216.40.44.11]) by kanga.kvack.org (Postfix) with ESMTP id 939226B0093 for ; Mon, 14 Oct 2024 14:39:48 -0400 (EDT) Received: from smtpin06.hostedemail.com (a10.router.float.18 [10.200.18.1]) by unirelay09.hostedemail.com (Postfix) with ESMTP id 6AF2D812F3 for ; Mon, 14 Oct 2024 18:39:41 +0000 (UTC) X-FDA: 82673071446.06.4EB1849 Received: from mx0b-0031df01.pphosted.com (mx0b-0031df01.pphosted.com [205.220.180.131]) by imf25.hostedemail.com (Postfix) with ESMTP id 8813CA000A for ; Mon, 14 Oct 2024 18:39:41 +0000 (UTC) Authentication-Results: imf25.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="JH LnC9D"; spf=pass (imf25.hostedemail.com: domain of quic_pintu@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_pintu@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=hostedemail.com; s=arc-20220608; t=1728931043; 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=OmFNDURywkkm73pEB8SdJltHWfyk4KMLqnF1nWHYZLE=; b=hfgmT5gRbk2eFmgOP74Suh7/wA0yFQmS8GQCF9QhpP2nvHZK0s01N88UGjodG5GkbbNHga 24ukO6jA+COW7PvpC+ZSrWjTOYPPkbpeVvXX1BE5cgco7FL+ncOe6L6wKoONHE+jdITl3b z1mpR/Z8iR2+WTERj0SZhVwbK18s55k= ARC-Seal: i=1; s=arc-20220608; d=hostedemail.com; t=1728931043; a=rsa-sha256; cv=none; b=dXxoaFWd6WILC5i8y2i4wjw2T/H4NPpIInavwhD6O9XN9LTPdKFxPR8ugmyueZCKbqJOB9 AovyH150TjJVmqsAJ6NycJ15KGvgK8Sqx8zYuqBtE9PomOk7NMQyW3a1XbSbHdGqJJ1cq/ +OyFBHv8b2GKUmYDUK5IFVTubMOb1gE= ARC-Authentication-Results: i=1; imf25.hostedemail.com; dkim=pass header.d=quicinc.com header.s=qcppdkim1 header.b="JH LnC9D"; spf=pass (imf25.hostedemail.com: domain of quic_pintu@quicinc.com designates 205.220.180.131 as permitted sender) smtp.mailfrom=quic_pintu@quicinc.com; dmarc=pass (policy=none) header.from=quicinc.com Received: from pps.filterd (m0279870.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.18.1.2/8.18.1.2) with ESMTP id 49EAJnDx019709; Mon, 14 Oct 2024 18:39:41 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h= cc:content-type:date:from:message-id:mime-version:subject:to; s= qcppdkim1; bh=OmFNDURywkkm73pEB8SdJltHWfyk4KMLqnF1nWHYZLE=; b=JH LnC9DtW7xiop+vmgCUb3lBkioceFlhlKBtDJkiP2fJ2GD/i68maYqFmdpBswcI30 i4a3+4JP8TCufPNBRdhXLfOqRgqcyCKdqV/7YWILBuyWy7fBNp0+RqpgF9Lwwjyh ky7BJtMVf6e9NVmoWieCPd72ncKr3WOOHRe5eGt6uvGt+MnTaKT7BZroEfRT22jl evbDpFVSSNB8bgbvSxtFamX9SEGKvipglvFQGISCVqsq3wKv14+j9cH5LD68nkWv k0TtJ/EOwaxTTXlEwBqekgsQgxv88XzS107mcvGCGoxb77fq/iDxlMAho+qiH0FQ 7IrzVXr/mwW8sRFzdUbg== Received: from nasanppmta02.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 427h6twd0q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2024 18:39:41 +0000 (GMT) Received: from nasanex01a.na.qualcomm.com (nasanex01a.na.qualcomm.com [10.52.223.231]) by NASANPPMTA02.qualcomm.com (8.18.1.2/8.18.1.2) with ESMTPS id 49EIdeew019117 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 14 Oct 2024 18:39:40 GMT Received: from hu-pintu-blr.qualcomm.com (10.80.80.8) by nasanex01a.na.qualcomm.com (10.52.223.231) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1544.9; Mon, 14 Oct 2024 11:39:37 -0700 From: Pintu Kumar To: , , , CC: , , Pintu Kumar Subject: [PATCH] mm/kmemleak: fix errors/warnings for coding style Date: Tue, 15 Oct 2024 00:09:18 +0530 Message-ID: <20241014183918.30123-1-quic_pintu@quicinc.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01a.na.qualcomm.com (10.52.223.231) X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-GUID: AOdQbd9XMOLVfz2wXFuA_fmbiW1IPQKQ X-Proofpoint-ORIG-GUID: AOdQbd9XMOLVfz2wXFuA_fmbiW1IPQKQ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.293,Aquarius:18.0.1039,Hydra:6.0.680,FMLib:17.12.60.29 definitions=2024-09-06_09,2024-09-06_01,2024-09-02_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 phishscore=0 mlxlogscore=999 malwarescore=0 lowpriorityscore=0 mlxscore=0 adultscore=0 spamscore=0 suspectscore=0 clxscore=1011 priorityscore=1501 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.19.0-2409260000 definitions=main-2410140133 X-Stat-Signature: quzapsofzxdjorp5oknox8h4s9o134yx X-Rspamd-Queue-Id: 8813CA000A X-Rspam-User: X-Rspamd-Server: rspam08 X-HE-Tag: 1728931181-230015 X-HE-Meta: U2FsdGVkX1+2WlV3Nl8eDSEy2/nAR4ng3lRYM17j8EqdpRjHmYgDseKMDo6VlUKuF5aWU35q+WikKuFdzZJZd8u5SCzCg+gBYmT8Bw+xTCYAHimWY3Mj1HBWq0VHJqqta65K5F4OJ7IhRCdAoR5gZd1rUiWbNzHuM6YCVsM5u9clUyjirRQB4UAWIIlQp+eZq83xyW2BaIgKpf2sJoGEwvyEDWhcT+ucr58UeNUtYW1mkYr600M4v8e6kqrSKpod8zOsMWs0SitUsPzsaHMD4ogPMPgVwLL0/Ft9mCcJuzq7aBHV0FSlHJL/eGzcsK+VJzFkMpTYbKE1kwV+CLPIoZH+F4IOQT8jXZwendZVrNEm4NKYyJh5HWPjnzM0T34qI5CvdVnQW0l/45yteXjJfoeseI5a1Qy3M18QbqPtl0olto4+TIWyTN29+PiQuXGK82TlQZ1/fUINSqnkGuumYyWHEBsMtyKJMRraVs2OZKaD1R6VtGspXGMHFFcWJT3pDbaklVWHGu7jGLHP4E88bhAWXGfu86G13itOtN7ErOXgFoLAsDM3bER/tLFw+RKN3NQcMQr/hqF6N9eCFO1lcdOlB21121MYITO+OzvO4YdjE1+ZtWih9tazsr2nVX9l64VFnKUN67iiiaiyVrvfPcliAtycQjg7rG02+pD8LELsN3Pfr22SoiU9/zekny1BOZdHQUZoWefujlo0hcdwIrQPXY2W2Y50DJDkpNWW4Tw/9UCiSyaxWjs+37W5bV0qDixKrAOLZ5H5AqM2Wi8wU0SLjczPQxTUmnrRwldBok5WsPTNQ5NMNV/2BmoaARd77dtEOdLKLqfY/PgpF1FWOBWjpRfkaOZg8FBqsEPehxW+mJiWPbhBCk/SlSuDbMDo8HXSgCgzmd1u7Oo1M3IDnW/04vmkbPuksTjX/EQpK6iXl/EvBOUtJwx1tstaE/0/0s37Jr+UOuGV0jQ/PLg y9sAeFmm 2TnXi6KSHCwTjvdrMIfdzm9oGDrolXxevuP5jXBa/ZKLoT5tV8i9IpdlxN0b2v+9DEhH+/Zau20I3zAIBy//v0rXkMoG4D/NQis7E7fRdXSVjEacBJMRSSyPJOPzDs5ykdHiiplaCQHZPDxHvw++iWf9VuUCOYWBPxD0nyBbdxNmf2tzoSyS5NvOKaVUknCRU1K0D7ODrYW1TaZbb80e/bhafUqHEHpf81ikp2EtNPogGMXAHX8E3eSDAk20misa0iIynlUY6SUQO83nzKxMfrSPV2zmRdTFWjvpUYp+Xv0k6C23eCdNvEXq1fohKPZ2ZAsz+uKzbaLKS2jXhpHrq93kDgLn7lfa0P7IFiq4e/oWuEcI8xgF7bYhB7T+uUI3vYLU78zXDeGzNhW4+JaRkesUzRg== 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: List-Subscribe: List-Unsubscribe: There are several errors/warnings reported by checkpatch. Fix all of the positive once as below: - Use #include instead of - Missing a blank lines after declarations - Prefer 'unsigned int' to bare use of 'unsigned' - else should follow close brace '}' Signed-off-by: Pintu Kumar --- mm/kmemleak.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/mm/kmemleak.c b/mm/kmemleak.c index 0400f5e8ac60..11f92bb7b206 100644 --- a/mm/kmemleak.c +++ b/mm/kmemleak.c @@ -1,7 +1,5 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * mm/kmemleak.c - * * Copyright (C) 2008 ARM Limited * Written by Catalin Marinas * @@ -95,7 +93,7 @@ #include #include -#include +#include #include #include @@ -373,6 +371,7 @@ static void print_unreferenced(struct seq_file *seq, for (i = 0; i < nr_entries; i++) { void *ptr = (void *)entries[i]; + warn_or_seq_printf(seq, " [<%pK>] %pS\n", ptr, ptr); } } @@ -1711,6 +1710,7 @@ static void kmemleak_scan(void) rcu_read_lock(); for_each_process_thread(g, p) { void *stack = try_get_task_stack(p); + if (stack) { scan_block(stack, stack + THREAD_SIZE, NULL); put_task_stack(p); @@ -1817,6 +1817,7 @@ static int kmemleak_scan_thread(void *arg) */ if (first_run) { signed long timeout = msecs_to_jiffies(SECS_FIRST_SCAN * 1000); + first_run = 0; while (timeout && !kthread_should_stop()) timeout = schedule_timeout_interruptible(timeout); @@ -2062,7 +2063,7 @@ static ssize_t kmemleak_write(struct file *file, const char __user *user_buf, else if (strncmp(buf, "scan=off", 8) == 0) stop_scan_thread(); else if (strncmp(buf, "scan=", 5) == 0) { - unsigned secs; + unsigned int secs; unsigned long msecs; ret = kstrtouint(buf + 5, 0, &secs); @@ -2179,8 +2180,7 @@ static int __init kmemleak_boot_config(char *str) else if (strcmp(str, "on") == 0) { kmemleak_skip_disable = 1; stack_depot_request_early_init(); - } - else + } else return -EINVAL; return 0; }