* [PATCH] defines modified to match the 80-char rule
@ 2015-06-23 21:21 Mario Bambagini
2015-07-01 7:59 ` Krzysztof Hałasa
0 siblings, 1 reply; 21+ messages in thread
From: Mario Bambagini @ 2015-06-23 21:21 UTC (permalink / raw)
To: oleg.drokin
Cc: andreas.dilger, gregkh, mrugiero, Julia.Lawall, clabbe.montjoie,
tapaswenipathak, HPDD-discuss, devel, linux-kernel,
mario.bambagini
Defines have been written in more than one line to match the 80-character
rule. This error has been fixed 6 times in this file.
The file is fully compliant with respect to the coding rules now.
Signed-off-by: Mario Bambagini <mario.bambagini@gmail.com>
---
.../lustre/include/linux/libcfs/libcfs_debug.h | 20 +++++++++++++-------
1 file changed, 13 insertions(+), 7 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index 8251ac9..aa44311 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -233,14 +233,20 @@ do { \
#define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
#define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
-#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, 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_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
+#define LCONSOLE_EMERG(format, ...) \
+ CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
const char *format1, ...)
--
2.1.4
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-06-23 21:21 [PATCH] defines modified to match the 80-char rule Mario Bambagini
@ 2015-07-01 7:59 ` Krzysztof Hałasa
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-01 7:59 UTC (permalink / raw)
To: linux-kernel; +Cc: driverdev-devel
Mario Bambagini <mario.bambagini@gmail.com> writes:
> Defines have been written in more than one line to match the 80-character
> rule. This error has been fixed 6 times in this file.
> The file is fully compliant with respect to the coding rules now.
Rules, maybe. But is it better, i.e., more readable?
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> @@ -233,14 +233,20 @@ do { \
> #define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
> #define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
>
> -#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, 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_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
> +#define LCONSOLE_EMERG(format, ...) \
> + CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
>
> int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
> const char *format1, ...)
... I don't think so. Perhaps if I wasn't using the bleading edge tech
132-column digital flat LCD screen, I would see this differently (Emacs
isn't perfect when displaying long lines on IBM monochrome display
adapter, even with the intelligent-long-lines-wrap package).
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-01 7:59 ` Krzysztof Hałasa
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-01 7:59 UTC (permalink / raw)
To: driverdev-devel; +Cc: linux-kernel
Mario Bambagini <mario.bambagini@gmail.com> writes:
> Defines have been written in more than one line to match the 80-character
> rule. This error has been fixed 6 times in this file.
> The file is fully compliant with respect to the coding rules now.
Rules, maybe. But is it better, i.e., more readable?
> --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> @@ -233,14 +233,20 @@ do { \
> #define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
> #define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
>
> -#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, 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_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
> +#define LCONSOLE_EMERG(format, ...) \
> + CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
>
> int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
> const char *format1, ...)
... I don't think so. Perhaps if I wasn't using the bleading edge tech
132-column digital flat LCD screen, I would see this differently (Emacs
isn't perfect when displaying long lines on IBM monochrome display
adapter, even with the intelligent-long-lines-wrap package).
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-01 7:59 ` Krzysztof Hałasa
@ 2015-07-02 6:20 ` Joe Perches
-1 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-02 6:20 UTC (permalink / raw)
To: Krzysztof Hałasa, Mario Bambagini; +Cc: linux-kernel, driverdev-devel
On Wed, 2015-07-01 at 09:59 +0200, Krzysztof Hałasa wrote:
> Mario Bambagini <mario.bambagini@gmail.com> writes:
>
> > Defines have been written in more than one line to match the 80-character
> > rule. This error has been fixed 6 times in this file.
> > The file is fully compliant with respect to the coding rules now.
>
> Rules, maybe. But is it better, i.e., more readable?
>
> > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
[]
> > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
[]
> > +#define LCONSOLE(mask, format, ...) \
> > + CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
> ... I don't think so. Perhaps if I wasn't using the bleading edge tech
> 132-column digital flat LCD screen, I would see this differently (Emacs
> isn't perfect when displaying long lines on IBM monochrome display
> adapter, even with the intelligent-long-lines-wrap package).
I think this isn't particularly nice because of the
different alignment styles used for the macros.
I think it's OK as is, but it _might_ be nicer if it
removed the space after ## and used the same indent
as most other macros.
#define LCONSOLE(mask, fmt, ...) \
CDEBUG(D_CONSOLE | (mask), fmt, ##__VA_ARGS__)
and
#define LCONSOLE_ERROR_MSG(errnum, fmt, ...) \
CDEBUG_LIMIT(D_CONSOLE | D_ERROR, "%x-%x: " fmt, \
errnum, LERRCHKSUM(errnum), ##__VA_ARGS__)
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-02 6:20 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-02 6:20 UTC (permalink / raw)
To: Krzysztof Hałasa, Mario Bambagini; +Cc: driverdev-devel, linux-kernel
On Wed, 2015-07-01 at 09:59 +0200, Krzysztof Hałasa wrote:
> Mario Bambagini <mario.bambagini@gmail.com> writes:
>
> > Defines have been written in more than one line to match the 80-character
> > rule. This error has been fixed 6 times in this file.
> > The file is fully compliant with respect to the coding rules now.
>
> Rules, maybe. But is it better, i.e., more readable?
>
> > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
[]
> > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
[]
> > +#define LCONSOLE(mask, format, ...) \
> > + CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
> ... I don't think so. Perhaps if I wasn't using the bleading edge tech
> 132-column digital flat LCD screen, I would see this differently (Emacs
> isn't perfect when displaying long lines on IBM monochrome display
> adapter, even with the intelligent-long-lines-wrap package).
I think this isn't particularly nice because of the
different alignment styles used for the macros.
I think it's OK as is, but it _might_ be nicer if it
removed the space after ## and used the same indent
as most other macros.
#define LCONSOLE(mask, fmt, ...) \
CDEBUG(D_CONSOLE | (mask), fmt, ##__VA_ARGS__)
and
#define LCONSOLE_ERROR_MSG(errnum, fmt, ...) \
CDEBUG_LIMIT(D_CONSOLE | D_ERROR, "%x-%x: " fmt, \
errnum, LERRCHKSUM(errnum), ##__VA_ARGS__)
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-02 6:20 ` Joe Perches
@ 2015-07-02 18:01 ` Joe Perches
-1 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-02 18:01 UTC (permalink / raw)
To: Mario Bambagini; +Cc: Krzysztof Hałasa, linux-kernel, driverdev-devel
On Wed, 2015-07-01 at 23:20 -0700, Joe Perches wrote:
> On Wed, 2015-07-01 at 09:59 +0200, Krzysztof Hałasa wrote:
> > Mario Bambagini <mario.bambagini@gmail.com> writes:
> >
> > > Defines have been written in more than one line to match the 80-character
> > > rule. This error has been fixed 6 times in this file.
> > > The file is fully compliant with respect to the coding rules now.
> >
> > Rules, maybe. But is it better, i.e., more readable?
> >
> > > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> > > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> []
> > > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
> []
> > > +#define LCONSOLE(mask, format, ...) \
> > > + CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
>
> > ... I don't think so. Perhaps if I wasn't using the bleading edge tech
> > 132-column digital flat LCD screen, I would see this differently (Emacs
> > isn't perfect when displaying long lines on IBM monochrome display
> > adapter, even with the intelligent-long-lines-wrap package).
>
> I think this isn't particularly nice because of the
> different alignment styles used for the macros.
>
> I think it's OK as is, but it _might_ be nicer if it
> removed the space after ## and used the same indent
> as most other macros.
I suggest something like this:
o Use fmt for format
o Consistent use of ##__VA_ARGS__
o Consistent argument alignment
o Consistent line continuation alignment
o Standardize __printf location
Perhaps the libcfs_debug_msg and libcfs_debug_vmsg2
functions can be collapsed into a single function
using the vsprintf %pV extension.
---
.../lustre/include/linux/libcfs/libcfs_debug.h | 54 +++++++++++++---------
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index 8251ac9..97a8710 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -207,7 +207,7 @@ static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
((libcfs_debug & mask) && (libcfs_subsystem_debug & subsystem));
}
-#define __CDEBUG(cdls, mask, format, ...) \
+#define __CDEBUG(cdls, mask, fmt, ...) \
do { \
static struct libcfs_debug_msg_data msgdata; \
\
@@ -215,41 +215,51 @@ do { \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_INIT(&msgdata, mask, cdls); \
- libcfs_debug_msg(&msgdata, format, ## __VA_ARGS__); \
+ libcfs_debug_msg(&msgdata, fmt, ##__VA_ARGS__); \
} \
} while (0)
-#define CDEBUG(mask, format, ...) __CDEBUG(NULL, mask, format, ## __VA_ARGS__)
+#define CDEBUG(mask, fmt, ...) \
+ __CDEBUG(NULL, mask, fmt, ##__VA_ARGS__)
-#define CDEBUG_LIMIT(mask, format, ...) \
+#define CDEBUG_LIMIT(mask, fmt, ...) \
do { \
static struct cfs_debug_limit_state cdls; \
\
- __CDEBUG(&cdls, mask, format, ## __VA_ARGS__); \
+ __CDEBUG(&cdls, mask, fmt, ##__VA_ARGS__); \
} while (0)
-#define CWARN(format, ...) CDEBUG_LIMIT(D_WARNING, format, ## __VA_ARGS__)
-#define CERROR(format, ...) CDEBUG_LIMIT(D_ERROR, format, ## __VA_ARGS__)
-#define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
-#define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
+#define CWARN(fmt, ...) \
+ CDEBUG_LIMIT(D_WARNING, fmt, ##__VA_ARGS__)
+#define CERROR(fmt, ...) \
+ CDEBUG_LIMIT(D_ERROR, fmt, ##__VA_ARGS__)
+#define CNETERR(fmt, ...) \
+ CDEBUG_LIMIT(D_NETERROR, fmt, ##__VA_ARGS__)
+#define CEMERG(fmt, ...) \
+ CDEBUG_LIMIT(D_EMERG, fmt, ##__VA_ARGS__)
-#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__)
+#define LCONSOLE_ERROR(fmt, ...) \
+ LCONSOLE_ERROR_MSG(0x00, fmt, ##__VA_ARGS__)
-#define LCONSOLE_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
+#define LCONSOLE_EMERG(fmt, ...) \
+ CDEBUG(D_CONSOLE | D_EMERG, fmt, ##__VA_ARGS__)
+__printf(2, 3)
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
- const char *format1, ...)
- __printf(2, 3);
-
+ const char *fmt, ...);
+__printf(4, 5)
int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1,
- va_list args, const char *format2, ...)
- __printf(4, 5);
+ const char *format1, va_list args,
+ const char *format2, ...);
/* other external symbols that tracefile provides: */
int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-02 18:01 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-02 18:01 UTC (permalink / raw)
To: Mario Bambagini; +Cc: driverdev-devel, Krzysztof Hałasa, linux-kernel
On Wed, 2015-07-01 at 23:20 -0700, Joe Perches wrote:
> On Wed, 2015-07-01 at 09:59 +0200, Krzysztof Hałasa wrote:
> > Mario Bambagini <mario.bambagini@gmail.com> writes:
> >
> > > Defines have been written in more than one line to match the 80-character
> > > rule. This error has been fixed 6 times in this file.
> > > The file is fully compliant with respect to the coding rules now.
> >
> > Rules, maybe. But is it better, i.e., more readable?
> >
> > > --- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> > > +++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
> []
> > > -#define LCONSOLE(mask, format, ...) CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
> []
> > > +#define LCONSOLE(mask, format, ...) \
> > > + CDEBUG(D_CONSOLE | (mask), format, ## __VA_ARGS__)
>
> > ... I don't think so. Perhaps if I wasn't using the bleading edge tech
> > 132-column digital flat LCD screen, I would see this differently (Emacs
> > isn't perfect when displaying long lines on IBM monochrome display
> > adapter, even with the intelligent-long-lines-wrap package).
>
> I think this isn't particularly nice because of the
> different alignment styles used for the macros.
>
> I think it's OK as is, but it _might_ be nicer if it
> removed the space after ## and used the same indent
> as most other macros.
I suggest something like this:
o Use fmt for format
o Consistent use of ##__VA_ARGS__
o Consistent argument alignment
o Consistent line continuation alignment
o Standardize __printf location
Perhaps the libcfs_debug_msg and libcfs_debug_vmsg2
functions can be collapsed into a single function
using the vsprintf %pV extension.
---
.../lustre/include/linux/libcfs/libcfs_debug.h | 54 +++++++++++++---------
1 file changed, 32 insertions(+), 22 deletions(-)
diff --git a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
index 8251ac9..97a8710 100644
--- a/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
+++ b/drivers/staging/lustre/include/linux/libcfs/libcfs_debug.h
@@ -207,7 +207,7 @@ static inline int cfs_cdebug_show(unsigned int mask, unsigned int subsystem)
((libcfs_debug & mask) && (libcfs_subsystem_debug & subsystem));
}
-#define __CDEBUG(cdls, mask, format, ...) \
+#define __CDEBUG(cdls, mask, fmt, ...) \
do { \
static struct libcfs_debug_msg_data msgdata; \
\
@@ -215,41 +215,51 @@ do { \
\
if (cfs_cdebug_show(mask, DEBUG_SUBSYSTEM)) { \
LIBCFS_DEBUG_MSG_DATA_INIT(&msgdata, mask, cdls); \
- libcfs_debug_msg(&msgdata, format, ## __VA_ARGS__); \
+ libcfs_debug_msg(&msgdata, fmt, ##__VA_ARGS__); \
} \
} while (0)
-#define CDEBUG(mask, format, ...) __CDEBUG(NULL, mask, format, ## __VA_ARGS__)
+#define CDEBUG(mask, fmt, ...) \
+ __CDEBUG(NULL, mask, fmt, ##__VA_ARGS__)
-#define CDEBUG_LIMIT(mask, format, ...) \
+#define CDEBUG_LIMIT(mask, fmt, ...) \
do { \
static struct cfs_debug_limit_state cdls; \
\
- __CDEBUG(&cdls, mask, format, ## __VA_ARGS__); \
+ __CDEBUG(&cdls, mask, fmt, ##__VA_ARGS__); \
} while (0)
-#define CWARN(format, ...) CDEBUG_LIMIT(D_WARNING, format, ## __VA_ARGS__)
-#define CERROR(format, ...) CDEBUG_LIMIT(D_ERROR, format, ## __VA_ARGS__)
-#define CNETERR(format, a...) CDEBUG_LIMIT(D_NETERROR, format, ## a)
-#define CEMERG(format, ...) CDEBUG_LIMIT(D_EMERG, format, ## __VA_ARGS__)
+#define CWARN(fmt, ...) \
+ CDEBUG_LIMIT(D_WARNING, fmt, ##__VA_ARGS__)
+#define CERROR(fmt, ...) \
+ CDEBUG_LIMIT(D_ERROR, fmt, ##__VA_ARGS__)
+#define CNETERR(fmt, ...) \
+ CDEBUG_LIMIT(D_NETERROR, fmt, ##__VA_ARGS__)
+#define CEMERG(fmt, ...) \
+ CDEBUG_LIMIT(D_EMERG, fmt, ##__VA_ARGS__)
-#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__)
+#define LCONSOLE_ERROR(fmt, ...) \
+ LCONSOLE_ERROR_MSG(0x00, fmt, ##__VA_ARGS__)
-#define LCONSOLE_EMERG(format, ...) CDEBUG(D_CONSOLE | D_EMERG, format, ## __VA_ARGS__)
+#define LCONSOLE_EMERG(fmt, ...) \
+ CDEBUG(D_CONSOLE | D_EMERG, fmt, ##__VA_ARGS__)
+__printf(2, 3)
int libcfs_debug_msg(struct libcfs_debug_msg_data *msgdata,
- const char *format1, ...)
- __printf(2, 3);
-
+ const char *fmt, ...);
+__printf(4, 5)
int libcfs_debug_vmsg2(struct libcfs_debug_msg_data *msgdata,
- const char *format1,
- va_list args, const char *format2, ...)
- __printf(4, 5);
+ const char *format1, va_list args,
+ const char *format2, ...);
/* other external symbols that tracefile provides: */
int cfs_trace_copyin_string(char *knl_buffer, int knl_buffer_nob,
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply related [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-02 18:01 ` Joe Perches
@ 2015-07-03 10:58 ` Krzysztof Hałasa
-1 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-03 10:58 UTC (permalink / raw)
To: Joe Perches; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
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
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-03 10:58 ` Krzysztof Hałasa
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-03 10:58 UTC (permalink / raw)
To: Joe Perches; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
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
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-03 10:58 ` Krzysztof Hałasa
@ 2015-07-03 16:10 ` Joe Perches
-1 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-03 16:10 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
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.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-03 16:10 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-03 16:10 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
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.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-03 16:10 ` Joe Perches
@ 2015-07-06 6:07 ` Krzysztof Hałasa
-1 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-06 6:07 UTC (permalink / raw)
To: Joe Perches; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
Joe Perches <joe@perches.com> writes:
> 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.
So, could we have the localized readability when it makes sense,
and the default rules when nothing else applies?
OTOH I think the 80 columns rule should go.
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-06 6:07 ` Krzysztof Hałasa
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-06 6:07 UTC (permalink / raw)
To: Joe Perches; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
Joe Perches <joe@perches.com> writes:
> 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.
So, could we have the localized readability when it makes sense,
and the default rules when nothing else applies?
OTOH I think the 80 columns rule should go.
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-06 6:07 ` Krzysztof Hałasa
@ 2015-07-06 8:07 ` Joe Perches
-1 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-06 8:07 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
On Mon, 2015-07-06 at 08:07 +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
> > 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.
>
> So, could we have the localized readability when it makes sense,
> and the default rules when nothing else applies?
Then the question becomes how local.
> OTOH I think the 80 columns rule should go.
I have no issue with that.
There should be some limit though.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-06 8:07 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-06 8:07 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
On Mon, 2015-07-06 at 08:07 +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
> > 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.
>
> So, could we have the localized readability when it makes sense,
> and the default rules when nothing else applies?
Then the question becomes how local.
> OTOH I think the 80 columns rule should go.
I have no issue with that.
There should be some limit though.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-06 6:07 ` Krzysztof Hałasa
@ 2015-07-06 8:30 ` Dan Carpenter
-1 siblings, 0 replies; 21+ messages in thread
From: Dan Carpenter @ 2015-07-06 8:30 UTC (permalink / raw)
To: Krzysztof Hałasa
Cc: Joe Perches, driverdev-devel, Mario Bambagini, linux-kernel
On Mon, Jul 06, 2015 at 08:07:52AM +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
>
> > 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.
>
> So, could we have the localized readability when it makes sense,
> and the default rules when nothing else applies?
It's localized to literally those four lines, the pattern breaks down
for the other six macros.
regards,
dan carpenter
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-06 8:30 ` Dan Carpenter
0 siblings, 0 replies; 21+ messages in thread
From: Dan Carpenter @ 2015-07-06 8:30 UTC (permalink / raw)
To: Krzysztof Hałasa
Cc: Joe Perches, driverdev-devel, Mario Bambagini, linux-kernel
On Mon, Jul 06, 2015 at 08:07:52AM +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
>
> > 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.
>
> So, could we have the localized readability when it makes sense,
> and the default rules when nothing else applies?
It's localized to literally those four lines, the pattern breaks down
for the other six macros.
regards,
dan carpenter
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-06 8:07 ` Joe Perches
@ 2015-07-06 12:16 ` Krzysztof Hałasa
-1 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-06 12:16 UTC (permalink / raw)
To: Joe Perches; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
Joe Perches <joe@perches.com> writes:
>> So, could we have the localized readability when it makes sense,
>> and the default rules when nothing else applies?
>
> Then the question becomes how local.
The answer seems easy to me: as much as it's needed to get the best
readability.
If that means 4 or 2 custom formatted lines, great. Why not?
It should be the maintainer's call anyway. It's (s)he who has to work
with the code in question most.
>> OTOH I think the 80 columns rule should go.
>
> I have no issue with that.
> There should be some limit though.
Sure, the max readability should set the limit. Though I would say one
shouldn't exceed maybe 132 chars (this is what old VT100 had, and this
is also supported on PC since some 8-bit XT-BUS VGA cards).
132 chars also allow for full 80-char "console output text" lines.
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-06 12:16 ` Krzysztof Hałasa
0 siblings, 0 replies; 21+ messages in thread
From: Krzysztof Hałasa @ 2015-07-06 12:16 UTC (permalink / raw)
To: Joe Perches; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
Joe Perches <joe@perches.com> writes:
>> So, could we have the localized readability when it makes sense,
>> and the default rules when nothing else applies?
>
> Then the question becomes how local.
The answer seems easy to me: as much as it's needed to get the best
readability.
If that means 4 or 2 custom formatted lines, great. Why not?
It should be the maintainer's call anyway. It's (s)he who has to work
with the code in question most.
>> OTOH I think the 80 columns rule should go.
>
> I have no issue with that.
> There should be some limit though.
Sure, the max readability should set the limit. Though I would say one
shouldn't exceed maybe 132 chars (this is what old VT100 had, and this
is also supported on PC since some 8-bit XT-BUS VGA cards).
132 chars also allow for full 80-char "console output text" lines.
--
Krzysztof Halasa
Industrial Research Institute for Automation and Measurements PIAP
Al. Jerozolimskie 202, 02-486 Warsaw, Poland
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
2015-07-06 12:16 ` Krzysztof Hałasa
@ 2015-07-08 15:30 ` Joe Perches
-1 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-08 15:30 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: Mario Bambagini, linux-kernel, driverdev-devel
On Mon, 2015-07-06 at 14:16 +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
>
> >> So, could we have the localized readability when it makes sense,
> >> and the default rules when nothing else applies?
> >
> > Then the question becomes how local.
>
> The answer seems easy to me: as much as it's needed to get the best
> readability.
> If that means 4 or 2 custom formatted lines, great. Why not?
Changing styles every few lines demands more
from a reader's pattern matching capabilities.
> It should be the maintainer's call anyway. It's (s)he who has to work
> with the code in question most.
True.
^ permalink raw reply [flat|nested] 21+ messages in thread
* Re: [PATCH] defines modified to match the 80-char rule
@ 2015-07-08 15:30 ` Joe Perches
0 siblings, 0 replies; 21+ messages in thread
From: Joe Perches @ 2015-07-08 15:30 UTC (permalink / raw)
To: Krzysztof Hałasa; +Cc: driverdev-devel, Mario Bambagini, linux-kernel
On Mon, 2015-07-06 at 14:16 +0200, Krzysztof Hałasa wrote:
> Joe Perches <joe@perches.com> writes:
>
> >> So, could we have the localized readability when it makes sense,
> >> and the default rules when nothing else applies?
> >
> > Then the question becomes how local.
>
> The answer seems easy to me: as much as it's needed to get the best
> readability.
> If that means 4 or 2 custom formatted lines, great. Why not?
Changing styles every few lines demands more
from a reader's pattern matching capabilities.
> It should be the maintainer's call anyway. It's (s)he who has to work
> with the code in question most.
True.
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 21+ messages in thread
end of thread, other threads:[~2015-07-08 21:26 UTC | newest]
Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-06-23 21:21 [PATCH] defines modified to match the 80-char rule Mario Bambagini
2015-07-01 7:59 ` Krzysztof Hałasa
2015-07-01 7:59 ` Krzysztof Hałasa
2015-07-02 6:20 ` Joe Perches
2015-07-02 6:20 ` Joe Perches
2015-07-02 18:01 ` Joe Perches
2015-07-02 18:01 ` Joe Perches
2015-07-03 10:58 ` Krzysztof Hałasa
2015-07-03 10:58 ` Krzysztof Hałasa
2015-07-03 16:10 ` Joe Perches
2015-07-03 16:10 ` Joe Perches
2015-07-06 6:07 ` Krzysztof Hałasa
2015-07-06 6:07 ` Krzysztof Hałasa
2015-07-06 8:07 ` Joe Perches
2015-07-06 8:07 ` Joe Perches
2015-07-06 12:16 ` Krzysztof Hałasa
2015-07-06 12:16 ` Krzysztof Hałasa
2015-07-08 15:30 ` Joe Perches
2015-07-08 15:30 ` Joe Perches
2015-07-06 8:30 ` Dan Carpenter
2015-07-06 8:30 ` Dan Carpenter
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.