[PATCH] arch/alpha: Use ARRAY_SIZE macro
Use ARRAY_SIZE macro instead of sizeof(x)/sizeof(x[0]) and remove a duplicate of the macro. Also remove some trailing whitespaces and needless braces. Signed-off-by: Tobias Klauser <tklauser@distanz.ch> Cc: Richard Henderson <rth@twiddle.net> Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru> Signed-off-by: Andrew Morton <akpm@osdl.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
这个提交包含在:
@@ -623,12 +623,12 @@ osf_sysinfo(int command, char __user *buf, long count)
|
||||
long len, err = -EINVAL;
|
||||
|
||||
offset = command-1;
|
||||
if (offset >= sizeof(sysinfo_table)/sizeof(char *)) {
|
||||
if (offset >= ARRAY_SIZE(sysinfo_table)) {
|
||||
/* Digital UNIX has a few unpublished interfaces here */
|
||||
printk("sysinfo(%d)", command);
|
||||
goto out;
|
||||
}
|
||||
|
||||
|
||||
down_read(&uts_sem);
|
||||
res = sysinfo_table[offset];
|
||||
len = strlen(res)+1;
|
||||
|
在新工单中引用
屏蔽一个用户