1. 31 7月, 2008 1 次提交
  2. 26 7月, 2008 2 次提交
  3. 06 7月, 2008 1 次提交
  4. 18 6月, 2008 1 次提交
  5. 25 5月, 2008 1 次提交
  6. 15 5月, 2008 1 次提交
  7. 30 4月, 2008 1 次提交
  8. 29 4月, 2008 3 次提交
  9. 20 4月, 2008 1 次提交
    • J
      driver core: Convert debug functions declared inline __attribute__((format... · 1429db83
      Joe Perches 提交于
      driver core: Convert debug functions declared inline __attribute__((format (printf,x,y) to statement expression macros
      
      When DEBUG is not defined, pr_debug and dev_dbg and some
      other local debugging functions are specified as:
      
      "inline __attribute__((format (printf, x, y)))"
      
      This is done to validate printk arguments when not debugging.
      
      Converting these functions to macros or statement expressions
      "do { if (0) printk(fmt, ##arg); } while (0)"
      or
      "({ if (0) printk(fmt, ##arg); 0; })
      makes at least gcc 4.2.2 produce smaller objects.
      
      This has the additional benefit of allowing the optimizer to
      avoid calling functions like print_mac that might have been
      arguments to the printk.
      
      defconfig x86 current:
      
      $ size vmlinux
         text    data     bss     dec     hex filename
      4716770  474560  618496 5809826  58a6a2 vmlinux
      
      all converted: (More patches follow)
      
      $ size vmlinux
         text    data     bss     dec     hex filename
      4716642  474560  618496 5809698  58a622 vmlinux
      
      Even kernel/sched.o, which doesn't even use these
      functions, becomes smaller.
      
      It appears that merely having an indirect include
      of <linux/device.h> can cause bigger objects.
      
      $ size sched.inline.o sched.if0.o
         text    data     bss     dec     hex filename
        31385    2854     328   34567    8707 sched.inline.o
        31366    2854     328   34548    86f4 sched.if0.o
      
      The current preprocessed only kernel/sched.i file contains:
      
      # 612 "include/linux/device.h"
      static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 2, 3)))
      dev_dbg(struct device *dev, const char *fmt, ...)
      {
       return 0;
      }
      # 628 "include/linux/device.h"
      static inline __attribute__((always_inline)) int __attribute__ ((format (printf, 2, 3)))
      dev_vdbg(struct device *dev, const char *fmt, ...)
      {
       return 0;
      }
      
      Removing these unused inlines from sched.i shrinks sched.o
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
      
      1429db83
  10. 09 2月, 2008 5 次提交
    • Y
      Add new string functions strict_strto* and convert kernel params to use them · 06b2a76d
      Yi Yang 提交于
      Currently, for every sysfs node, the callers will be responsible for
      implementing store operation, so many many callers are doing duplicate
      things to validate input, they have the same mistakes because they are
      calling simple_strtol/ul/ll/uul, especially for module params, they are
      just numeric, but you can echo such values as 0x1234xxx, 07777888 and
      1234aaa, for these cases, module params store operation just ignores
      succesive invalid char and converts prefix part to a numeric although input
      is acctually invalid.
      
      This patch tries to fix the aforementioned issues and implements
      strict_strtox serial functions, kernel/params.c uses them to strictly
      validate input, so module params will reject such values as 0x1234xxxx and
      returns an error:
      
      write error: Invalid argument
      
      Any modules which export numeric sysfs node can use strict_strtox instead of
      simple_strtox to reject any invalid input.
      
      Here are some test results:
      
      Before applying this patch:
      
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000g > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000gggggggg > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 010000 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0100008 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 010000aaaaa > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]#
      
      After applying this patch:
      
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000g > /sys/module/e1000/parameters/copybreak
      -bash: echo: write error: Invalid argument
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo 0x1000gggggggg > /sys/module/e1000/parameters/copybreak
      -bash: echo: write error: Invalid argument
      [root@yangyi-dev /]# echo 010000 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# echo 0100008 > /sys/module/e1000/parameters/copybreak
      -bash: echo: write error: Invalid argument
      [root@yangyi-dev /]# echo 010000aaaaa > /sys/module/e1000/parameters/copybreak
      -bash: echo: write error: Invalid argument
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]# echo -n 4096 > /sys/module/e1000/parameters/copybreak
      [root@yangyi-dev /]# cat /sys/module/e1000/parameters/copybreak
      4096
      [root@yangyi-dev /]#
      
      [akpm@linux-foundation.org: fix compiler warnings]
      [akpm@linux-foundation.org: fix off-by-one found by tiwai@suse.de]
      Signed-off-by: NYi Yang <yi.y.yang@intel.com>
      Cc: Greg KH <greg@kroah.com>
      Cc: "Randy.Dunlap" <rdunlap@xenotime.net>
      Cc: Takashi Iwai <tiwai@suse.de>
      Cc: Hugh Dickins <hugh@veritas.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      06b2a76d
    • J
      printk_ratelimit() functions should use CONFIG_PRINTK · 7ef3d2fd
      Joe Perches 提交于
      Makes an embedded image a bit smaller.
      Signed-off-by: NJoe Perches <joe@perches.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7ef3d2fd
    • H
      Remove fastcall from linux/include · ec701584
      Harvey Harrison 提交于
      [akpm@linux-foundation.org: coding-style fixes]
      Signed-off-by: NHarvey Harrison <harvey.harrison@gmail.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      ec701584
    • D
      mn10300: add the MN10300/AM33 architecture to the kernel · b920de1b
      David Howells 提交于
      Add architecture support for the MN10300/AM33 CPUs produced by MEI to the
      kernel.
      
      This patch also adds board support for the ASB2303 with the ASB2308 daughter
      board, and the ASB2305.  The only processor supported is the MN103E010, which
      is an AM33v2 core plus on-chip devices.
      
      [akpm@linux-foundation.org: nuke cvs control strings]
      Signed-off-by: NMasakazu Urade <urade.masakazu@jp.panasonic.com>
      Signed-off-by: NKoichi Yasutake <yasutake.koichi@jp.panasonic.com>
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      b920de1b
    • D
      aout: suppress A.OUT library support if !CONFIG_ARCH_SUPPORTS_AOUT · 7fa30315
      David Howells 提交于
      Suppress A.OUT library support if CONFIG_ARCH_SUPPORTS_AOUT is not set.
      
      Not all architectures support the A.OUT binfmt, so the ELF binfmt should not
      be permitted to go looking for A.OUT libraries to load in such a case.  Not
      only that, but under such conditions A.OUT core dumps are not produced either.
      
      To make this work, this patch also does the following:
      
       (1) Makes the existence of the contents of linux/a.out.h contingent on
           CONFIG_ARCH_SUPPORTS_AOUT.
      
       (2) Renames dump_thread() to aout_dump_thread() as it's only called by A.OUT
           core dumping code.
      
       (3) Moves aout_dump_thread() into asm/a.out-core.h and makes it inline.  This
           is then included only where needed.  This means that this bit of arch
           code will be stored in the appropriate A.OUT binfmt module rather than
           the core kernel.
      
       (4) Drops A.OUT support for Blackfin (according to Mike Frysinger it's not
           needed) and FRV.
      
      This patch depends on the previous patch to move STACK_TOP[_MAX] out of
      asm/a.out.h and into asm/processor.h as they're required whether or not A.OUT
      format is available.
      
      [jdike@addtoit.com: uml: re-remove accidentally restored code]
      Signed-off-by: NDavid Howells <dhowells@redhat.com>
      Cc: <linux-arch@vger.kernel.org>
      Signed-off-by: NJeff Dike <jdike@linux.intel.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      7fa30315
  11. 07 2月, 2008 2 次提交
  12. 30 1月, 2008 1 次提交
  13. 26 1月, 2008 1 次提交
  14. 17 10月, 2007 4 次提交
  15. 12 10月, 2007 1 次提交
  16. 12 9月, 2007 1 次提交
  17. 12 8月, 2007 1 次提交
  18. 09 8月, 2007 1 次提交
  19. 22 7月, 2007 1 次提交
    • A
      x86: Support __attribute__((__cold__)) in gcc 4.3 · a586df06
      Andi Kleen 提交于
      gcc 4.3 supports a new __attribute__((__cold__)) to mark functions cold. Any
      path directly leading to a call of this function will be unlikely. And gcc
      will try to generate smaller code for the function itself.
      
      Please use with care. The code generation advantage isn't large and in most
      cases it is not worth uglifying code with this.
      
      This patch marks some common error functions like panic(), printk()
      as cold.  This will longer term make many unlikely()s unnecessary, although
      we can keep them for now for older compilers.
      
      BUG is not marked cold because there is currently no way to tell
      gcc to mark a inline function told.
      
      Also all __init and __exit functions are marked cold. With a non -Os
      build this will tell the compiler to generate slightly smaller code
      for them. I think it currently only uses less alignments for labels,
      but that might change in the future.
      
      One disadvantage over *likely() is that they cannot be easily instrumented
      to verify them.
      
      Another drawback is that only the latest gcc 4.3 snapshots support this.
      Unfortunately we cannot detect this using the preprocessor. This means older
      snapshots will fail now. I don't think that's a problem because they are
      unreleased compilers that nobody should be using.
      
      gcc also has a __hot__ attribute, but I don't see any sense in using
      this in the kernel right now. But someday I hope gcc will be able
      to use more aggressive optimizing for hot functions even in -Os,
      if that happens it should be added.
      
      Includes compile fix from Thomas Gleixner.
      
      Cc: Jan Hubicka <jh@suse.cz>
      Signed-off-by: NAndi Kleen <ak@suse.de>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      a586df06
  20. 18 7月, 2007 1 次提交
  21. 09 6月, 2007 1 次提交
    • R
      hexdump: more output formatting · c7909234
      Randy Dunlap 提交于
      Add a prefix string parameter.  Callers are responsible for any string
      length/alignment that they want to see in the output.  I.e., callers should
      pad strings to achieve alignment if they want that.
      
      Add rowsize parameter.  This is the number of raw data bytes to be printed
      per line.  Must be 16 or 32.
      
      Add a groupsize parameter.  This allows callers to dump values as 1-byte,
      2-byte, 4-byte, or 8-byte numbers.  Default is 1-byte numbers.  If the
      total length is not an even multiple of groupsize, 1-byte numbers are
      printed.
      
      Add an "ascii" output parameter.  This causes ASCII data output following
      the hex data output.
      
      Clean up some doc examples.
      
      Align the ASCII output on all lines that are produced by one call.
      
      Add a new interface, print_hex_dump_bytes(), that is a shortcut to
      print_hex_dump(), using default parameter values to print 16 bytes in
      byte-size chunks of hex + ASCII output, using printk level KERN_DEBUG.
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Cc: Christoph Lameter <clameter@sgi.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      c7909234
  22. 13 5月, 2007 1 次提交
  23. 11 5月, 2007 2 次提交
    • R
      lib/hexdump · 99eaf3c4
      Randy Dunlap 提交于
      Based on ace_dump_mem() from Grant Likely for the Xilinx SystemACE
      CompactFlash interface.
      
      Add print_hex_dump() & hex_dumper() to lib/hexdump.c and linux/kernel.h.
      
      This patch adds the functions print_hex_dump() & hex_dumper().
      print_hex_dump() can be used to perform a hex + ASCII dump of data to
      syslog, in an easily viewable format, thus providing a common text hex dump
      format.
      
      hex_dumper() provides a dump-to-memory function.  It converts one "line" of
      output (16 bytes of input) at a time.
      
      Example usages:
      	print_hex_dump(KERN_DEBUG, DUMP_PREFIX_ADDRESS, frame->data, frame->len);
      	hex_dumper(frame->data, frame->len, linebuf, sizeof(linebuf));
      
      Example output using %DUMP_PREFIX_OFFSET:
      0009ab42: 40414243 44454647 48494a4b 4c4d4e4f-@ABCDEFG HIJKLMNO
      Example output using %DUMP_PREFIX_ADDRESS:
      ffffffff88089af0: 70717273 74757677 78797a7b 7c7d7e7f-pqrstuvw xyz{|}~.
      
      [akpm@linux-foundation.org: cleanups, add export]
      Signed-off-by: NRandy Dunlap <randy.dunlap@oracle.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      99eaf3c4
    • A
      add upper-32-bits macro · 218e180e
      Andrew Morton 提交于
      We keep on getting "right shift count >= width of type" warnings when doing
      things like
      
      	sector_t s;
      
      	x = s >> 56;
      
      because with CONFIG_LBD=n, s is only 32-bit.  Similar problems can occur with
      dma_addr_t's.
      
      So add a simple wrapper function which code can use to avoid this warning.
      The above example would become
      
      	x = upper_32_bits(s) >> 24;
      
      The first user is in fact AFS.
      
      Cc: James Bottomley <James.Bottomley@SteelEye.com>
      Cc: "Cameron, Steve" <Steve.Cameron@hp.com>
      Cc: "Miller, Mike (OS Dev)" <Mike.Miller@hp.com>
      Cc: Hisashi Hifumi <hifumi.hisashi@oss.ntt.co.jp>
      Cc: Alan Cox <alan@lxorguk.ukuu.org.uk>
      Cc: David Howells <dhowells@redhat.com>
      Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
      Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
      218e180e
  24. 08 5月, 2007 1 次提交
  25. 01 5月, 2007 1 次提交
  26. 13 2月, 2007 2 次提交
  27. 12 2月, 2007 1 次提交