ANDROID: sdcardfs: Fix style issues in macros
authorDaniel Rosenberg <drosen@google.com>
Wed, 22 Mar 2017 02:11:38 +0000 (19:11 -0700)
committerStricted <info@stricted.net>
Thu, 11 Oct 2018 16:03:34 +0000 (18:03 +0200)
Signed-off-by: Daniel Rosenberg <drosen@google.com>
Bug: 35331000
Change-Id: I89c4035029dc2236081a7685c55cac595d9e7ebf

fs/sdcardfs/packagelist.c
fs/sdcardfs/sdcardfs.h

index 7f8c9e247f213c71fb1d9c4a9377481f99458348..27205cdb8cada83423a7944541aac7646eeacc72 100644 (file)
@@ -488,7 +488,7 @@ static inline struct package_details *to_package_details(struct config_item *ite
 CONFIGFS_ATTR_STRUCT(package_details);
 #define PACKAGE_DETAILS_ATTR(_name, _mode, _show, _store)      \
 struct package_details_attribute package_details_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store)
-#define PACKAGE_DETAILS_ATTRIBUTE(name) &package_details_attr_##name.attr
+#define PACKAGE_DETAILS_ATTRIBUTE(name) (&package_details_attr_##name.attr)
 
 static ssize_t package_details_appid_show(struct package_details *package_details,
                                      char *page)
@@ -738,7 +738,7 @@ CONFIGFS_ATTR_STRUCT(packages);
 #define PACKAGES_ATTR(_name, _mode, _show, _store)     \
 struct packages_attribute packages_attr_##_name = __CONFIGFS_ATTR(_name, _mode, _show, _store)
 #define PACKAGES_ATTR_RO(_name, _show) \
-struct packages_attribute packages_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show);
+struct packages_attribute packages_attr_##_name = __CONFIGFS_ATTR_RO(_name, _show)
 
 static struct config_item *packages_make_item(struct config_group *group, const char *name)
 {
index 53fcd23f467fbccc61a9170f9ec18856ec67dc7b..41483adc852a26be76c265e0c3961f600f3b1f51 100644 (file)
  * placed at the beginning of a function, right after variable declaration.
  */
 #define OVERRIDE_CRED(sdcardfs_sbi, saved_cred, info)          \
-       saved_cred = override_fsids(sdcardfs_sbi, info);        \
-       if (!saved_cred) { return -ENOMEM; }
+       do {    \
+               saved_cred = override_fsids(sdcardfs_sbi, info);        \
+               if (!saved_cred)        \
+                       return -ENOMEM; \
+       } while (0)
 
 #define OVERRIDE_CRED_PTR(sdcardfs_sbi, saved_cred, info)      \
-       saved_cred = override_fsids(sdcardfs_sbi, info);        \
-       if (!saved_cred) { return ERR_PTR(-ENOMEM); }
+       do {    \
+               saved_cred = override_fsids(sdcardfs_sbi, info);        \
+               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