From patchwork Sun Mar 12 16:46:45 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Tom Rix X-Patchwork-Id: 68393 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:5915:0:0:0:0:0 with SMTP id v21csp795896wrd; Sun, 12 Mar 2023 09:54:14 -0700 (PDT) X-Google-Smtp-Source: AK7set8Es8OC0vLaU87s+KsjKcmks2VZ39A0Pze7LUgvv/qTaQ2BJavY7uqkQL1FNRKEeOhs9ywr X-Received: by 2002:a17:903:2611:b0:1a0:4859:19ea with SMTP id jd17-20020a170903261100b001a0485919eamr768669plb.39.1678640053858; Sun, 12 Mar 2023 09:54:13 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1678640053; cv=none; d=google.com; s=arc-20160816; b=Ekjq9PXRawbD2voJ4fzv4wEcgUO6UDrwQ8gaJw5kscFhMcClYjl7Y/tC3widOGlAjC h5aAYJOfruH/aMmNpKep8zMZpZb0C4lXQni0zyiP/hHyg+YsNjr/FBXNJO6Dr3G7kgii 0PX4uMqMCXAkxEn/Y+tVuybHjn1PnaYXzjievkiLnP9gU7t2cyHQYbUDtnXJU2Vi5mbR MXUaJXU4EyU+JzAKNXQcGF4hTQq/5P1SdKmMpz9Ln6alBgXdQsgDkAuyb/WgvjMG6jWA 9djVcNzoYbrDP70tlbbty6v/GCcWPFTlYwEFzbpYVX00LUrxT/KSTE1qNIowhSkHGfjx 93sw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=aq3TEq6gMO/54SF3iFz3GDnLmsdqOfZlgKAyUVosWkE=; b=Z+2492sK00E7++I3pmMDnqRH9uWIXPFEh+jeHvi0IPlBCAbz5jNYb+s31GFlvc75SV BFWobNaWY6IhrKlgmIU0wHfXVQ5adBd4pGEmy/UUkEXBwcyZJlhcpHe7QbXQD1cHdM2V VbZDT8Rr0bkyCByfGivG82391wlRROhhQoa62c0NQzKz85b9lN+sjegH8l2nm+n0H4qy YaVjQTyPXWPqEnK6j1u/Pr0Mv9xKZxWMP+EmjbuOXOkXqg1c1tY9XdhkxmeSDsTIvPfk cnFzky01jYkehJkD8hsw6SayLcVVEszw80SvHahxd/QIa2ZrrjOUC1ODGwEQYUleDpq5 OBfw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B4vD4I0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id kq8-20020a170903284800b0019cd14bee15si4667485plb.226.2023.03.12.09.53.59; Sun, 12 Mar 2023 09:54:13 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@redhat.com header.s=mimecast20190719 header.b=B4vD4I0t; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231145AbjCLQrn (ORCPT + 99 others); Sun, 12 Mar 2023 12:47:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229561AbjCLQrm (ORCPT ); Sun, 12 Mar 2023 12:47:42 -0400 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 021813E08E for ; Sun, 12 Mar 2023 09:47:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1678639621; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=aq3TEq6gMO/54SF3iFz3GDnLmsdqOfZlgKAyUVosWkE=; b=B4vD4I0tGKhNvvrgmQo9fs10GjTI/L5/nxbuXLVEO4m/U6fHTNjJMH+sZlXZRx3/nyepJ2 C7wUujh5P784pN0tef3XMNHqkuaSggET2CT0SMNyT65K79PkY4cDhe+pNLt9ORTpAgXoO5 RgglVhm4Y7o87V300PaRTS2CmL9hG6w= Received: from mail-qt1-f198.google.com (mail-qt1-f198.google.com [209.85.160.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.3, cipher=TLS_AES_256_GCM_SHA384) id us-mta-342-cLM3dsyJNWOEtsuUZdb2Ug-1; Sun, 12 Mar 2023 12:46:54 -0400 X-MC-Unique: cLM3dsyJNWOEtsuUZdb2Ug-1 Received: by mail-qt1-f198.google.com with SMTP id k13-20020ac8074d000000b003bfd04a3cbcso5695857qth.16 for ; Sun, 12 Mar 2023 09:46:54 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1678639613; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=aq3TEq6gMO/54SF3iFz3GDnLmsdqOfZlgKAyUVosWkE=; b=Ogac5XfWqrHdbCWxRAJsnlXnX1CZuf27dvvpd/jYI5uTntKe0r+5UQp6cxoc7qsGc1 akqiZwdtk/aB/D3z3iOWiCO9NG/RUBUFH0Vxzbus7aldTMWSQ4lLtBCMghzKbfNAebeD lgoFlZsVaXwR+u/hwGpNM48IlaA82mjxJKdEpGGuIDAUrMdjLGHNdJhTf8Ju4oLJuqnJ Lv+SmW19Hygx5TpeYRBHpYC/8PUVyzuFJ7R4I+NfICFknynKcFrA0NWxc739JiDis1dw ZfDJcV3V83mgsBjZEJ1nfnk0gxs6rfiw8zdgDmd4eHHnnC+2gk38UsnuTRqQI45b3/Jy +bpg== X-Gm-Message-State: AO0yUKV0C7Iegq+993D0syMXCYlrn/BH8S9FMRO3k7HUd5MoVa9O/IJI wZuLET/79pTggW7lXNCy5H+SjAryJCN6wP3ranNiFWkJIPxGnMIxCXDQuswQ8GTz81UGlFS/bRT LL8LR5IOKEtO/tENvVLcZY0lm X-Received: by 2002:ac8:7c4f:0:b0:3bf:d974:8ad5 with SMTP id o15-20020ac87c4f000000b003bfd9748ad5mr20090974qtv.61.1678639613537; Sun, 12 Mar 2023 09:46:53 -0700 (PDT) X-Received: by 2002:ac8:7c4f:0:b0:3bf:d974:8ad5 with SMTP id o15-20020ac87c4f000000b003bfd9748ad5mr20090956qtv.61.1678639613309; Sun, 12 Mar 2023 09:46:53 -0700 (PDT) Received: from dell-per740-01.7a2m.lab.eng.bos.redhat.com (nat-pool-bos-t.redhat.com. [66.187.233.206]) by smtp.gmail.com with ESMTPSA id m15-20020a05620a13af00b0073917fae4f8sm3751948qki.25.2023.03.12.09.46.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 12 Mar 2023 09:46:53 -0700 (PDT) From: Tom Rix To: pmladek@suse.com, akpm@linux-foundation.org, peterz@infradead.org, rafael.j.wysocki@intel.com, john.ogness@linutronix.de, linux@rasmusvillemoes.dk, ben.dooks@sifive.com, fuyuanli@didiglobal.com Cc: linux-kernel@vger.kernel.org, Tom Rix Subject: [PATCH] kernel/hung_task.c: set some hung_task.c variables storage-class-specifier to static Date: Sun, 12 Mar 2023 12:46:45 -0400 Message-Id: <20230312164645.471259-1-trix@redhat.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_NONE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1760181673236340340?= X-GMAIL-MSGID: =?utf-8?q?1760181673236340340?= smatch reports several warnings kernel/hung_task.c:31:19: warning: symbol 'sysctl_hung_task_check_count' was not declared. Should it be static? kernel/hung_task.c:50:29: warning: symbol 'sysctl_hung_task_check_interval_secs' was not declared. Should it be static? kernel/hung_task.c:52:19: warning: symbol 'sysctl_hung_task_warnings' was not declared. Should it be static? kernel/hung_task.c:75:28: warning: symbol 'sysctl_hung_task_panic' was not declared. Should it be static? These variables are only used in hung_task.c, so they should be static Signed-off-by: Tom Rix --- kernel/hung_task.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/kernel/hung_task.c b/kernel/hung_task.c index 322813366c6c..9a24574988d2 100644 --- a/kernel/hung_task.c +++ b/kernel/hung_task.c @@ -28,7 +28,7 @@ /* * The number of tasks checked: */ -int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; +static int __read_mostly sysctl_hung_task_check_count = PID_MAX_LIMIT; /* * Limit number of tasks checked in a batch. @@ -47,9 +47,9 @@ unsigned long __read_mostly sysctl_hung_task_timeout_secs = CONFIG_DEFAULT_HUNG_ /* * Zero (default value) means use sysctl_hung_task_timeout_secs: */ -unsigned long __read_mostly sysctl_hung_task_check_interval_secs; +static unsigned long __read_mostly sysctl_hung_task_check_interval_secs; -int __read_mostly sysctl_hung_task_warnings = 10; +static int __read_mostly sysctl_hung_task_warnings = 10; static int __read_mostly did_panic; static bool hung_task_show_lock; @@ -72,8 +72,8 @@ static unsigned int __read_mostly sysctl_hung_task_all_cpu_backtrace; * Should we panic (and reboot, if panic_timeout= is set) when a * hung task is detected: */ -unsigned int __read_mostly sysctl_hung_task_panic = - IS_ENABLED(CONFIG_BOOTPARAM_HUNG_TASK_PANIC); +static unsigned int __read_mostly sysctl_hung_task_panic = + IS_ENABLED(CONFIG_BOOTPARAM_HUNG_TASK_PANIC); static int hung_task_panic(struct notifier_block *this, unsigned long event, void *ptr)