linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joe Perches <joe@perches.com>
To: Alexey Dobriyan <adobriyan@sw.ru>
Cc: linux-kernel@vger.kernel.org
Subject: Re: RFC - organize include/linux/kernel.h, add include/linux/logging.h
Date: Fri, 30 Nov 2007 10:04:31 -0800	[thread overview]
Message-ID: <1196445871.22120.178.camel@localhost> (raw)
In-Reply-To: <20071130092842.GA6221@localhost.sw.ru>

On Fri, 2007-11-30 at 12:28 +0300, Alexey Dobriyan wrote:
> > kernel.h has become a bit disorganized over a long time.
> > Here's an attempt to clean it up a bit.
> > Something for everyone to like or dislike...
> You duplicate ALIGN macros all over the place.
> > This one used the ALIGN macro, but I'm not inclined to
> > figure out what it actually does right now, so copy
> > the old macro to this file and renames it.
> Which is not acceptable. Ditto for DIV_ROUND_UP.

There were 3 instances where macros were
used to specify an array size.  It seems
cleaner to use SEs and direct use of calculations
for those 3 instances. (ymmv)

What would you expect this to do?

        struct {
        	unsigned char ha[ALIGN(32,sizeof(unsigned long))];
        } foo;
        
A casual reading might suggest 0.

> And you somehow decided that putting statements on one line is more
> readable than on multiple lines -- typecheck and friends.

That appears to be the generally accepted coding style
for macros and statement expressions.

Whatever is agreed to is fine by me.

> Overall impression -- moving code just because you can.

Yes. It's definitely a cleanup.

I think creating a separate include for the printk related
defines and functions will be useful for possible future
improvements to logging.

There are many private logging definitions that could be
consolidated in generic way.  Things like:

	#define MY_PRINTK(fmt, arg) print(PFX fmt, ##arg)

cheers, Joe


  reply	other threads:[~2007-11-30 18:06 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-11-30  9:28 RFC - organize include/linux/kernel.h, add include/linux/logging.h Alexey Dobriyan
2007-11-30 18:04 ` Joe Perches [this message]
2007-11-30 18:09   ` Jan Engelhardt
2007-11-30 19:20     ` Joe Perches
  -- strict thread matches above, loose matches on Subject: below --
2007-11-30  3:31 Joe Perches

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1196445871.22120.178.camel@localhost \
    --to=joe@perches.com \
    --cc=adobriyan@sw.ru \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).