Received: by 2002:a05:6a10:2726:0:0:0:0 with SMTP id ib38csp1103772pxb; Wed, 6 Apr 2022 08:49:01 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwQc/bxPDm5qI2VlDejpQRy3g4Gu+CnPZl1FV730JsQIJxLF1/RrvCVEOAsYSaKglwY8Gdv X-Received: by 2002:a17:90a:fc91:b0:1ca:ad65:fa98 with SMTP id ci17-20020a17090afc9100b001caad65fa98mr10854446pjb.232.1649260141550; Wed, 06 Apr 2022 08:49:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1649260141; cv=none; d=google.com; s=arc-20160816; b=lvgT4FpY68Jq58uA7De1x1dacCXUh9mrfVwAVDdhZLuVXLl1qNlsXAZEtz/UVXP/UF t2oTot06SaM5JKFChuYSu23EeDx0NckRCcnM8WO+2acwDRDkP+JImXXwsMQTgJPS06kt vhRWRL7mtEdwN5mzQnENccj7k1nV0iwXMPLc5DHFpKBWaudaeS/zHy+XAQwiC5x+cy3h pOvc4Og3kTLQgDhrt4xvAWcMx+MsUolBDZw2qh0MOhqaIJsfyhKPX/zEmStiv5N7sflh pmb+z9VFUaMVXDg71Ds0rny0YjoXud+zXH73HDnXKC5Okl1pJVOQoRkkw2dbvOnaz0nX bIZg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id; bh=DZ+POTcsaLkbMBo1CqBhzn/vBLLAxpoEW4QABrQlisQ=; b=U3+fdZFHkZ0j7iUyeiPtDsESWwh4BAkvJnVSkGjkZZbL4g3J9ONEbd6scyKg4/nxtq LC4MPn9o/Wc1olbNNoqHQRk20se9LFuZXp/s1xLfB7KGix9bxr6mIdddv5SkDeL7E/kD K7bAmMdFoqVinTQuejL7YiEblxXfNRiNFmmwZd6e3+DAhrcAO23k/LgBnl91sEXGR6HE WSJsnlWCFYnm68QxaYOVLKiECyHFowBT6qX2rc7qQTkre/8k+e9F1jMJNRVJT9iEeV6H ZErHJww9XuilJJVU4SWhGruyULs8ipVOXcAv9di3pkBZHSDcs1sE0hIQbjQBFplN/3hF 0ygw== ARC-Authentication-Results: i=1; mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id i6-20020a631306000000b003816043f005si16731198pgl.506.2022.04.06.08.49.00 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 06 Apr 2022 08:49:01 -0700 (PDT) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id AA54C3024C0; Wed, 6 Apr 2022 07:07:56 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234448AbiDFOJi (ORCPT + 99 others); Wed, 6 Apr 2022 10:09:38 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53966 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235051AbiDFOIk (ORCPT ); Wed, 6 Apr 2022 10:08:40 -0400 Received: from mail-ed1-f52.google.com (mail-ed1-f52.google.com [209.85.208.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E09429D25F for ; Wed, 6 Apr 2022 02:57:15 -0700 (PDT) Received: by mail-ed1-f52.google.com with SMTP id g22so1978680edz.2 for ; Wed, 06 Apr 2022 02:57:15 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:message-id:date:mime-version:user-agent:subject :content-language:to:cc:references:from:in-reply-to :content-transfer-encoding; bh=DZ+POTcsaLkbMBo1CqBhzn/vBLLAxpoEW4QABrQlisQ=; b=CRTnuQGhMYTEe3X2W6mPLm/rYVRez1DDjvF3norRcXMqm0kR5DF1fyXugZDH4Q/ZJE HO7KjSES2fw061YnAiRTCHNmJ4y/X1chnVfNxCcayYvzRwwb+p+IrPP8bWSw/jLv/yq2 TVmmeEJdH4eXZ7jEYQKx2DkZ7DTDzEdfHxuIdg9YH6uCAwSj9C7aDvAZC1ZZMKTFxpzZ hvt7SJCf7wKlI7F/F9P+azTvbK+wW7IrxGt2U72CYVgcMq3tX9/p4W5wy1moNYAs9kus 92b/rRLNCQTDA4HtNwRR4Kc++OCHMfLWLwg7iP48HYfG7m3iKRVSQAJJ4AOXm9JuZx78 uTtw== X-Gm-Message-State: AOAM533EP3b/8QgkVsoivskviLxtkoai8Ck9rfiG/mt4PFo1H5fKvxbB 5l+WbSFb+YiSF+WkN0wBVHFxNT4R+HU= X-Received: by 2002:a05:6402:31e2:b0:41c:dd5e:3c61 with SMTP id dy2-20020a05640231e200b0041cdd5e3c61mr7797701edb.407.1649239033620; Wed, 06 Apr 2022 02:57:13 -0700 (PDT) Received: from ?IPV6:2a0b:e7c0:0:107::70f? ([2a0b:e7c0:0:107::70f]) by smtp.gmail.com with ESMTPSA id j12-20020a50e0cc000000b0041cd813ac01sm3691091edl.28.2022.04.06.02.57.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 06 Apr 2022 02:57:13 -0700 (PDT) Message-ID: <19e11d77-1f81-c5a8-8a72-4fb7616438bf@kernel.org> Date: Wed, 6 Apr 2022 11:57:12 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.7.0 Subject: Re: [PATCH v1] tty/sysrq: change the definition of sysrq_key_table's element to make it more readable Content-Language: en-US To: wujunwen , gregkh@linuxfoundation.org Cc: linux-kernel@vger.kernel.org References: <20220405153625.55689-1-wudaemon@163.com> From: Jiri Slaby In-Reply-To: <20220405153625.55689-1-wudaemon@163.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-5.0 required=5.0 tests=BAYES_00,MAILING_LIST_MULTI, NICE_REPLY_A,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=unavailable 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 Hi, On 05. 04. 22, 17:36, wujunwen wrote: > the definition of sysrq_key_table's elements, like sysrq_thaw_op and The starts the sentence, so should be with capital T. > sysrq_showallcpus_op are massive, massive? > so we should make it consistent. You should elaborate consistent to what. > Signed-off-by: wujunwen Is this really your real full name? Other than that, the patch appears to be correct. > 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 */ -- js suse labs