All of lore.kernel.org
 help / color / mirror / Atom feed
From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
To: David Laight <David.Laight@aculab.com>
Cc: 'Willy Tarreau' <w@1wt.eu>, Guenter Roeck <linux@roeck-us.net>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"akpm@linux-foundation.org" <akpm@linux-foundation.org>,
	"torvalds@linux-foundation.org" <torvalds@linux-foundation.org>,
	"stable@vger.kernel.org" <stable@vger.kernel.org>,
	"lwn@lwn.net" <lwn@lwn.net>, "jslaby@suse.cz" <jslaby@suse.cz>,
	"shuah@kernel.org" <shuah@kernel.org>,
	"patches@kernelci.org" <patches@kernelci.org>,
	"lkft-triage@lists.linaro.org" <lkft-triage@lists.linaro.org>,
	"pavel@denx.de" <pavel@denx.de>,
	"jonathanh@nvidia.com" <jonathanh@nvidia.com>
Subject: Re: Linux 4.4.256
Date: Mon, 8 Feb 2021 10:44:20 +0100	[thread overview]
Message-ID: <YCEH9Fwp2vzlyONO@kroah.com> (raw)
In-Reply-To: <7f4be7044f4a4c77ad101d7e3ac71b40@AcuMS.aculab.com>

On Mon, Feb 08, 2021 at 09:38:05AM +0000, David Laight wrote:
> From: David Laight
> > Sent: 08 February 2021 09:10
> > 
> > From: Willy Tarreau
> > > Sent: 06 February 2021 13:23
> > >
> > > On Sat, Feb 06, 2021 at 02:11:13PM +0100, Willy Tarreau wrote:
> > > > Something like this looks more robust to me, it will use SUBLEVEL for
> > > > values 0 to 255 and 255 for any larger value:
> > >
> > > diff --git a/Makefile b/Makefile
> > > index 7d86ad6ad36c..9b91b8815b40 100644
> > > --- a/Makefile
> > > +++ b/Makefile
> > > @@ -1252,7 +1252,7 @@ endef
> > >
> > >  define filechk_version.h
> > >  	echo \#define LINUX_VERSION_CODE $(shell                         \
> > > -	expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 0$(SUBLEVEL)); \
> > > +	expr $(VERSION) \* 65536 + 0$(PATCHLEVEL) \* 256 + 255 \* \( 0$(SUBLEVEL) \> 255 \) +
> > > 0$(SUBLEVEL) \* \( 0$(SUBLEVEL) \<= 255 \) ); \
> > >  	echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + (c))'
> > >  endef
> > 
> > Why not:
> > 	$(shell echo $$(($(VERSION)<<16 + $(PATCHLEVEL)<<8 + ($(SUBVERSION) < 255 ? $(SUBVERSION) :
> > 255))))
> > Untested, but I think only the one $ needs any kind of escape.
> > The extra leading zeros do have to go - $((...)) does octal :-(
> 
> Or probably even better:
> 
> echo '#define KERNEL_VERSION(a,b,c) (((a) << 16) + ((b) << 8) + ((c) > 255 ? 255 : (c)))'
> echo '#define LINUX_VERSION_CODE KERNEL_VERSION($(VERSION), $(PATCHLEVEL)+0, $(SUBLEVEL)+0)'
> 
> Which gets rid of the $(shell) as well.

Please comment on the real patch already submitted by Sasha for this.

thanks,

greg k-h

      reply	other threads:[~2021-02-08  9:55 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-02-05 14:26 Linux 4.4.256 Greg Kroah-Hartman
2021-02-05 14:26 ` Greg Kroah-Hartman
2021-02-05 20:56 ` Guenter Roeck
2021-02-06 13:00   ` Greg Kroah-Hartman
2021-02-06 13:11     ` Willy Tarreau
2021-02-06 13:19       ` Greg Kroah-Hartman
2021-02-06 13:24         ` Willy Tarreau
2021-02-06 13:22       ` Willy Tarreau
2021-02-06 16:59         ` Guenter Roeck
2021-02-06 18:13           ` Greg Kroah-Hartman
2021-02-06 18:49             ` Guenter Roeck
2021-02-07  8:22               ` Greg Kroah-Hartman
2021-02-08 17:14                 ` Guenter Roeck
2021-02-08 17:20                   ` Greg Kroah-Hartman
2021-02-08  9:09         ` David Laight
2021-02-08  9:38           ` David Laight
2021-02-08  9:44             ` Greg Kroah-Hartman [this message]

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=YCEH9Fwp2vzlyONO@kroah.com \
    --to=gregkh@linuxfoundation.org \
    --cc=David.Laight@aculab.com \
    --cc=akpm@linux-foundation.org \
    --cc=jonathanh@nvidia.com \
    --cc=jslaby@suse.cz \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux@roeck-us.net \
    --cc=lkft-triage@lists.linaro.org \
    --cc=lwn@lwn.net \
    --cc=patches@kernelci.org \
    --cc=pavel@denx.de \
    --cc=shuah@kernel.org \
    --cc=stable@vger.kernel.org \
    --cc=torvalds@linux-foundation.org \
    --cc=w@1wt.eu \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.