Skip to contentSkip to conversation

Is it a correct place for VBD information?

DISCUSSION Satoshi Uchida 2 participants 2 messages Jun 28, 2006 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw

Hi, Kier.

Quoted 18 lines · Satoshi Uchida
Quoted 6 lines

Sorry.
You will be sure What I mean hear by following patch. I sent this patch formally after applying the sysfs patch. This patch is to clear code, namely no give additional

function, so I

Quoted 1 line

do not sent now.

Do you really think that's better than just writing the string literals directly in the macro uses?

e.g.,
VBD_SHOW(physical_device, "%x:%x", be->major, be->minor); VBD_SHOW(mode, "%s", be->mode);

Quoted 6 lines

Also, the "\n" can be removed from the caller strings and placed inside the VBD_SHOW macro:
.... format "\n" .....

The compiler will concatenate the string literals.

I think that it is OK using macros or literals.

In Linux net/core/net-sysfs.c., the 'fmt' representation is used by statistical data. In the other, it is used literals or define show function directly. Therefore, representation will be not unified in detail.
(Perhaps, macro is not better in net/core/net-sysfs.c)

I think that it is useful for recognizing data type and interesting, and so used fmt representation.

In Linux, "\n" is written in format even if using literals. However, I think that above representation is interesting and want to use idea if using literals.

Please comment, using fmt macro or literals.

Thanks
Satoshi UCHIDA

#2 lore raw
Quoted 4 lines · Satoshi Uchida

In Linux net/core/net-sysfs.c., the 'fmt' representation is used by statistical data. In the other, it is used literals or define show function directly. Therefore, representation will be not unified in detail.
(Perhaps, macro is not better in net/core/net-sysfs.c)

Using a macro for the function makes sense here, rather than duplicating a multi-line function block.

Quoted 8 lines

I think that it is useful for recognizing data type and interesting, and so used fmt representation.

In Linux, "\n" is written in format even if using literals. However, I think that above representation is interesting and want to use idea if using literals.

Please comment, using fmt macro or literals.

Literals are clearer here. Then the macro invocations read like a printf() style of call.

-- Keir