ANDROID: sdcardfs: Fix style issues in macros
authorDaniel Rosenberg <drosen@google.com>
Wed, 22 Mar 2017 02:11:38 +0000 (19:11 -0700)
committerAmit Pundir <amit.pundir@linaro.org>
Mon, 10 Apr 2017 07:42:16 +0000 (13:12 +0530)
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35331000
Change-Id: I89c4035029dc2236081a7685c55cac595d9e7ebf

fs/sdcardfs/sdcardfs.h

index a9c5a8345d09675129a3076f97ecde8d9a41a90b..2b67b9a8ef9f77d54d39a146c794ead23d457347 100644 (file)
  * placed at the beginning of a function, right after variable declaration.
  */
 #define OVERRIDE_CRED(sdcardfs_sbi, saved_cred, info)          \
+       do {    \
        saved_cred = override_fsids(sdcardfs_sbi, info);        \
-       if (!saved_cred) { return -ENOMEM; }
+       if (!saved_cred)        \
+               return -ENOMEM; \
+       } while (0)
 
 #define OVERRIDE_CRED_PTR(sdcardfs_sbi, saved_cred, info)      \
+       do {    \
        saved_cred = override_fsids(sdcardfs_sbi, info);        \
-       if (!saved_cred) { return ERR_PTR(-ENOMEM); }
+       if (!saved_cred)        \
+               return ERR_PTR(-ENOMEM);        \
+       } while (0)
 
 #define REVERT_CRED(saved_cred)        revert_fsids(saved_cred)
 
-#define DEBUG_CRED()           \
-       printk("KAKJAGI: %s:%d fsuid %d fsgid %d\n",    \
-               __FUNCTION__, __LINE__,                 \
-               (int)current->cred->fsuid,              \
-               (int)current->cred->fsgid);
-
 /* Android 5.0 support */
 
 /* Permission mode for a specific node. Controls how file permissions