All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jonas Gorski <jonas.gorski@gmail.com>
To: Hauke Mehrtens <hauke@hauke-m.de>
Cc: mcgrof@gmail.com, lrodriguez@atheros.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH 3/9] compat-wireless: add support for kernel 3.XX
Date: Fri, 3 Jun 2011 11:07:29 +0200	[thread overview]
Message-ID: <BANLkTi=rfmTtb7ttTQQXskA8bkTewLAUrw@mail.gmail.com> (raw)
In-Reply-To: <1307032525-18916-4-git-send-email-hauke@hauke-m.de>

Hi,

On 2 June 2011 18:35, Hauke Mehrtens <hauke@hauke-m.de> wrote:
> --- a/scripts/gen-compat-autoconf.sh
> +++ b/scripts/gen-compat-autoconf.sh
> @@ -155,6 +155,14 @@ for i in $(egrep '^CONFIG_|^ifdef CONFIG_|^ifndef CONFIG_|^endif #CONFIG_|^else
>                echo "#$i" | sed -e 's/+/ /' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_26\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,\2))/' -e 's/\(#ifndef \)\(CONFIG_[^:space:]*\)/#if !defined(\2) && !defined(\2_MODULE)/'
>                continue
>                ;;
> +       'ifdef+CONFIG_'* )
> +               echo "#$i" | sed -e 's/+/ /' -e 's/\(ifdef CONFIG_COMPAT_KERNEL_3\)\([0-9]*\)/if (LINUX_VERSION_CODE < KERNEL_VERSION(3,\2,0))/' -e 's/\(#ifdef \)\(CONFIG_[^:space:]*\)/#if defined(\2) || defined(\2_MODULE)/'
> +               continue
> +               ;;
> +       'ifndef+CONFIG_'* )
> +               echo "#$i" | sed -e 's/+/ /' -e 's/\(ifndef CONFIG_COMPAT_KERNEL_3\)\([0-9]*\)/if (LINUX_VERSION_CODE >= KERNEL_VERSION(3,\2,0))/' -e 's/\(#ifndef \)\(CONFIG_[^:space:]*\)/#if !defined(\2) && !defined(\2_MODULE)/'
> +               continue
> +               ;;

I admit, I don't have much shell script experience, but I'm surprised
that having the same case multiple times works.
I would probably just add the -e ' ... KERNEL_3\... ' part to the
original sed lines (they are already much too long anyway ;-).

>        'else+#CONFIG_'* | 'endif+#CONFIG_'* )
>                echo "#$i */" |sed -e 's/+#/ \/* /g'
>                continue
> @@ -184,7 +192,12 @@ done
>  # Deal with special cases. CONFIG_MAC80211_QOS is such a case.
>  # We handle this specially for different kernels we support.
>  if [ -f $KLIB_BUILD/Makefile ]; then
> -       SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
> +       MAJORLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^\([0-9]\)\..*/\1/p')
> +       if [ $MAJORLEVEL -eq 2 ]; then
> +               SUBLEVEL=$(make -C $KLIB_BUILD kernelversion | sed -n 's/^2\.6\.\([0-9]\+\).*/\1/p')
> +       else
> +               SUBLEVEL=99
> +       fi

You could drop setting sublevel to 99 by changing

>        if [ $SUBLEVEL -le 22 ]; then

to

        if [ $MAJORLEVEL -eq 2 -a $SUBLEVEL -le 22 ]

this would be a bit cleaner IMHO.


Jonas

  reply	other threads:[~2011-06-03  9:07 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-06-02 16:35 [PATCH 0/9] compat-wireless: Add support for kernel 3.XX Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 1/9] comapt-wireless: move doku to the correct place in config.mk Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 2/9] compat-wireless: rename CONFIG_COMPAT_KERNEL_ Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 3/9] compat-wireless: add support for kernel 3.XX Hauke Mehrtens
2011-06-03  9:07   ` Jonas Gorski [this message]
2011-06-03 11:33     ` Hauke Mehrtens
2011-06-04  0:26       ` Luis R. Rodriguez
2011-06-02 16:35 ` [PATCH 4/9] compat-wireless: make patches apply again Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 5/9] compat-wireless: add missing header Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 6/9] compat-wireless: activate CARL9170_WPC by default Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 7/9] compat-wireless: activate CONFIG_RT2800{USB,PCI}_RT35XX " Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 8/9] compat-wireless: sync atheros-debug.mk with config.mk Hauke Mehrtens
2011-06-02 16:35 ` [PATCH 9/9] compat-wireless: update enable-older-kernels patches Hauke Mehrtens

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='BANLkTi=rfmTtb7ttTQQXskA8bkTewLAUrw@mail.gmail.com' \
    --to=jonas.gorski@gmail.com \
    --cc=hauke@hauke-m.de \
    --cc=linux-wireless@vger.kernel.org \
    --cc=lrodriguez@atheros.com \
    --cc=mcgrof@gmail.com \
    /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.