From: yangsheng Date: Thu, 22 Mar 2012 02:16:14 +0000 (+0800) Subject: LU-506 kernel: remove unnecessary memset from autoconf test X-Git-Tag: 2.2.51~20 X-Git-Url: https://git.whamcloud.com/?p=fs%2Flustre-release.git;a=commitdiff_plain;h=931ae518f564c2ea16677f176dbaa0da2c28897a LU-506 kernel: remove unnecessary memset from autoconf test Eliminate memset() usage from config check. It may introduces its own compiler error on some systems. Signed-off-by: yang sheng Change-Id: I1e6eae772782b3dbeab75230bfa41e781c4c4028 Reviewed-on: http://review.whamcloud.com/2336 Tested-by: Maloo Reviewed-by: Jinshan Xiong Tested-by: Hudson Reviewed-by: Oleg Drokin --- diff --git a/lustre/autoconf/lustre-core.m4 b/lustre/autoconf/lustre-core.m4 index 4818462..9c84f41 100644 --- a/lustre/autoconf/lustre-core.m4 +++ b/lustre/autoconf/lustre-core.m4 @@ -1400,8 +1400,7 @@ LB_LINUX_TRY_COMPILE([ #include #endif ],[ - struct export_operations exp; - memset(exp.fh_to_dentry, 0, sizeof(exp.fh_to_dentry)); + do{ }while(sizeof(((struct export_operations *)0)->fh_to_dentry)); ], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_FH_TO_DENTRY, 1, @@ -1449,11 +1448,9 @@ LB_LINUX_TRY_COMPILE([ #include #include ],[ - struct path path; struct fs_struct fs; - fs.pwd = path; - memset(&fs, 0, sizeof(fs)); + fs.pwd = *((struct path *)sizeof(fs)); ], [ AC_MSG_RESULT([yes]) AC_DEFINE(HAVE_FS_STRUCT_USE_PATH, 1, @@ -2064,8 +2061,7 @@ AC_DEFUN([LC_REQUEST_QUEUE_UNPLUG_FN], LB_LINUX_TRY_COMPILE([ #include ],[ - struct request_queue rq; - memset(rq.unplug_fn, 0, sizeof(rq.unplug_fn)); + do{ }while(sizeof(((struct request_queue *)0)->unplug_fn)); ],[ AC_DEFINE(HAVE_REQUEST_QUEUE_UNPLUG_FN, 1, [request_queue has unplug_fn field])