lkml.org 
[lkml]   [2011]   [Nov]   [25]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH v7 3.2-rc2 9/30] uprobes: Background page replacement.
From
Date
On Fri, 2011-11-18 at 16:38 +0530, Srikar Dronamraju wrote:
> + /* poke the new insn in, ASSUMES we don't cross page boundary */
> + vaddr &= ~PAGE_MASK;
> + memcpy(vaddr_new + vaddr, &opcode, uprobe_opcode_sz);

I still don't get why you don't simply write something like:

BUG_ON(vaddr + uprobe_opcode_size >= PAGE_SIZE);

That's as descriptive as the comment and actually does something if
someone got it wrong, instead of silently corrupting crap.



\
 
 \ /
  Last update: 2011-11-25 15:31    [from the cache]
©2003-2011 Jasper Spaans