Skip to contentSkip to conversation

Re: [KJ] [Fwd: Re: Taking the Min and Max macro job]

KJ Vignesh Babu BM 2 participants 2 messages Feb 8, 2007 Kernel janitors

lore
Share & tools
lore
#0 lore raw

Mehul,

I had been on this sometime back. Im not sure if u can change the
entries in xdr*.c
These files use the macro to initialize static struct where u cannot
use statements within expression.

http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

So in the xdr*.c files I think we should not change the macros or we
should be adding one more macro like the ones used in those files to kernel.h which does not perform the type check.

I had one more doubt...I had been through some other files that have
same simple MIN/MAX macros that are like those in xdr*.c. Can we include kernel.h in any of these files and remove the extra definition in those files?
Wouldnt it be better if we declare all the macros in kernel.h in a
separate file say kernel-macros.h or util-macros.h and have that included in the code than including the kernel.h itself as in a number of instances we may not need the other entries in kernel.h to be accessible in the code.

Quoted 34 lines

-------- Forwarded Message --------
From: Mehul Jani <[email protected]>
To: [email protected]
Subject: Re: [KJ] Taking the Min and Max macro job
Date: Thu, 8 Feb 2007 14:59:41 +0530

I had started the activity. changed the handcrafted MAX macro to *max* from the kernel.h in the xdr4.c file ( no quite sure of the complete file name)

the max macro is applied in struct , i changed it and recompile failed.

On 2/8/07, Alexey Dobriyan <[email protected]> wrote:
On Thu, Feb 08, 2007 at 01:51:45AM +0200, Ahmed S. Darwish wrote:
> It seems that no one is assigned the Min and Max macro job. I'll take
> it if no one seems interested.
>
> Well, I hope this to become my last brain-dead patch series :).

Be very very careful to not add integer overflows.

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

Signature · 9 lines
Regards,  
Vignesh Babu BM  
_____________________________________________________________  
"Why is it that every time I'm with you, makes me believe in magic?"

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors
#1 lore raw

Vignesh,

Thanks for pointing out that its due to the type check.

I was wondering if we can avail the facility of the macros min_t and max_t ,specifing the type as *int* defined in kernel.h

You have given you opinion about kernel_macros.h ....let hear from other people. ;-)

Mehul Jani

Quoted 70 lines · Vignesh Babu BM

Mehul,

I had been on this sometime back. Im not sure if u can change the
entries in xdr*.c
These files use the macro to initialize static struct where u
cannot
use statements within expression.

http://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

So in the xdr*.c files I think we should not change the macros or
we
should be adding one more macro like the ones used in those files to kernel.h which does not perform the type check.

I had one more doubt...I had been through some other files that
have
same simple MIN/MAX macros that are like those in xdr*.c. Can we include kernel.h in any of these files and remove the extra definition in those files?
Wouldnt it be better if we declare all the macros in kernel.h in a
separate file say kernel-macros.h or util-macros.h and have that included in the code than including the kernel.h itself as in a number of instances we may not need the other entries in kernel.h to be accessible in the code.

Quoted 30 lines

-------- Forwarded Message --------
From: Mehul Jani <[email protected]>
To: [email protected]
Subject: Re: [KJ] Taking the Min and Max macro job
Date: Thu, 8 Feb 2007 14:59:41 +0530

I had started the activity. changed the handcrafted MAX macro to *max* from the kernel.h in the xdr4.c file ( no quite sure of the complete file name)

the max macro is applied in struct , i changed it and recompile failed.

On 2/8/07, Alexey Dobriyan <[email protected]> wrote:
On Thu, Feb 08, 2007 at 01:51:45AM +0200, Ahmed S. Darwish wrote:
> It seems that no one is assigned the Min and Max macro job. I'll take
> it if no one seems interested.
>
> Well, I hope this to become my last brain-dead patch series :).

Be very very careful to not add integer overflows.

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

Quoted 4 lines

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors

--
Regards,
Vignesh Babu BM
_____________________________________________________________
"Why is it that every time I'm with you, makes me believe in magic?"

Quoted 11 lines

The information contained in this electronic message and any attachments to this message are intended for the exclusive use of the addressee(s) and may contain proprietary, confidential or privileged information. If you are not the intended recipient, you should not disseminate, distribute or copy this e-mail. Please notify the sender immediately and destroy all copies of
this message and any attachments. WARNING: Computer viruses can be
transmitted via email. The recipient should check this email and any attachments for the presence of viruses. The company accepts no liability for any damage caused by any virus transmitted by this email. www.wipro.com

_______________________________________________
Kernel-janitors mailing list
[email protected]
https://lists.osdl.org/mailman/listinfo/kernel-janitors