Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp963365pxb; Wed, 6 Apr 2022 05:27:25 -0700 (PDT) X-Google-Smtp-Source: ABdhPJypwt1baGVDUm0qDfE3RIC9jzJeNFprx0H7VnWZjpqtZ1nZnsJBnX1GyiqMFmJNo1ZicpJ9 X-Received: by 2002:aa7:8490:0:b0:4fa:a623:b036 with SMTP id u16-20020aa78490000000b004faa623b036mr8784859pfn.64.1649248045298; Wed, 06 Apr 2022 05:27:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649248045; cv=none; d=google.com; s=arc-20160816; b=IYzmr1HOjUTTdvILFur7fvMJfwHYSmJm7JrnFMWJpNIN2JA/2XkVVjTqnfUd1Jbo9+ ZA9hu7fVAdNchXGqc8iEx9RBfl5Zi0oM7WlbV8J9k4Lxn4VWMqvpghoxcR7UepFAiHpF bsrnMxRumpqbu3KW2VFGGBsxAGSHbAwDmwaQfzPBM80YHstpDo6XJzxzTt7AAKNMI369 ELpEuTnpgBJgDwah0FOul+r8HNXeFWg3M75MH6f1CfI9bwDoT+qWNxwE00qg4bUrlxfI 3OaPjF1gO6eFtXcOepCi2feDpbgWFkIkaIfbT9Pxn1Vgsplp8mTThrFanjaMiwyJSpot Vdyg== 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=9ZptnJ9HIkGLxORVjLEavHV+h6BLMZSlJ7O+XMPB3t8=; b=1Dr4xP9KvsKQ15Z2eoIcsv36lOushVCN434wd5PPgUO1OHT4pWsA6emhou+8SD/NMw GgY90PparThI/1flBDBvU734ZB7GHQE7W7JZcL38lLkBjqrJYdescTtxsKydYl+Ncywv o+E3r+w0uhnQmVyrJXFFaPtOxDzqNVGN+U+opRr07Q3EJCxi8evfPBI5eIznIckddq+L 55CVHlCo0eFkg19IUV5lU36pIWmiKYhTe2eJj05W1qEREub10JRlR74doIPj7lb0NGgr jeEFEtm8y4yOyHwWKVQdokzaE97EM9ljP25RmnGiA8PKiGZ1WLOD1T8tGGVuHD2SzJFR M7bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=X6drxuX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id w129-20020a626287000000b004fa3a8e008asi14230518pfb.321.2022.04.06.05.27.24 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 05:27:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=X6drxuX2; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 6E117577A44; Wed, 6 Apr 2022 04:37:54 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1450933AbiDEW3U (ORCPT + 99 others); Tue, 5 Apr 2022 18:29:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37236 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1457298AbiDEQDE (ORCPT ); Tue, 5 Apr 2022 12:03:04 -0400 Received: from m12-12.163.com (m12-12.163.com [220.181.12.12]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 569CC2408C for ; Tue, 5 Apr 2022 08:37:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id:MIME-Version; bh=9Zptn J9HIkGLxORVjLEavHV+h6BLMZSlJ7O+XMPB3t8=; b=X6drxuX2boPSFAhIJ5UNM Soerm0MLgm/omF7hN5zkwwebGTrhXgI3EOsDa/DuLd2K25twH+dofSxFzNrzOB4W Gx1YADMRCXJdbYqgE62AHwvlgD8vseqt5EWYdoynkeLJDhNmZdidl2aytgihBpQo /qoY9srWSMq5jGMwKciuGo= Received: from localhost (unknown [113.116.48.218]) by smtp8 (Coremail) with SMTP id DMCowAAnVX4BYkxikcMtAg--.50405S2; Tue, 05 Apr 2022 23:36:34 +0800 (CST) From: wujunwen To: gregkh@linuxfoundation.org, jirislaby@kernel.org Cc: linux-kernel@vger.kernel.org, wujunwen Subject: [PATCH v1] tty/sysrq: change the definition of sysrq_key_table's element to make it more readable Date: Tue, 5 Apr 2022 15:36:25 +0000 Message-Id: <20220405153625.55689-1-wudaemon@163.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-CM-TRANSID: DMCowAAnVX4BYkxikcMtAg--.50405S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7uFykurWfZw47CFyDuF15Arb_yoW8Ary5pa yxCryqyF15uF4jqw4xCa1jqF4ayr93Ga4a9r15Ga4S93s8Gr18JFWjyaySyryrJrW8GF1j gr40vF15X3W8J37anT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0zNXd1wUUUUU= X-Originating-IP: [113.116.48.218] X-CM-SenderInfo: 5zxgtvxprqqiywtou0bp/1tbiLALZbVspdVcn3gAAsz X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RDNS_NONE, SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 the definition of sysrq_key_table's elements, like sysrq_thaw_op and sysrq_showallcpus_op are massive, so we should make it consistent. Signed-off-by: wujunwen --- drivers/tty/sysrq.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/tty/sysrq.c b/drivers/tty/sysrq.c index bbfd004449b5..9485156bf48b 100644 --- a/drivers/tty/sysrq.c +++ b/drivers/tty/sysrq.c @@ -274,6 +274,8 @@ static const struct sysrq_key_op sysrq_showallcpus_op = { .action_msg = "Show backtrace of all active CPUs", .enable_mask = SYSRQ_ENABLE_DUMP, }; +#else +#define sysrq_showallcpus_op (*(const struct sysrq_key_op *)NULL) #endif static void sysrq_handle_showregs(int key) @@ -405,6 +407,7 @@ static const struct sysrq_key_op sysrq_moom_op = { .enable_mask = SYSRQ_ENABLE_SIGNAL, }; +#ifdef CONFIG_BLOCK static void sysrq_handle_thaw(int key) { emergency_thaw_all(); @@ -415,6 +418,9 @@ static const struct sysrq_key_op sysrq_thaw_op = { .action_msg = "Emergency Thaw of all frozen filesystems", .enable_mask = SYSRQ_ENABLE_SIGNAL, }; +#else +#define sysrq_thaw_op (*(const struct sysrq_key_op *)NULL) +#endif static void sysrq_handle_kill(int key) { @@ -468,17 +474,9 @@ static const struct sysrq_key_op *sysrq_key_table[62] = { NULL, /* g */ NULL, /* h - reserved for help */ &sysrq_kill_op, /* i */ -#ifdef CONFIG_BLOCK &sysrq_thaw_op, /* j */ -#else - NULL, /* j */ -#endif &sysrq_SAK_op, /* k */ -#ifdef CONFIG_SMP &sysrq_showallcpus_op, /* l */ -#else - NULL, /* l */ -#endif &sysrq_showmem_op, /* m */ &sysrq_unrt_op, /* n */ /* o: This will often be registered as 'Off' at init time */ -- 2.25.1