Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1750846AbVKWOnH (ORCPT ); Wed, 23 Nov 2005 09:43:07 -0500 Received: (majordomo@vger.kernel.org) by vger.kernel.org id S1750849AbVKWOnH (ORCPT ); Wed, 23 Nov 2005 09:43:07 -0500 Received: from clock-tower.bc.nu ([81.2.110.250]:26544 "EHLO lxorguk.ukuu.org.uk") by vger.kernel.org with ESMTP id S1750847AbVKWOnG (ORCPT ); Wed, 23 Nov 2005 09:43:06 -0500 Subject: Re: Use enum to declare errno values From: Alan Cox To: Denis Vlasenko Cc: moreau francis , linux-kernel@vger.kernel.org In-Reply-To: <200511231631.12365.vda@ilport.com.ua> References: <20051123132443.32793.qmail@web25813.mail.ukl.yahoo.com> <200511231631.12365.vda@ilport.com.ua> Content-Type: text/plain Content-Transfer-Encoding: 7bit Date: Wed, 23 Nov 2005 15:15:10 +0000 Message-Id: <1132758910.7268.32.camel@localhost.localdomain> Mime-Version: 1.0 X-Mailer: Evolution 2.2.3 (2.2.3-2.fc4) Sender: linux-kernel-owner@vger.kernel.org X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 681 Lines: 16 On Mer, 2005-11-23 at 16:31 +0200, Denis Vlasenko wrote: > Enums are really nice substitute for integer constants instead of #defines. > Enums obey scope rules, #defines do not. > > However enums are not widely used because of > 1. tradition and style > 2. awkward syntax required: enum { ABC = 123 }; The SATA layer uses enum for constants and while it was a bit of change in style when I met it, it does seem to work just as well - 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/