tomoyo: fix clang pointer arithmetic warning
[sfrench/cifs-2.6.git] / security / tomoyo / securityfs_if.c
index 546281c5b233afb4a91968d524bffceeba9f96d4..065f4941c4d8c0c9766923a0ba68b014feebd1b7 100644 (file)
@@ -131,8 +131,8 @@ static const struct file_operations tomoyo_self_operations = {
  */
 static int tomoyo_open(struct inode *inode, struct file *file)
 {
-       const int key = ((u8 *) file_inode(file)->i_private)
-               - ((u8 *) NULL);
+       const u8 key = (uintptr_t) file_inode(file)->i_private;
+
        return tomoyo_open_control(key, file);
 }
 
@@ -223,7 +223,7 @@ static const struct file_operations tomoyo_operations = {
 static void __init tomoyo_create_entry(const char *name, const umode_t mode,
                                       struct dentry *parent, const u8 key)
 {
-       securityfs_create_file(name, mode, parent, ((u8 *) NULL) + key,
+       securityfs_create_file(name, mode, parent, (void *) (uintptr_t) key,
                               &tomoyo_operations);
 }