Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933331AbaJ3LDC (ORCPT ); Thu, 30 Oct 2014 07:03:02 -0400 Received: from mail-yh0-f52.google.com ([209.85.213.52]:52853 "EHLO mail-yh0-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1758162AbaJ3LDA (ORCPT ); Thu, 30 Oct 2014 07:03:00 -0400 MIME-Version: 1.0 X-Originating-IP: [84.208.172.182] In-Reply-To: <3546486.lOZcZMmXYe@wuerfel> References: <1414620056-6675-1-git-send-email-gregkh@linuxfoundation.org> <1414620056-6675-3-git-send-email-gregkh@linuxfoundation.org> <3546486.lOZcZMmXYe@wuerfel> From: Tom Gundersen Date: Thu, 30 Oct 2014 12:02:39 +0100 Message-ID: Subject: Re: kdbus: add header file To: Arnd Bergmann Cc: Greg Kroah-Hartman , Linux API , LKML , John Stultz , Tejun Heo , Marcel Holtmann , Ryan Lortie , Bastien Nocera , David Herrmann , Djalal Harouni , Simon McVittie , Daniel Mack , "alban.crequy" , "javier.martinez" Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 30, 2014 at 9:20 AM, Arnd Bergmann wrote: > I think in general, using enum is great, but for ioctl command numbers, > we probably want to have defines so the user space implementation can > use #ifdef to see if the kernel version that it is being built for > knows a particular command. Does that make sense for the first version? I agree that we should use #define to allow #ifdef for when we add more ioctls in the future, but these ioctls will always exist... The nice thing about enums is of course that it helps with debugging as gdb can show the string representation rather than the number, because in contrast to #defines, an enum is something the compliler knows about. Cheers, Tom -- 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/