Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755811AbaAGKJS (ORCPT ); Tue, 7 Jan 2014 05:09:18 -0500 Received: from cantor2.suse.de ([195.135.220.15]:55013 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751395AbaAGKJP (ORCPT ); Tue, 7 Jan 2014 05:09:15 -0500 Message-ID: <52CBD247.8080508@suse.cz> Date: Tue, 07 Jan 2014 11:09:11 +0100 From: Michal Marek User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.2.0 MIME-Version: 1.0 To: Geert Uytterhoeven CC: Sam Ravnborg , Josh Triplett , linux-kbuild , "linux-kernel@vger.kernel.org" , Linus Torvalds , Andrew Morton , Greg Kroah-Hartman , Rashika Kheria Subject: Re: #pragma once? References: <20140106204706.GA16924@leaf> <20140107055532.GA16581@ravnborg.org> In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2014-01-07 10:48, Geert Uytterhoeven wrote: > Furthermore some userspace may rely on doing #define XXX to avoid > including a specific kernel header (yes, it's ugly). This pattern is also sometimes used: $ head -6 include/linux/spinlock_up.h #ifndef __LINUX_SPINLOCK_UP_H #define __LINUX_SPINLOCK_UP_H #ifndef __LINUX_SPINLOCK_H # error "please don't include this file directly" #endif And there is nothing ugly about it. So #pragma once is probably a good idea for most headers that are not exposed to userspace. But making it a requirement in scripts/checkpatch.pl or Documentation/CodingStyle means that it will become hard to defend the few legitimate uses of ifndef guards against people who have a printed copy of checkpatch.pl under their pillow. Michal -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/