linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Larry Kessler <kessler@us.ibm.com>
To: Tony.P.Lee@nokia.com
Cc: alan@lxorguk.ukuu.org.uk, linux-kernel@vger.kernel.org,
	kessler@us.ibm.com
Subject: Re: [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y
Date: Mon, 18 Mar 2002 13:48:12 -0800	[thread overview]
Message-ID: <3C96609C.30987A95@us.ibm.com> (raw)
In-Reply-To: <4D7B558499107545BB45044C63822DDE3A2037@mvebe001.NOE.Nokia.com>

Tony.P.Lee@nokia.com wrote:
> How about this?
> 
> int printk_improve(const char* filename, int line_no,
>         const char* function_name, int module_buf_idx, ...);
> 
> #define printk(PRINTF_ARGS...) \
>         printk_improve(__FILE__, __LINE__, __FUNCTION__, \
>                 CUR_MODULE_BUF_IDX, ##PRINTF_ARGS);

When printk is defined as a macro...
"directives may not be used inside a macro argument"
...is the error caused by this style of coding:

   printk("generic options"
#ifdef AUTOPROBE_IRQ
	"AUTOPROBE_IRQ"
#else
	"AUTOSENSE"
#endif
	);

In the 2.5.6 kernel, the complete list of source files 
with directives inside the printk arg list:
drivers/net/tulip/de4x5.c
drivers/net/de620.c
drivers/net/de600.c
drivers/net/slip.c
drivers/scsi/oktagon_esp.c
drivers/scsi/sun3_NCR5380.c
drivers/scsi/sym53c8xx.c
drivers/scsi/NCR5380.c
drivers/scsi/mac_NCR5380.c
drivers/scsi/ncr53c8xx.c
drivers/scsi/seagate.c
drivers/scsi/atari_scsi.c
drivers/scsi/atari_NCR5380.c
drivers/s390/s390io.c
arch/ppc/8xx_io/fec.c
arch/alpha/kernel/setup.c
arch/s390x/kernel/setup.c
arch/s390/kernel/setup.c
sound/oss/msnd_pinnacle.c
fs/ntfs/fs.c

It is possible to submit patches to all of the maintainers
explaining that we wish to collect a standard set of info
with each call to printk, so please accept this patch, but
is it reasonable to prohibit this coding style ?  

On a related note, there are 554 #defines in the kernel that
contain "printk" in the first line, so there is some
customization going on already.

  parent reply	other threads:[~2002-03-18 21:49 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2002-03-15  2:14 [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y Tony.P.Lee
2002-03-15 14:44 ` Alan Cox
2002-03-18 21:48 ` Larry Kessler [this message]
  -- strict thread matches above, loose matches on Subject: below --
2002-03-15  1:17 [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18 Larry Kessler
2002-03-15  1:49 ` [PATCH-RFC] POSIX Event Logging, kernel 2.5.6 & 2.4.18y Alan Cox

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=3C96609C.30987A95@us.ibm.com \
    --to=kessler@us.ibm.com \
    --cc=Tony.P.Lee@nokia.com \
    --cc=alan@lxorguk.ukuu.org.uk \
    --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).