From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tejun Heo Subject: Re: [PATCH 1/9] libata: change debugging macros/adjust dbg levels Date: Fri, 30 Jun 2006 06:22:09 +0900 Message-ID: <44A44481.10001@gmail.com> References: <20060629160926.GB23122@zmei.tnic> <44A3FF72.8090404@gmail.com> <20060629172715.GA21339@gollum.tnic> <44A4174C.7020109@gmail.com> <20060629205315.GA27955@gollum.tnic> <44A443FE.9090607@gmail.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Return-path: Received: from wr-out-0506.google.com ([64.233.184.226]:31108 "EHLO wr-out-0506.google.com") by vger.kernel.org with ESMTP id S932695AbWF2VVq (ORCPT ); Thu, 29 Jun 2006 17:21:46 -0400 Received: by wr-out-0506.google.com with SMTP id 71so156192wri for ; Thu, 29 Jun 2006 14:21:45 -0700 (PDT) In-Reply-To: <44A443FE.9090607@gmail.com> Sender: linux-ide-owner@vger.kernel.org List-Id: linux-ide@vger.kernel.org To: Borislav Petkov Cc: linux-ide , Jeff Garzik Tejun Heo wrote: > Borislav Petkov wrote: >> On Fri, Jun 30, 2006 at 03:09:16AM +0900, Tejun Heo wrote: >>> Please make >>> >>> + ATA_MSG_ERR = 0, >>> + ATA_MSG_WARN = 1, >>> + ATA_MSG_DRV = 2, >>> + ATA_MSG_INFO = 3, /* revalidation messages, EH progress */ >>> + ATA_MSG_VDEBUG = 4, /* verbose hot path */ >>> + ATA_MSG_CMD = 5, /* issue / completion */ >>> + ATA_MSG_SG = 6, /* SG map/unmap handling */ >>> + ATA_MSG_TRACE = 7, /* function tracing, e.g. enter/exit */ >>> >>> And test for msg_enable & (1 << (lv)). Otherwise the array will be >>> unnecessarily large. >> Yeah, but this won't work: >> imagine default level is: >> msg_enable = ATA_MSG_INFO; > > You can do "msg_enable |= (1 << ATA_MSG_INFO)" or keep ATA_MSG_*'s as > bit masks and use fls() to index into level array. Just make sure that > the level array isn't 512 entries long. > Oh, one more thing, in libata, when specifying bit mask, we use ATA_MSG_WARN = (1 << 1), instead of ATA_MSG_ERR = 0x02. Just a style thing. :-) -- tejun