Re: [PATCH] net/core/flow.c: compare data with memcmp

2007-01-01 Thread Daniel Marjamäki
k1, k2); printf("compare2..\n"); for (i = 0; i < NUM_REP; i++) flow_key_compare2(k1, k2); printf((flow_key_compare(k1,k2)==(flow_key_compare2(k1,k2)?1:0))?"ok\n":"error\n"); return 0; } 2007/1/1, D

Re: [PATCH] net/core/flow.c: compare data with memcmp

2007-01-01 Thread Daniel Marjamäki
); printf(compare2..\n); for (i = 0; i NUM_REP; i++) flow_key_compare2(k1, k2); printf((flow_key_compare(k1,k2)==(flow_key_compare2(k1,k2)?1:0))?ok\n:error\n); return 0; } 2007/1/1, Daniel Marjamäki [EMAIL PROTECTED]: Hello! So you mean

Re: [PATCH] net/core/flow.c: compare data with memcmp

2006-12-31 Thread Daniel Marjamäki
ki" <[EMAIL PROTECTED]> Date: Sun, 31 Dec 2006 17:37:05 +0100 > From: Daniel Marjamäki > This has been tested by me. > Signed-off-by: Daniel Marjamäki <[EMAIL PROTECTED]> Please do not do this. memcmp() cannot assume the alignment of the source and destination buffers and thu

[PATCH] net/core/flow.c: compare data with memcmp

2006-12-31 Thread Daniel Marjamäki
From: Daniel Marjamäki This has been tested by me. Signed-off-by: Daniel Marjamäki <[EMAIL PROTECTED]> --- linux-2.6.20-rc2/net/core/flow.c2006-12-27 09:59:56.0 +0100 +++ linux/net/core/flow.c 2006-12-31 18:26:06.0 +0100 @@ -144,29 +144,16 @@ typedef u32 flow_com

[PATCH] net/core/flow.c: compare data with memcmp

2006-12-31 Thread Daniel Marjamäki
From: Daniel Marjamäki This has been tested by me. Signed-off-by: Daniel Marjamäki [EMAIL PROTECTED] --- linux-2.6.20-rc2/net/core/flow.c2006-12-27 09:59:56.0 +0100 +++ linux/net/core/flow.c 2006-12-31 18:26:06.0 +0100 @@ -144,29 +144,16 @@ typedef u32 flow_compare_t

Re: [PATCH] net/core/flow.c: compare data with memcmp

2006-12-31 Thread Daniel Marjamäki
] Date: Sun, 31 Dec 2006 17:37:05 +0100 From: Daniel Marjamäki This has been tested by me. Signed-off-by: Daniel Marjamäki [EMAIL PROTECTED] Please do not do this. memcmp() cannot assume the alignment of the source and destination buffers and thus will run more slowly than that open-coded

Re: Want comments regarding patch

2006-12-28 Thread Daniel Marjamäki
Hello! Thank you for your comments. It seems to me the issue was the readability. It was my goal to improve the readability. I failed. I personally prefer to use standard functions instead of writing code. In my opinion using standard functions means less code that is easier to read. Best

Want comments regarding patch

2006-12-28 Thread Daniel Marjamäki
Hello all! I sent a patch with this content: - for (i = 0; i < MAX_PIRQS; i++) - pirq_entries[i] = -1; + memset(pirq_entries, -1, sizeof(pirq_entries)); I'd like to know if you have any comments to this change. It was of course my intention to make the code shorter,

Re: Want comments regarding patch

2006-12-28 Thread Daniel Marjamäki
Hello! Thank you for your comments. It seems to me the issue was the readability. It was my goal to improve the readability. I failed. I personally prefer to use standard functions instead of writing code. In my opinion using standard functions means less code that is easier to read. Best

Want comments regarding patch

2006-12-28 Thread Daniel Marjamäki
Hello all! I sent a patch with this content: - for (i = 0; i MAX_PIRQS; i++) - pirq_entries[i] = -1; + memset(pirq_entries, -1, sizeof(pirq_entries)); I'd like to know if you have any comments to this change. It was of course my intention to make the code shorter,