From mboxrd@z Thu Jan 1 00:00:00 1970 From: Pete Zaitcev Subject: Re: [RFCv2] cld: replace "if (verbose) { act_log }" with CLD_DEBUG Date: Sun, 6 Dec 2009 17:23:04 -0700 Message-ID: <20091206172304.30cb0361@redhat.com> References: <1260114065-14473-1-git-send-email-cmccabe@alumni.cmu.edu> Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1260114065-14473-1-git-send-email-cmccabe@alumni.cmu.edu> Sender: hail-devel-owner@vger.kernel.org List-ID: Content-Type: text/plain; charset="us-ascii" To: Colin McCabe Cc: Project Hail List , Jeff Garzik , Colin McCabe On Sun, 6 Dec 2009 07:41:05 -0800 Colin McCabe wrote: > Move prototypes for common.c functions out of cld_msg.h and into a new header > file, common.h. Create a structure that represents the current log level and > also the function to use for logging. > static int sess_send_pkt(struct cldc_session *sess, > const struct cld_packet *pkt, size_t pkt_len) > { > - if (sess->verbose) { > + if (sess->log.verbose) { > uint32_t flags = le32_to_cpu(pkt->flags); > bool first = (flags & CPF_FIRST); > bool last = (flags & CPF_LAST); I'm wondering if we can drop these ifs now, at the cost of some small inefficiency. -- Pete