Signed-off-by: Cyrill Gorcunov <gorcunov@gmail.com>
---Actually I wonder why in original code Atom processors was
_that_ aligned? Was it made with a special purpose? yes,
it's a mobile platform, but can't see any reason for such
alignment.arch/x86/kernel/ds.c | 18 +++++++++---------
1 files changed, 9 insertions(+), 9 deletions(-)diff --git a/arch/x86/kernel/ds.c b/arch/x86/kernel/ds.c
index 5b32b6d..24a323c 100644
--- a/arch/x86/kernel/ds.c
+++ b/arch/x86/kernel/ds.c
@@ -238,12 +238,12 @@ static inline struct ds_context *ds_alloc_context(struct task_struct *task)
context = kzalloc(sizeof(*context), GFP_KERNEL);if (!context)
- return 0;
+ return NULL;context->ds = kzalloc(ds_cfg.sizeof_ds, GFP_KERNEL);
if (!context->ds) {
kfree(context);
- return 0;
+ return NULL;
}*p_context = context;
@@ -279,7 +279,7 @@ static inline void ds_put_context(struct ds_context *context)
if (--context->count)
goto out;- *(context->this) = 0;
+ *(context->this) = NULL;if (context->task)
clear_tsk_thread_flag(context->task, TIF_DS_AREA_MSR);
@@ -341,16 +341,16 @@ static inline void *ds_allocate_buffer(size_t size, unsigned int *pages)
rlim = current->signal->rlim[RLIMIT_AS].rlim_cur >> PAGE_SHIFT;
vm = current->mm->total_vm + pgsz;
if (rlim < vm)
- return 0;
+ return NULL;rlim = current->signal->rlim[RLIMIT_MEMLOCK].rlim_cur >> PAGE_SHIFT;
vm = current->mm->locked_vm + pgsz;
if (rlim < vm)
- return 0;
+ return NULL;buffer = kzalloc(size, GFP_KERNEL);
if (!buffer)
- return 0;
+ return NULL;current->mm->total_vm += pgsz;
current->mm->locked_vm += pgsz;
@@ -395,7 +395,7 @@ static int ds_request(struct task_struct *task, void *base, size_t size,
if (context->owner[qual] == current)
goto out_unlock;
error = -EPERM;
- if (context->owner[qual] != 0)
+ if (context->owner[qual] != ...
Why? The constant 0 is C's official symbol for a null pointer.
--
Yes, but by using NULL explicilty allows you to separate _pointers_ from
numbers on review process. Or maybe you wanna drop NULL at all? I dont
think you will like that ;)
--
It's still bad style.
-hpa
--
I disagree, but I don't want to debate the point.
--
to me it looks like a typo, not a sign of any real bug/thinko. The
processor IDs there are a flat list.Ingo
--
Nevermind, I was looking for a *memory* alignment... :-/
-hpa
--
Oh, my fault, i had to be more concrete :(
--
I'm sorry, I don't see how this comment has anything to do with this patch?
-hpa
--
| Greg Kroah-Hartman | [PATCH 001/196] Chinese: Add the known_regression URI to the HOWTO |
| Andrew Morton | -mm merge plans for 2.6.23 |
| david | Re: Dual-Licensing Linux Kernel with GPL V2 and GPL V3 |
| Bart Van Assche | Integration of SCST in the mainstream Linux kernel |
git: | |
| Gerrit Renker | [PATCH 27/37] dccp: Integration of dynamic feature activation - part 2 (server side) |
| David Miller | Re: [PATCH] pkt_sched: Destroy gen estimators under rtnl_lock(). |
| PJ Waskiewicz | [ANNOUNCE] ixgbe: Data Center Bridging (DCB) support for ixgbe |
| David Miller | Re: [GIT]: Networking |
