Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp448544pxf; Thu, 8 Apr 2021 06:30:35 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxHeB/UkZesVCbOZCetyF7/urzttMKAJvaZtE98e+d0CFeAqK+z+yCSQxCNxKE76/CAVysz X-Received: by 2002:a17:90a:9385:: with SMTP id q5mr8419320pjo.121.1617888634870; Thu, 08 Apr 2021 06:30:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617888634; cv=none; d=google.com; s=arc-20160816; b=yARDEUccPAtxbGjwnEEt1uiISfRLlN8jX6Qfu3MokSemaFqMiqueeTuVe3fJixOMAm iSdCmxnXJ8RABMRsJYUC/U5rUwyh7+qkV5zqhFsrLVql8uuyuVt9i2xTWNC4ofZ6rnSP Omh7ut5hKq5eHGy2ByM7MESL8MgpbuZspYex6X8rV6BG9krB4//XNpB1xJrWzbL8toI7 r2mt3IpoHRuvANh6Yv7z4U4lxZ9CYqHC9pjkdrxFQ/SHPQo5R0ZKLUoL8wJmvSHXekmI /D/IJRRGhWV91Nio8bCMNH7KaJo5mVis5vI9pM/j/eFqZMiMNA/Nw7FdxMW238+57Cf/ Ioow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:organization:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :ironport-sdr:ironport-sdr; bh=D0u5q9KEk9gZ0yLyjAyUK/pAisae9eW2wxvr7rvkr68=; b=qE7NvB845uQiOTZfGW9Llzbh7qWVcwtxwKBYw1DAvQKk9sw31PleK0G843K9jvk+BX TkZcCUhQ0QvFoKK+lvZNClDm+/V9gV8limq2NE6rgBjFgYtMfiq8x8xRs1aWG7FZqsZH P3Bvj/0IF5MX8xQhtC7qCPfYiaz4c7OhfS5dNTmQQYhp7q5MCee0du1xgzsXEu3jxJBQ XH5LotZoF4s7m/p7bXlNCv/0OAf2MC9eOGsIYHEOmGmRUSXBM/I6ygHPiLY62o92MtPV /amqJYnPxuPa/z/9YFjsNR1Ogkxyi2y2MxRMh7CARmBVeiK/A8AoGHlCz1y3Y8/dY+oW p/lg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id ot14si4957274pjb.55.2021.04.08.06.30.21; Thu, 08 Apr 2021 06:30:34 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231534AbhDHN3f (ORCPT + 99 others); Thu, 8 Apr 2021 09:29:35 -0400 Received: from mga03.intel.com ([134.134.136.65]:48288 "EHLO mga03.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229803AbhDHN3e (ORCPT ); Thu, 8 Apr 2021 09:29:34 -0400 IronPort-SDR: QUpz64eg2gnFCpzxDWzU/AwdrbTUJxrBXgfjbrrtWatHMBwK5ASN5glArcmYGrKckRBAVv66VO L60nOvGTEpHA== X-IronPort-AV: E=McAfee;i="6000,8403,9948"; a="193579533" X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="193579533" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 06:29:22 -0700 IronPort-SDR: D3QHX5UVSB8YX34MZLNYlLK0kPKdVmkIBWjKvFADTZAC3rD9R9M8THaBbj3tnr/+TF6aChcI+z hErj278onk1A== X-IronPort-AV: E=Sophos;i="5.82,206,1613462400"; d="scan'208";a="419147368" Received: from smile.fi.intel.com (HELO smile) ([10.237.68.40]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 08 Apr 2021 06:29:13 -0700 Received: from andy by smile with local (Exim 4.94) (envelope-from ) id 1lUUia-002IVr-4H; Thu, 08 Apr 2021 16:29:08 +0300 Date: Thu, 8 Apr 2021 16:29:08 +0300 From: Andy Shevchenko To: Rasmus Villemoes Cc: 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, 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 Subject: Re: [PATCH v1 1/1] kernel.h: Split out panic and oops helpers Message-ID: References: <20210406133158.73700-1-andriy.shevchenko@linux.intel.com> <03be4ed9-8e8d-e2c2-611d-ac09c61d84f9@rasmusvillemoes.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <03be4ed9-8e8d-e2c2-611d-ac09c61d84f9@rasmusvillemoes.dk> Organization: Intel Finland Oy - BIC 0357606-4 - Westendinkatu 7, 02160 Espoo Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Apr 08, 2021 at 02:45:12PM +0200, Rasmus Villemoes wrote: > 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 Thanks! > > 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.". Good and... > > +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.) ...according to the above if *you are looking for a janitorial task*... :-)) > > +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. As above. But for all these I have heard you. So, I'll keep this response as part of my always only growing TODO list. -- With Best Regards, Andy Shevchenko