lkml.org 
[lkml]   [2011]   [Oct]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] kdump: Add udev events for memory online/offline
From
Date
On Fri, 2011-10-28 at 15:41 -0700, Andrew Morton wrote:
> > + } else if (!strncmp(buf, "offline", min((int)count, 7))) {
> > ret = memory_block_change_state(mem, MEM_OFFLINE, MEM_ONLINE);
> > -
> > + if (ret == 0)
> > + kobject_uevent(&dev->kobj, KOBJ_OFFLINE);
> > + }
>
> ot: what on earth is up with that min() thing which
> Dave-who-doesn't-know-about-min_t added to the strncmp() calls?

My first reaction was, "that's not my code!", but git seems to disagree
with me. So I'll go and blame it on being young and stupid in 2005.

Reading it, I also think it's probably buggy.

echo -n "o" > state

would be interesting. I think it'll fall in to the 'online' case.
While probably not that common, it's certainly unexpected. I'll send a
patch to fix it up.

-- Dave



\
 
 \ /
  Last update: 2011-10-29 00:59    [W:0.110 / U:0.144 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site