lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAHdPZaPeGe6FtrU7u1JLCUKs5H3PruXBPA5zpHmEsy=w97bj2w@mail.gmail.com>
Date:	Tue, 29 May 2012 20:50:30 +0530
From:	"devendra.aaru" <devendra.aaru@...il.com>
To:	Joe Perches <joe@...ches.com>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Eric Dumazet <eric.dumazet@...il.com>,
	Kevin McKinney <klmckinney1@...il.com>,
	devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH V3] [staging] bcm: Replace the BCM_DEBUG_* and BCM_SHOW_*
 macros with functions

Hi Joe,

On Tue, May 29, 2012 at 7:15 PM, Joe Perches <joe@...ches.com> wrote:
>> diff --git a/drivers/staging/bcm/Debug.c b/drivers/staging/bcm/Debug.c
> []
>> +void bcm_debug_print(PMINI_ADAPTER Adapter, int Type, int SubType,
>> +                     int dbg_level, const char *fmt, ...)
>> +{
>> +     struct va_format vaf;
>> +     va_list args;
>> +     UINT debug_level = Adapter->stDebugState.debug_level;
>> +
>> +     va_start(args, fmt);
>> +
>> +     vaf.fmt = fmt;
>> +     vaf.va = &args;
>> +
>> +     if (DBG_TYPE_PRINTK == Type)
>> +             pr_info("%s: %pV", __func__, &vaf);
>
> func
>
>> +     else if (Adapter &&
>> +             (dbg_level & DBG_LVL_BITMASK) <= debug_level &&
>> +             (Type & Adapter->stDebugState.type) &&
>> +             (SubType & Adapter->stDebugState.subtype[Type])) {
>> +             if (dbg_level & DBG_NO_FUNC_PRINT)
>> +                     printk(KERN_DEBUG "%pV" , &vaf);
>> +             else
>> +                     printk(KERN_DEBUG "%s: %pV", __func__, &vaf);
>
> func
>
>> +     }
>> +
>> +     va_end(args);
>> +}
>> +
>> +void bcm_debug_print_buffer(PMINI_ADAPTER Adapter, int Type, int SubType,
>> +                         int dbg_level, const void *buffer, size_t bufferlen)
>> +{
>> +     if (DBG_TYPE_PRINTK == Type ||
>> +        (Adapter &&
>> +        (dbg_level & DBG_LVL_BITMASK) <= Adapter->stDebugState.debug_level &&
>> +        (Type & Adapter->stDebugState.type) &&
>> +        (SubType & Adapter->stDebugState.subtype[Type]))) {
>> +             printk(KERN_DEBUG "%s:\n", __func__);
>
> func
>
>> +             print_hex_dump(KERN_DEBUG, " ", DUMP_PREFIX_OFFSET,
>> +                            16, 1, buffer, bufferlen, false);
>> +     }
>> +}
>
> []
>
>> diff --git a/drivers/staging/bcm/Debug.h b/drivers/staging/bcm/Debug.h
> []
>> +struct _MINI_ADAPTER;
>> +
>> +__printf(5, 6)
>> +
>> +void bcm_debug_print(struct _MINI_ADAPTER *Adapter, int Type, int SubType,
>> +                     int dbg_level, const char *fmt, ...);
>
> No blank line between __printf and prototype
>
>> +void bcm_debug_print_buffer(struct _MINI_ADAPTER *Adapter, int Type, int SubType,
>> +                     int dbg_level, const void *buffer, size_t bufferlen);
>> +void bcm_show_debug_bitmap(struct _MINI_ADAPTER *Adapter);
>> +
>> +#define BCM_DEBUG_PRINT(Adapter, Type, SubType, dbg_level, fmt, ...) \
>> +     bcm_debug_print(Adapter, Type, SubType, dbg_level, fmt, ##__VA_ARGS__)
>> +
>> +#define BCM_DEBUG_PRINT_BUFFER(Adapter, Type, SubType, dbg_level,    \
>> +                             buffer, bufferlen)                      \
>> +     bcm_debug_print_buffer(Adapter, Type, SubType, dbg_level,       \
>> +                             buffer, bufferlen)
>> +#define BCM_SHOW_DEBUG_BITMAP(Adapter)                                       \
>> +     bcm_show_debug_bitmap(Adapter)
>
> Turns out to keep the same behavior, you need to add
> a const char *func argument to these functions and
> change the macros to pass __func__.
>
>
>
Ok. so what i am doing now is wrong as its a function, and __func__
gives the dbg function name, instead the called function since we
changed it to functions rather from Macros.

Ok, i will send out new changes.

Thanks,
Devendra.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ