lkml.org 
[lkml]   [2011]   [Apr]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 1/3] mm: add __nocast attribute to vm_flags
Date
> > On Tue, Apr 12, 2011 at 10:12 AM, KOSAKI Motohiro
> > <kosaki.motohiro@jp.fujitsu.com> wrote:
> > > After next year? All developers don't have to ignore compiler warnings!
> >
> > At least add vm_flags_t which is sparse-checked, just like we do with gfp_t.
>
> Good idea.

Alexy, I have to deeply thank you. Your suggestion help to find two
hidden vm_flags usage. (I'll post them as reply of this mail)

Now, i386 allyesconfig build doesn't detect nocast violation. Then, I
believe we don't have a big overlooking anymore.



From 254787536ac871d313a02db5dfe8c539e0bbf605 Mon Sep 17 00:00:00 2001
From: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
Date: Wed, 13 Apr 2011 09:26:37 +0900
Subject: [PATCH 1/3] mm: add __nocast attribute to vm_flags

Now, We are converting vm_flags to 64bit. so nocast attribute help to
find hidden wrong vm_flags usage.

Suggested-by: Alexey Dobriyan <adobriyan@gmail.com>
Signed-off-by: KOSAKI Motohiro <kosaki.motohiro@jp.fujitsu.com>
---
include/linux/mm_types.h | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/include/linux/mm_types.h b/include/linux/mm_types.h
index 4b0b990..ca01ab2 100644
--- a/include/linux/mm_types.h
+++ b/include/linux/mm_types.h
@@ -109,7 +109,7 @@ struct page {
*/
struct vm_region {
struct rb_node vm_rb; /* link in global region tree */
- unsigned long long vm_flags; /* VMA vm_flags */
+ unsigned long long __nocast vm_flags; /* VMA vm_flags */
unsigned long vm_start; /* start address of region */
unsigned long vm_end; /* region initialised to here */
unsigned long vm_top; /* region allocated to here */
@@ -137,7 +137,7 @@ struct vm_area_struct {
struct vm_area_struct *vm_next, *vm_prev;

pgprot_t vm_page_prot; /* Access permissions of this VMA. */
- unsigned long long vm_flags; /* Flags, see mm.h. */
+ unsigned long long __nocast vm_flags; /* Flags, see mm.h. */

struct rb_node vm_rb;

--
1.7.3.1




\
 
 \ /
  Last update: 2011-04-13 04:23    [W:0.073 / U:1.448 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site