Skip to content
  1. Aug 09, 2019
  2. Aug 04, 2019
    • M. Vefa Bicakci's avatar
      kconfig: Clear "written" flag to avoid data loss · 0c5b6c28
      M. Vefa Bicakci authored
      
      
      Prior to this commit, starting nconfig, xconfig or gconfig, and saving
      the .config file more than once caused data loss, where a .config file
      that contained only comments would be written to disk starting from the
      second save operation.
      
      This bug manifests itself because the SYMBOL_WRITTEN flag is never
      cleared after the first call to conf_write, and subsequent calls to
      conf_write then skip all of the configuration symbols due to the
      SYMBOL_WRITTEN flag being set.
      
      This commit resolves this issue by clearing the SYMBOL_WRITTEN flag
      from all symbols before conf_write returns.
      
      Fixes: 8e2442a5 ("kconfig: fix missing choice values in auto.conf")
      Cc: linux-stable <stable@vger.kernel.org> # 4.19+
      Signed-off-by: default avatarM. Vefa Bicakci <m.v.b@runbox.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      0c5b6c28
  3. Jul 31, 2019
    • Stephen Boyd's avatar
      kbuild: Check for unknown options with cc-option usage in Kconfig and clang · e8de12fb
      Stephen Boyd authored
      If the particular version of clang a user has doesn't enable
      -Werror=unknown-warning-option by default, even though it is the
      default[1], then make sure to pass the option to the Kconfig cc-option
      command so that testing options from Kconfig files works properly.
      Otherwise, depending on the default values setup in the clang toolchain
      we will silently assume options such as -Wmaybe-uninitialized are
      supported by clang, when they really aren't.
      
      A compilation issue only started happening for me once commit
      589834b3 ("kbuild: Add -Werror=unknown-warning-option to
      CLANG_FLAGS") was applied on top of commit b303c6df ("kbuild:
      compute false-positive -Wmaybe-uninitialized cases in Kconfig"). This
      leads kbuild to try and test for the existence of the
      -Wmaybe-uninitialized flag with the cc-option command in
      scripts/Kconfig.include, and it doesn't see an error returned from the
      option test so it sets the config value to Y. Then the Makefile tries to
      pass the unknown option on the command line and
      -Werror=unknown-warning-option catches the invalid option and breaks the
      build. Before commit 589834b3 ("kbuild: Add
      -Werror=unknown-warning-option to CLANG_FLAGS") the build works fine,
      but any cc-option test of a warning option in Kconfig files silently
      evaluates to true, even if the warning option flag isn't supported on
      clang.
      
      Note: This doesn't change cc-option usages in Makefiles because those
      use a different rule that includes KBUILD_CFLAGS by default (see the
      __cc-option command in scripts/Kbuild.incluide). The KBUILD_CFLAGS
      variable already has the -Werror=unknown-warning-option flag set. Thanks
      to Doug for pointing out the different rule.
      
      [1] https://clang.llvm.org/docs/DiagnosticsReference.html#wunknown-warning-option
      
      
      Cc: Peter Smith <peter.smith@linaro.org>
      Cc: Nick Desaulniers <ndesaulniers@google.com>
      Cc: Douglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarStephen Boyd <swboyd@chromium.org>
      Reviewed-by: default avatarNathan Chancellor <natechancellor@gmail.com>
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      e8de12fb
    • Masahiro Yamada's avatar
      kbuild: modpost: do not parse unnecessary rules for vmlinux modpost · a721588d
      Masahiro Yamada authored
      
      
      Since commit ff9b45c5 ("kbuild: modpost: read modules.order instead
      of $(MODVERDIR)/*.mod"), 'make vmlinux' emits a warning, like this:
      
      $ make defconfig vmlinux
        [ snip ]
        LD      vmlinux.o
      cat: modules.order: No such file or directory
        MODPOST vmlinux.o
        MODINFO modules.builtin.modinfo
        KSYM    .tmp_kallsyms1.o
        KSYM    .tmp_kallsyms2.o
        LD      vmlinux
        SORTEX  vmlinux
        SYSMAP  System.map
      
      When building only vmlinux, KBUILD_MODULES is not set. Hence, the
      modules.order is not generated. For the vmlinux modpost, it is not
      necessary at all.
      
      Separate scripts/Makefile.modpost for the vmlinux/modules stages.
      This works more efficiently because the vmlinux modpost does not
      need to include .*.cmd files.
      
      Fixes: ff9b45c5 ("kbuild: modpost: read modules.order instead of $(MODVERDIR)/*.mod")
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      a721588d
    • Masahiro Yamada's avatar
      kbuild: modpost: remove unnecessary dependency for __modpost · acf2a139
      Masahiro Yamada authored
      
      
      __modpost is a phony target. The dependency on FORCE is pointless.
      All the objects have been built in the previous stage, so the
      dependency on the objects are not necessary either.
      
      Count the number of modules in a more straightforward way.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      acf2a139
    • Masahiro Yamada's avatar
      kbuild: modpost: handle KBUILD_EXTRA_SYMBOLS only for external modules · cb481993
      Masahiro Yamada authored
      
      
      KBUILD_EXTRA_SYMBOLS makes sense only when building external modules.
      Moreover, the modpost sets 'external_module' if the -e option is given.
      
      I replaced $(patsubst %, -e %,...) with simpler $(addprefix -e,...)
      while I was here.
      
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      cb481993
    • Masahiro Yamada's avatar
      kbuild: modpost: include .*.cmd files only when targets exist · 944cfe9b
      Masahiro Yamada authored
      
      
      If a build rule fails, the .DELETE_ON_ERROR special target removes the
      target, but does nothing for the .*.cmd file, which might be corrupted.
      So, .*.cmd files should be included only when the corresponding targets
      exist.
      
      Commit 392885ee ("kbuild: let fixdep directly write to .*.cmd
      files") missed to fix up this file.
      
      Fixes: 392885ee ("kbuild: let fixdep directly write to .*.cmd")
      Cc: <stable@vger.kernel.org> # v5.0+
      Signed-off-by: default avatarMasahiro Yamada <yamada.masahiro@socionext.com>
      944cfe9b
  4. Jul 29, 2019
  5. Jul 27, 2019
  6. Jul 17, 2019
  7. Jul 15, 2019
  8. Jul 14, 2019
    • Kirill Smelkov's avatar
      *: convert stream-like files -> stream_open, even if they use noop_llseek · 3975b097
      Kirill Smelkov authored
      
      
      This patch continues 10dce8af (fs: stream_open - opener for
      stream-like files so that read and write can run simultaneously without
      deadlock) and c5bf68fe (*: convert stream-like files from
      nonseekable_open -> stream_open) and teaches steam_open.cocci to
      consider files as being stream-like not only if they have
      .llseek=no_llseek, but also if they have .llseek=noop_llseek.
      
      This is safe to do: the comment about noop_llseek says
      
      	This is an implementation of ->llseek useable for the rare special case when
      	userspace expects the seek to succeed but the (device) file is actually not
      	able to perform the seek. In this case you use noop_llseek() instead of
      	falling back to the default implementation of ->llseek.
      
      and in general noop_llseek was massively added to drivers in 6038f373
      (llseek: automatically add .llseek fop) when changing default for NULL .llseek
      from NOP to no_llseek with the idea to avoid breaking compatibility, if
      maybe some user-space program was using lseek on a device without caring
      about the result, but caring if it was an error or not.
      
      Amended semantic patch produces two changes when applied tree-wide:
      
              drivers/hid/hid-sensor-custom.c:690:8-24: WARNING: hid_sensor_custom_fops: .read() has stream semantic; safe to change nonseekable_open -> stream_open.
              drivers/input/mousedev.c:564:1-17: ERROR: mousedev_fops: .read() can deadlock .write(); change nonseekable_open -> stream_open to fix.
      
      Cc: Julia Lawall <Julia.Lawall@lip6.fr>
      Cc: Jan Blunck <jblunck@suse.de>
      Cc: Arnd Bergmann <arnd@arndb.de>
      Cc: Jiri Kosina <jikos@kernel.org>
      Cc: Jonathan Cameron <jic23@kernel.org>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Cc: Benjamin Tissoires <benjamin.tissoires@redhat.com>
      Cc: Dmitry Torokhov <dmitry.torokhov@gmail.com>
      Signed-off-by: default avatarKirill Smelkov <kirr@nexedi.com>
      3975b097
Loading