Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1176487 > unrolled thread
| Started by | khalasa@piap.pl (Krzysztof Hałasa) |
|---|---|
| First post | 2015-07-03 13:00 +0200 |
| Last post | 2015-07-03 18:20 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
This discussion starts older than the indexed window; earlier articles aren't shown. The article labeled Started by
below is the oldest one visible, not the original post.
Re: [PATCH] defines modified to match the 80-char rule khalasa@piap.pl (Krzysztof Hałasa) - 2015-07-03 13:00 +0200
Re: [PATCH] defines modified to match the 80-char rule Joe Perches <joe@perches.com> - 2015-07-03 18:20 +0200
| From | khalasa@piap.pl (Krzysztof Hałasa) |
|---|---|
| Date | 2015-07-03 13:00 +0200 |
| Subject | Re: [PATCH] defines modified to match the 80-char rule |
| Message-ID | <pI6Rl-7tK-31@gated-at.bofh.it> |
Joe Perches <joe@perches.com> writes: > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__) > -#define LCONSOLE_INFO(format, ...) CDEBUG_LIMIT(D_CONSOLE, format, ## __VA_ARGS__) > -#define LCONSOLE_WARN(format, ...) CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## __VA_ARGS__) > -#define LCONSOLE_ERROR_MSG(errnum, format, ...) CDEBUG_LIMIT(D_CONSOLE | D_ERROR, \ > - "%x-%x: " format, errnum, LERRCHKSUM(errnum), ## __VA_ARGS__) > -#define LCONSOLE_ERROR(format, ...) LCONSOLE_ERROR_MSG(0x00, format, ## __VA_ARGS__) > +#define LCONSOLE(mask, fmt, ...) \ > + CDEBUG(D_CONSOLE | (mask), fmt, ##__VA_ARGS__) > +#define LCONSOLE_INFO(fmt, ...) \ > + CDEBUG_LIMIT(D_CONSOLE, fmt, ##__VA_ARGS__) > +#define LCONSOLE_WARN(fmt, ...) \ > + CDEBUG_LIMIT(D_CONSOLE | D_WARNING, fmt, ##__VA_ARGS__) > +#define LCONSOLE_ERROR_MSG(errnum, fmt, ...) \ > + CDEBUG_LIMIT(D_CONSOLE | D_ERROR, "%x-%x: " fmt, \ > + errnum, LERRCHKSUM(errnum), ##__VA_ARGS__) I don't find it better, actually I think it's much harder to read. Maybe that's just me. Call me extremist, but I think I could even like the following :-) #define CWARN(format, ...) CDEBUG_LIMIT(D_WARNING, format, ## __VA_ARGS__) #define CERROR(format, ...) CDEBUG_LIMIT(D_ERROR, format, ## __VA_ARGS__) #define CNETERR(format, ...) CDEBUG_LIMIT(D_NETERROR, format, ## __VA_ARGS__) #define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__) -- Krzysztof Halasa Industrial Research Institute for Automation and Measurements PIAP Al. Jerozolimskie 202, 02-486 Warsaw, Poland -- 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/
[toc] | [next] | [standalone]
| From | Joe Perches <joe@perches.com> |
|---|---|
| Date | 2015-07-03 18:20 +0200 |
| Message-ID | <pIbR0-2jt-21@gated-at.bofh.it> |
| In reply to | #1176487 |
On Fri, 2015-07-03 at 12:58 +0200, Krzysztof Hałasa wrote: > Joe Perches <joe@perches.com> writes: > > > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__) > > -#define LCONSOLE_INFO(format, ...) CDEBUG_LIMIT(D_CONSOLE, format, ## __VA_ARGS__) > > -#define LCONSOLE_WARN(format, ...) CDEBUG_LIMIT(D_CONSOLE | D_WARNING, format, ## __VA_ARGS__) > > -#define LCONSOLE_ERROR_MSG(errnum, format, ...) CDEBUG_LIMIT(D_CONSOLE | D_ERROR, \ > > - "%x-%x: " format, errnum, LERRCHKSUM(errnum), ## __VA_ARGS__) > > -#define LCONSOLE_ERROR(format, ...) LCONSOLE_ERROR_MSG(0x00, format, ## __VA_ARGS__) > > +#define LCONSOLE(mask, fmt, ...) \ > > + CDEBUG(D_CONSOLE | (mask), fmt, ##__VA_ARGS__) > > +#define LCONSOLE_INFO(fmt, ...) \ > > + CDEBUG_LIMIT(D_CONSOLE, fmt, ##__VA_ARGS__) > > +#define LCONSOLE_WARN(fmt, ...) \ > > + CDEBUG_LIMIT(D_CONSOLE | D_WARNING, fmt, ##__VA_ARGS__) > > +#define LCONSOLE_ERROR_MSG(errnum, fmt, ...) \ > > + CDEBUG_LIMIT(D_CONSOLE | D_ERROR, "%x-%x: " fmt, \ > > + errnum, LERRCHKSUM(errnum), ##__VA_ARGS__) > > I don't find it better, actually I think it's much harder to read. > > Maybe that's just me. > > Call me extremist, but I think I could even like the following :-) > > #define CWARN(format, ...) CDEBUG_LIMIT(D_WARNING, format, ## __VA_ARGS__) > #define CERROR(format, ...) CDEBUG_LIMIT(D_ERROR, format, ## __VA_ARGS__) > #define CNETERR(format, ...) CDEBUG_LIMIT(D_NETERROR, format, ## __VA_ARGS__) > #define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__) Nah, you're not an extremist, you're just preferring narrowly localized readability over global consistency. That's fine and all, until you come up to LCONSOLE_ERROR_MSG type use which blows the nice old formatting up. So what I suggested is just a simple consistency thing. -- 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/
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web