Re: [PATCH] parse_table() earlier check.

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: <adobriyan@...>
Cc: <linux-kernel@...>
Date: Sunday, July 22, 2007 - 1:04 am

Alexey Dobriyan wrote:

Excuse me, but I didn't understand what you are worrying.
I'm saying that:
  If n == 0, the condition "if (n == table->ctl_name)" is always false
  because of previous "if (!table->ctl_name) continue;" statement
  regardless of the result whether ->ctl_name and/or ->procname are valid or not.
  Thus, they always return -ENOTDIR if n == 0.
Why this optimization destroys something?
Should "if (!table->ctl_name)" be
 	for ( ; table->ctl_name || table->procname; table++) {
-		if (!table->ctl_name)
+		if (!table->procname)
 			continue;
 		if (n == table->ctl_name) {
 			int error;
 			if (table->child) {
or something?

Regards.
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH] parse_table() earlier check., Tetsuo Handa, (Thu Jul 19, 11:37 pm)
Re: [PATCH] parse_table() earlier check., Alexey Dobriyan, (Sat Jul 21, 3:29 pm)
Re: [PATCH] parse_table() earlier check., Tetsuo Handa, (Sun Jul 22, 1:04 am)