From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.3 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER, MAILING_LIST_MULTI,NICE_REPLY_A,SPF_HELO_NONE,SPF_PASS,USER_AGENT_SANE_1 autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EE6ECC433B4 for ; Thu, 8 Apr 2021 12:45:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C003F6115B for ; Thu, 8 Apr 2021 12:45:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231293AbhDHMp1 (ORCPT ); Thu, 8 Apr 2021 08:45:27 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57102 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229751AbhDHMp1 (ORCPT ); Thu, 8 Apr 2021 08:45:27 -0400 Received: from mail-ej1-x62a.google.com (mail-ej1-x62a.google.com [IPv6:2a00:1450:4864:20::62a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 02C17C061761 for ; Thu, 8 Apr 2021 05:45:15 -0700 (PDT) Received: by mail-ej1-x62a.google.com with SMTP id u21so2764110ejo.13 for ; Thu, 08 Apr 2021 05:45:15 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=rasmusvillemoes.dk; s=google; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=UMuAklHy/tPt7YPBozpvIQsmWDAIa3a/la6+zoUVcdI=; b=JXlbvdv6BKxL2QLt+A6EZMYCjKur7zKVGHA+SPjjhttU3LjU5J8CTsvMPL70CwGYsq CUXz1jkKLkBNcttlxCmAirFDD+kjBSkQXhxTFfLF/zDE+suTqi1E02kHIf/SGivtkXXC r7MEDlKMlo41vpb3rOrLkq/HnnmBY745AuXsE= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=UMuAklHy/tPt7YPBozpvIQsmWDAIa3a/la6+zoUVcdI=; b=pr/8myGJxK2nJpHICY2WjvhAOjIa4NxuaBkDYC69ZFlXUIvUp6kHv27PpaLWTl6uz7 4yAQLJYSgB/q9TEfgQcrZYO9t27IUwjN/4pZIq5vpLNjCswNpG98kboRsGfo9lIBm6WT pkeDh3dsuzgoJfIgJW1YgSiL2ThglFr1jKqxf8NznqrNlLRgA2hMqZZ9KyUwHwLECmFk a0jjRq4fF9VQDmQI0ggJWXjqoSBN03JSmX/4bRAP395RvwB5qJfCuVr4utt9M+uajwIv OKRsQa9A9C5UY/YpbUXsE2gSf3wg93KppA4G9sT6zK08cQo7ii5H+NYXIqQQGhZTfsTc +JdA== X-Gm-Message-State: AOAM5325SZ5u2bn9jmYQkc5uSwxyxYH42vdRtmLHm/vGWE4bsPuZY6QF jrVDNWD88mxmzHdv5Wo1g5GIeg== X-Google-Smtp-Source: ABdhPJwq7QZNDA3D6CGhNZXcz6mj8YzK/fNHfbq7NkBvOdUqzkgcZZF3Ehka2wUefbZcZbtsp6oq8w== X-Received: by 2002:a17:906:1fd7:: with SMTP id e23mr400958ejt.528.1617885914623; Thu, 08 Apr 2021 05:45:14 -0700 (PDT) Received: from [192.168.1.149] ([80.208.71.248]) by smtp.gmail.com with ESMTPSA id r4sm14262813ejd.125.2021.04.08.05.45.12 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 08 Apr 2021 05:45:14 -0700 (PDT) Subject: Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers To: Andy Shevchenko , Michael Ellerman , Joerg Roedel , Wei Liu , Michael Kelley , Mike Rapoport , Corey Minyard , Bjorn Andersson , Mathieu Poirier , Andrew Morton , Tetsuo Handa , Vlastimil Babka , "Paul E. McKenney" , "Steven Rostedt (VMware)" , linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org, linux-hyperv@vger.kernel.org, openipmi-developer@lists.sourceforge.net, linux-remoteproc@vger.kernel.org, linux-arch@vger.kernel.org, kexec@lists.infradead.org, rcu@vger.kernel.org, linux-fsdevel@vger.kernel.org Cc: Benjamin Herrenschmidt , Paul Mackerras , Thomas Gleixner , Ingo Molnar , Borislav Petkov , x86@kernel.org, "H. Peter Anvin" , "K. Y. Srinivasan" , Haiyang Zhang , Stephen Hemminger , Corey Minyard , Ohad Ben-Cohen , Arnd Bergmann , Eric Biederman , Josh Triplett , Mathieu Desnoyers , Lai Jiangshan , Joel Fernandes , Luis Chamberlain , Kees Cook , Iurii Zaikin References: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com> From: Rasmus Villemoes Message-ID: <03be4ed9-8e8d-e2c2-611d-ac09c61d84f9@rasmusvillemoes.dk> Date: Thu, 8 Apr 2021 14:45:12 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.7.1 MIME-Version: 1.0 In-Reply-To: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com> Content-Type: text/plain; charset=windows-1252 Content-Language: en-US Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-remoteproc@vger.kernel.org On 06/04/2021 15.31, Andy Shevchenko wrote: > kernel.h is being used as a dump for all kinds of stuff for a long time. > Here is the attempt to start cleaning it up by splitting out panic and > oops helpers. Yay. Acked-by: Rasmus Villemoes > At the same time convert users in header and lib folder to use new header. > Though for time being include new header back to kernel.h to avoid twisted > indirected includes for existing users. I think it would be good to have some place to note that "This #include is just for backwards compatibility, it will go away RealSoonNow, so if you rely on something from linux/panic.h, include that explicitly yourself TYVM. And if you're looking for a janitorial task, write a script to check that every file that uses some identifier defined in panic.h actually includes that file. When all offenders are found and dealt with, remove the #include and this note.". > + > +struct taint_flag { > + char c_true; /* character printed when tainted */ > + char c_false; /* character printed when not tainted */ > + bool module; /* also show as a per-module taint flag */ > +}; > + > +extern const struct taint_flag taint_flags[TAINT_FLAGS_COUNT]; While you're doing this, nothing outside of kernel/panic.c cares about the definition of struct taint_flag or use the taint_flags array, so could you make the definition private to that file and make the array static? (Another patch, of course.) > +enum lockdep_ok { > + LOCKDEP_STILL_OK, > + LOCKDEP_NOW_UNRELIABLE, > +}; > + > +extern const char *print_tainted(void); > +extern void add_taint(unsigned flag, enum lockdep_ok); > +extern int test_taint(unsigned flag); > +extern unsigned long get_taint(void); I know you're just moving code, but it would be a nice opportunity to drop the redundant externs. Rasmus