linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Joakim Tjernlund <Joakim.Tjernlund@infinera.com>
To: "greg@kroah.com" <greg@kroah.com>
Cc: "linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>
Subject: Re: [PATCH 1/2] Correct function definition for C++
Date: Wed, 22 Feb 2017 14:00:53 +0000	[thread overview]
Message-ID: <1487772051.5760.20.camel@infinera.com> (raw)
In-Reply-To: <20170222130318.GB15769@kroah.com>

On Wed, 2017-02-22 at 14:03 +0100, greg@kroah.com wrote:
> On Wed, Feb 22, 2017 at 07:50:46AM +0000, Joakim Tjernlund wrote:
> > On Wed, 2017-02-22 at 08:10 +0100, Greg KH wrote:
> > > On Tue, Feb 21, 2017 at 04:24:04PM +0100, Joakim Tjernlund wrote:
> > > > C++ does does not like the extra extern before asmlinkage, remove it.
> > > > 
> > > > Signed-off-by: Joakim Tjernlund <joakim.tjernlund@infinera.com>
> > > > ---
> > > >  include/linux/printk.h | 4 ++--
> > > >  1 file changed, 2 insertions(+), 2 deletions(-)
> > > > 
> > > > diff --git a/include/linux/printk.h b/include/linux/printk.h
> > > > index 3472cc6..be823f5 100644
> > > > --- a/include/linux/printk.h
> > > > +++ b/include/linux/printk.h
> > > 
> > > 
> > > Why are you building this file with a C++ compiler?
> > 
> > virtualbox uses C++ and includes various kernel headers and the build
> > fails, virtualbox guest additions has not build for quite some time now and
> > this is one of the problems.
> 
> Virtualbox is a horrid pile of crap.  You can quote me on that.  We
> don't care about out-of-tree drivers, the authors should work to get
> them merged properly if they do care.

Sure, I believe you :)
 
But in this case it is not the kernel modules that fails, it is their
guest additions/xf86 video driver. Seem like that these need to include some
kernel herders there too.

> 
> Kernel code should be C, not C++, and if you do want to use C++, then
> you are on your own, sorry.

But there are already a lot of C++ adjustments!? Just grepping for __cplusplus shows
plenty of hits and what is the point of asmlinkage then:
#ifdef __cplusplus
#define CPP_ASMLINKAGE extern "C"
#else
#define CPP_ASMLINKAGE
#endif

#ifndef asmlinkage
#define asmlinkage CPP_ASMLINKAGE
#endif

I read all of this that C++ code should be able to at least include kernel headers
without fatal errors. 
You don't agree? In that case all __cplusplus/asmlinkage should be removed?

> 
> > > Also, this is not the correct way to submit patches for inclusion in the
> > > stable kernel tree.  Please read Documentation/stable_kernel_rules.txt
> > > for how to do this properly.
> > 
> > Sorry, I was in a hurry(lazy:) so I just included stable directly as
> > I know it needs to be fixed in 4.9 as well.
> 
> But that's not how to get a patch into the stable tree :(
> 
> sorry,

Right, my mistake. No need to be sorry, I got what I deserved :)

 Jocke

> 
> greg k-h

  reply	other threads:[~2017-02-22 14:01 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-02-21 15:24 [PATCH 1/2] Correct function definition for C++ Joakim Tjernlund
2017-02-21 15:24 ` [PATCH 2/2] compiler.h: fix C++ uninitialized const issue Joakim Tjernlund
2017-02-22  7:10 ` [PATCH 1/2] Correct function definition for C++ Greg KH
2017-02-22  7:50   ` Joakim Tjernlund
2017-02-22 13:03     ` greg
2017-02-22 14:00       ` Joakim Tjernlund [this message]
2017-02-22 14:22         ` greg
2017-02-22 16:25           ` Joakim Tjernlund
2017-02-28 23:15     ` Thomas Backlund

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=1487772051.5760.20.camel@infinera.com \
    --to=joakim.tjernlund@infinera.com \
    --cc=greg@kroah.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=stable@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;
as well as URLs for NNTP newsgroup(s).