2012-03-30 11:13:01

by Johannes Berg

[permalink] [raw]
Subject: [PATCH] compat: crc8: undef pr_fmt

From: Johannes Berg <[email protected]>

Signed-off-by: Johannes Berg <[email protected]>
---
compat/crc8.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)

diff --git a/compat/crc8.c b/compat/crc8.c
index fa8382d..753a5cb 100644
--- a/compat/crc8.c
+++ b/compat/crc8.c
@@ -14,6 +14,9 @@
* CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/

+#ifdef pr_fmt
+#undef pr_fmt
+#endif
#define pr_fmt(fmt) KBUILD_MODNAME ": " fmt

#include <linux/module.h>
--
1.7.9.1





2012-03-30 11:54:55

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] compat: crc8: undef pr_fmt

On Fri, 2012-03-30 at 13:49 +0200, Arend van Spriel wrote:
> On 03/30/2012 01:13 PM, Johannes Berg wrote:
> >
> > +#ifdef pr_fmt
> > +#undef pr_fmt
> > +#endif
> > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >
> > #include<linux/module.h>
>
> Trivial remark. Not really necessary to do the #ifdef. #undef works fine
> if pr_fmt has not been defined.

Really? I thought it would give a warning then, but couldn't test it
since it was defined for me.

johannes


2012-03-30 11:50:17

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] compat: crc8: undef pr_fmt

On 03/30/2012 01:13 PM, Johannes Berg wrote:
>
> +#ifdef pr_fmt
> +#undef pr_fmt
> +#endif
> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>
> #include<linux/module.h>

Trivial remark. Not really necessary to do the #ifdef. #undef works fine
if pr_fmt has not been defined.

Gr. AvS


2012-03-30 21:23:44

by Luis Chamberlain

[permalink] [raw]
Subject: Re: [PATCH] compat: crc8: undef pr_fmt

On Fri, Mar 30, 2012 at 02:28:30PM +0200, Johannes Berg wrote:
> On Fri, 2012-03-30 at 14:14 +0200, Arend van Spriel wrote:
> > On 03/30/2012 01:54 PM, Johannes Berg wrote:
> > > On Fri, 2012-03-30 at 13:49 +0200, Arend van Spriel wrote:
> > >> On 03/30/2012 01:13 PM, Johannes Berg wrote:
> > >>>
> > >>> +#ifdef pr_fmt
> > >>> +#undef pr_fmt
> > >>> +#endif
> > >>> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> > >>>
> > >>> #include<linux/module.h>
> > >>
> > >> Trivial remark. Not really necessary to do the #ifdef. #undef works fine
> > >> if pr_fmt has not been defined.
> > >
> > > Really? I thought it would give a warning then, but couldn't test it
> > > since it was defined for me.
> > >
> > > johannes
> > >
> > >
> >
> > I made a little test program to confirm my thought, before sending my
> > previous email. Retried compiling with '-W -Wall -ansi -pedantic' and no
> > complaints about the #undef.
>
> Ok. I'm too lazy to send a new patch, but maybe Luis wants to change it
> when he applies it :)

I changed it, and applied, thanks!!!

Luis

2012-03-30 12:15:00

by Arend van Spriel

[permalink] [raw]
Subject: Re: [PATCH] compat: crc8: undef pr_fmt

On 03/30/2012 01:54 PM, Johannes Berg wrote:
> On Fri, 2012-03-30 at 13:49 +0200, Arend van Spriel wrote:
>> On 03/30/2012 01:13 PM, Johannes Berg wrote:
>>>
>>> +#ifdef pr_fmt
>>> +#undef pr_fmt
>>> +#endif
>>> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
>>>
>>> #include<linux/module.h>
>>
>> Trivial remark. Not really necessary to do the #ifdef. #undef works fine
>> if pr_fmt has not been defined.
>
> Really? I thought it would give a warning then, but couldn't test it
> since it was defined for me.
>
> johannes
>
>

I made a little test program to confirm my thought, before sending my
previous email. Retried compiling with '-W -Wall -ansi -pedantic' and no
complaints about the #undef.

Gr. AvS


2012-03-30 12:28:34

by Johannes Berg

[permalink] [raw]
Subject: Re: [PATCH] compat: crc8: undef pr_fmt

On Fri, 2012-03-30 at 14:14 +0200, Arend van Spriel wrote:
> On 03/30/2012 01:54 PM, Johannes Berg wrote:
> > On Fri, 2012-03-30 at 13:49 +0200, Arend van Spriel wrote:
> >> On 03/30/2012 01:13 PM, Johannes Berg wrote:
> >>>
> >>> +#ifdef pr_fmt
> >>> +#undef pr_fmt
> >>> +#endif
> >>> #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt
> >>>
> >>> #include<linux/module.h>
> >>
> >> Trivial remark. Not really necessary to do the #ifdef. #undef works fine
> >> if pr_fmt has not been defined.
> >
> > Really? I thought it would give a warning then, but couldn't test it
> > since it was defined for me.
> >
> > johannes
> >
> >
>
> I made a little test program to confirm my thought, before sending my
> previous email. Retried compiling with '-W -Wall -ansi -pedantic' and no
> complaints about the #undef.

Ok. I'm too lazy to send a new patch, but maybe Luis wants to change it
when he applies it :)

johannes