Re: vm_flags, vm_flags_t and __nocast

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



David Rientjes wrote:
> On Fri, 24 Jul 2015, Kirill A. Shutemov wrote:
> 
> > sparse complains on each and every vm_flags_t initialization, even with
> > proper VM_* constants.
> > 
> > Do we really want to fix that?
> > 
> > To me it's too much pain and no gain. __nocast is not beneficial here.
> > 
> > And I'm not sure that vm_flags_t typedef was a good idea after all.
> > Originally, it was intended to become 64-bit one day, but four years later
> > it's still unsigned long. Plain unsigned long works fine for other bit
> > field.
> > 
> > What is special about vm_flags?
> > 
> 
> Maybe remove the __nocast until it's a different type?  Seems like all 
> these sites would have to be audited when that happens anyway.

>From f690ec43103e55d0ed533fc977f9ac3cfa29d8f6 Mon Sep 17 00:00:00 2001
From: "Kirill A. Shutemov" <kirill.shutemov@xxxxxxxxxxxxxxx>
Date: Mon, 3 Aug 2015 18:49:18 +0300
Subject: [PATCH] mm: drop __nocast from vm_flags_t definition

__nocast does no good for vm_flags_t. It only produces useless sparse
warnings.

Let's drop it.

Signed-off-by: Kirill A. Shutemov <kirill.shutemov@xxxxxxxxxxxxxxx>
---
 include/linux/mm_types.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 1fb4e46a1736..b9134cc27c4d 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -226,7 +226,7 @@ struct page_frag {
 #endif
 };
 
-typedef unsigned long __nocast vm_flags_t;
+typedef unsigned long vm_flags_t;
 
 /*
  * A region containing a mapping of a non-memory backed file under NOMMU
-- 
2.4.6

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in
the body to majordomo@xxxxxxxxx.  For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"dont@xxxxxxxxx";> email@xxxxxxxxx </a>



[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]