x86: ds.c fix invalid assignment
PATCH 1/1 x86: ds.c fix invalid assignment
Fixes following sparse warnings:
CHECK arch/x86/kernel/ds.carch/x86/kernel/ds.c:549:19: warning: incorrect type in argument 2 (invalid types)arch/x86/kernel/ds.c:549:19: expected bad type enum bts_field fieldarch/x86/kernel/ds.c:549:19: got intarch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:520:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:520:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:520:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
--- arch/x86/kernel/ds.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/ds.c +3 -3
@@ -509,15 +509,15 @@ enum bts_field { bts_escape = ((unsigned long)-1 & ~bts_qual_mask) }; -static inline unsigned long bts_get (const char *base,enum bts_field field) +static inline unsigned long bts_get (const char *base,unsigned long field) { base += (ds_cfg.sizeof_ptr_field * field);return *(unsigned long *)base; } -static inline void bts_set (char *base,enum bts_field field,unsigned long val) +static inline void bts_set (char *base,unsigned long field,unsigned long val) { - base += (ds_cfg.sizeof_ptr_field * field);; + base += (ds_cfg.sizeof_ptr_field * field); (*(unsigned long *)base) = val; }
Signature · 1 line
1.6.0.6
RFC PATCH 1/1 x86: ds.c fix invalid assignment
Fixes following sparse warnings:
CHECK arch/x86/kernel/ds.carch/x86/kernel/ds.c:549:19: warning: incorrect type in argument 2 (invalid types)arch/x86/kernel/ds.c:549:19: expected bad type enum bts_field fieldarch/x86/kernel/ds.c:549:19: got intarch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:520:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:520:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:520:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
--- arch/x86/kernel/ds.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/ds.c +3 -3
@@ -509,15 +509,15 @@ enum bts_field { bts_escape = ((unsigned long)-1 & ~bts_qual_mask) }; -static inline unsigned long bts_get (const char *base,enum bts_field field) +static inline unsigned long bts_get (const char *base,unsigned long field) { base += (ds_cfg.sizeof_ptr_field * field);return *(unsigned long *)base; } -static inline void bts_set (char *base,enum bts_field field,unsigned long val) +static inline void bts_set (char *base,unsigned long field,unsigned long val) { - base += (ds_cfg.sizeof_ptr_field * field);; + base += (ds_cfg.sizeof_ptr_field * field); (*(unsigned long *)base) = val; }
Signature · 1 line
1.6.0.6
Commit-ID: feaa0457ec8351cae855edc9a3052ac49322538e Gitweb: http://git.kernel.org/tip/feaa0457ec8351cae855edc9a3052ac49322538e Author: Jaswinder Singh Rajput <[email protected]> AuthorDate: Sat, 20 Jun 2009 16:15:40 +0530 Committer: Ingo Molnar <[email protected]> CommitDate: Sat, 20 Jun 2009 17:53:13 +0200
x86: ds.c fix invalid assignment
Fixes the type mixups that cause the following sparse warnings:
CHECK arch/x86/kernel/ds.carch/x86/kernel/ds.c:549:19: warning: incorrect type in argument 2 (invalid types)arch/x86/kernel/ds.c:549:19: expected bad type enum bts_field fieldarch/x86/kernel/ds.c:549:19: got intarch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:514:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:514:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:514:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:514:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)arch/x86/kernel/ds.c:520:35: left side has type unsigned char static [unsigned] [toplevel] sizeof_ptr_fieldarch/x86/kernel/ds.c:520:35: right side has type bad type enum bts_field fieldarch/x86/kernel/ds.c:520:7: error: invalid assignment arch/x86/kernel/ds.c:520:35: error: incompatible types for operation (*)
LKML-Reference: <[email protected]>
--- arch/x86/kernel/ds.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-)
arch/x86/kernel/ds.c +3 -3
@@ -509,15 +509,15 @@ enum bts_field { bts_escape = ((unsigned long)-1 & ~bts_qual_mask) }; -static inline unsigned long bts_get (const char *base,enum bts_field field) +static inline unsigned long bts_get (const char *base,unsigned long field) { base += (ds_cfg.sizeof_ptr_field * field);return *(unsigned long *)base; } -static inline void bts_set (char *base,enum bts_field field,unsigned long val) +static inline void bts_set (char *base,unsigned long field,unsigned long val) { - base += (ds_cfg.sizeof_ptr_field * field);; + base += (ds_cfg.sizeof_ptr_field * field); (*(unsigned long *)base) = val; }