Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1034291AbcJ0XPr (ORCPT ); Thu, 27 Oct 2016 19:15:47 -0400 Received: from mail-vk0-f41.google.com ([209.85.213.41]:34172 "EHLO mail-vk0-f41.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1034145AbcJ0XPp (ORCPT ); Thu, 27 Oct 2016 19:15:45 -0400 MIME-Version: 1.0 In-Reply-To: <1476901693-8492-4-git-send-email-mark.rutland@arm.com> References: <1476901693-8492-1-git-send-email-mark.rutland@arm.com> <1476901693-8492-4-git-send-email-mark.rutland@arm.com> From: Andy Lutomirski Date: Thu, 27 Oct 2016 16:13:49 -0700 Message-ID: Subject: Re: [PATCH 3/3] thread_info: include for THREAD_INFO_IN_TASK To: Mark Rutland Cc: "linux-kernel@vger.kernel.org" , linux-arch , Andrew Morton , Heiko Carstens , "H. Peter Anvin" , Kees Cook , Andrew Lutomirski , Ingo Molnar , Thomas Gleixner Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 912 Lines: 20 On Wed, Oct 19, 2016 at 11:28 AM, Mark Rutland wrote: > When CONFIG_THREAD_INFO_IN_TASK is selected, the current_thread_info() > macro relies on current having been defined prior to its use. However, > not all users of current_thread_info() include , and thus > current is not guaranteed to be defined. > > When CONFIG_THREAD_INFO_IN_TASK is not selected, it's possible that > get_current() / current are based upon current_thread_info(), and > includes . Thus always including > would result in circular dependences on some platforms. > > To ensure both cases work, this patch includes , but only > when CONFIG_THREAD_INFO_IN_TASK is selected. Reviewed-by: Andy Lutomirski although it would be nice if you moved your description of why the include is conditional into a comment. --Andy