Re: [B.A.T.M.A.N.] [PATCH] drivers/staging/batman-adv: Convert MAC_FMT to %pM

From: Sven Eckelmann
Date: Wed Jun 02 2010 - 19:23:36 EST


Joe Perches wrote:
> Remove the last uses of MAC_FMT
>
> Signed-off-by: Joe Perches <joe@xxxxxxxxxxx>
> ---
> drivers/staging/batman-adv/main.c | 3 +-
> drivers/staging/batman-adv/translation-table.c | 25
> ++++------------------- 2 files changed, 6 insertions(+), 22 deletions(-)
>
> diff --git a/drivers/staging/batman-adv/main.c
> b/drivers/staging/batman-adv/main.c index 74c70d5..72851cd 100644
> --- a/drivers/staging/batman-adv/main.c
> +++ b/drivers/staging/batman-adv/main.c
> @@ -226,8 +226,7 @@ void dec_module_count(void)
>
> int addr_to_string(char *buff, uint8_t *addr)
> {
> - return sprintf(buff, MAC_FMT,
> - addr[0], addr[1], addr[2], addr[3], addr[4], addr[5]);
> + return sprintf(buff, "%pM", addr);
> }
[...]

Thanks for your patch.

We must currently support older kernels which doesn't support %pM. Thats why
we have an extra wrapper for printk in the out-of-kernel module. The same
would have to be done for sprintf as well. Most of the developers are
currently attending the Wireless Battle Mesh v3 - so the processing of that
patch is delayed a little bit.

The same problem arises with your patch "Use (pr|netdev)_<level> macro helper"
(which seems to be added in 2.6.34). But I think we could add a wrapper for
older kernels easily - but as mentioned before this is probably postponed
until next week or so.

You've also changed the output. So you may partly broke batctl too (have to
check that first).

Best regards,
Sven

Attachment: signature.asc
Description: This is a digitally signed message part.