Re: [PATCH] af_key: suppress a warning for 64k pages.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <sfr@...>
Cc: <netdev@...>, <linux-kernel@...>
Date: Wednesday, October 31, 2007 - 12:42 am

From: Stephen Rothwell <sfr@canb.auug.org.au>
Date: Wed, 31 Oct 2007 15:34:22 +1100


It seems if you break the comparison out into a function which
takes a u32, that's enough to get rid of the warning.

I can't figure out a way to make this prettier, can you?

#define PAGE_SIZE	(64 * 1024)

typedef unsigned int u32;
typedef unsigned short u16;

int compare(u32 val)
{
	if (val >= PAGE_SIZE)
		return -1;
	return 0;
}

int foo(u16 val)
{
#if 1
	return compare(val);
#else
	if (val >= PAGE_SIZE)
		return -1;
	return 0;
#endif
}
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Tue Oct 30, 11:59 pm)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Wed Oct 31, 12:08 am)
Re: [PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Wed Oct 31, 12:34 am)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Wed Oct 31, 12:42 am)
[PATCH] af_key: suppress a warning for 64k pages., Stephen Rothwell, (Wed Oct 31, 1:24 am)
Re: [PATCH] af_key: suppress a warning for 64k pages., David Miller, (Wed Oct 31, 2:58 am)