WelcomeWelcome | FAQFAQ | DownloadsDownloads | WikiWiki

Author Topic: slight improvement for tce-setup  (Read 1905 times)

Offline SvOlli

  • Full Member
  • ***
  • Posts: 193
  • Linux Developer
slight improvement for tce-setup
« on: July 21, 2010, 01:26:37 PM »
Hello, I found a slight improvement for /usr/bin/tce-setup

the parsing of /proc/cmdline has some overhead. Instead of:
Code: [Select]
for i in `cat /proc/cmdline`; do
  case $i in
    *=*)
      case $i in
        tce*) TCE=${i#*=} ;;
        lst*) MYLIST=${i#*=} ;;
      esac
    ;;
  esac
done

One could go for:
Code: [Select]
for i in `cat /proc/cmdline`; do
  case $i in
    tce=*) TCE=${i#*=} ;;
    lst=*) MYLIST=${i#*=} ;;
  esac
done
Or am I missing something?

Offline roberts

  • Retired Admins
  • Hero Member
  • *****
  • Posts: 7361
  • Founder Emeritus
Re: slight improvement for tce-setup
« Reply #1 on: July 21, 2010, 05:15:56 PM »
True. But what is in tce-setup is the same construct as in tc-config, and at the time, it was not determined if single boot codes , e.g., no = would be required or desired. Looking back now, it appears that no such requirement is needed so could be simplified as you suggest.
10+ Years Contributing to Linux Open Source Projects.