public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: "Serge E. Hallyn" <serue@us.ibm.com>
To: Andrew Morton <akpm@linux-foundation.org>
Cc: Alexey Dobriyan <adobriyan@gmail.com>,
	clg@fr.ibm.com, linux-kernel@vger.kernel.org,
	containers@lists.osdl.org
Subject: Re: [PATCH 4/4] mqueue namespace: adapt sysctl
Date: Tue, 24 Feb 2009 17:23:03 -0600	[thread overview]
Message-ID: <20090224232303.GA1435@us.ibm.com> (raw)
In-Reply-To: <20090224144800.4c7e3fcb.akpm@linux-foundation.org>

Quoting Andrew Morton (akpm@linux-foundation.org):
> On Wed, 25 Feb 2009 01:32:45 +0300
> Alexey Dobriyan <adobriyan@gmail.com> wrote:
> 
> > > > +proc_handler *proc_mq_dointvec = NULL;
> > > > +proc_handler *proc_mq_dointvec_minmax = NULL;
> > > > +#endif
> > > 
> > > looks odd.  Was this
> > > 
> > > --- a/ipc/mq_sysctl.c~mqueue-namespace-adapt-sysctl-update-fix
> > > +++ a/ipc/mq_sysctl.c
> > > @@ -52,8 +52,8 @@ static int proc_mq_dointvec_minmax(ctl_t
> > >  					lenp, ppos);
> > >  }
> > >  #else
> > > -proc_handler *proc_mq_dointvec = NULL;
> > > -proc_handler *proc_mq_dointvec_minmax = NULL;
> > > +#define proc_mq_dointvec NULL
> > > +#define proc_mq_dointvec_minmax NULL
> > >  #endif
> > 
> > I hope, not.
> > 
> > "#define foo NULL" is the least intrusive thing.
> 
> well the original code would have spat a warning at compile time
> then tried to execute code from BSS at runtime, methinks.
> 
> But I can't be assed working out how to disable CONFIG_SYSCTL to
> test that.  Gawd I hate `select'.

Yeah that's a pain...  but so I tested it with the below userspace
program before sending the patch and the 'if (myhandler)' check (which
is analogous to the check in proc_sys_call_handler) worked as expected.

thanks,
-serge

#include <stdio.h>

typedef int proc_handler (int a, int b);

#ifdef FOO
int myhandler(int a, int b) {
	printf("a was %d b was %d\n", a, b);
}
#else
proc_handler *myhandler = NULL;
#endif

int main()
{
	if (myhandler)
		myhandler(1, 2);
}

  reply	other threads:[~2009-02-24 23:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-24 22:02 [PATCH 4/4] mqueue namespace: adapt sysctl Serge E. Hallyn
2009-02-24 22:16 ` Andrew Morton
2009-02-24 22:32   ` Serge E. Hallyn
2009-02-24 22:32   ` Alexey Dobriyan
2009-02-24 22:48     ` Andrew Morton
2009-02-24 23:23       ` Serge E. Hallyn [this message]
  -- strict thread matches above, loose matches on Subject: below --
2009-02-24  3:03 [PATCH 1/4] move proc_net_get_sb to a generic fs/super.c helper Serge E. Hallyn
2009-02-24  3:09 ` [PATCH 4/4] mqueue namespace: adapt sysctl Serge E. Hallyn
2009-02-24  4:35   ` Alexey Dobriyan
2009-02-24  8:25     ` Cedric Le Goater

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20090224232303.GA1435@us.ibm.com \
    --to=serue@us.ibm.com \
    --cc=adobriyan@gmail.com \
    --cc=akpm@linux-foundation.org \
    --cc=clg@fr.ibm.com \
    --cc=containers@lists.osdl.org \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox