Commit Graph

8 Commits

Author SHA1 Message Date
Miguel Ojeda 98cade0a08 Compiler Attributes: auxdisplay: panel: use __nonstring
Let gcc know these arrays are not meant to be NUL-terminated
by annotating them with the new __nonstring variable attribute;
and remove the comment since it conveys the same information.

Tested-by: Sedat Dilek <sedat.dilek@gmail.com> # on top of v4.19-rc5, clang 7
Reviewed-by: Nick Desaulniers <ndesaulniers@google.com>
Reviewed-by: Luc Van Oostenryck <luc.vanoostenryck@gmail.com>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-09-30 20:14:04 +02:00
Miguel Ojeda 351f683b98 auxdisplay: Replace licenses with SPDX identifiers
Cc: Philippe Ombredanne <pombredanne@nexb.com>
Acked-by: Willy Tarreau <w@1wt.eu>
Acked-by: Linus Walleij <triad@dflund.se>
Acked-by: Robin van der Gracht <robin@protonic.nl>
Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-04-12 19:02:45 +02:00
Miguel Ojeda 5617c599bb auxdisplay: panel: Change comments to silence fallthrough warnings
Compiling with W=1 with gcc 7.2.0 gives 3 warnings like:

  drivers/auxdisplay/panel.c: In function ‘panel_process_inputs’:
  drivers/auxdisplay/panel.c:1374:17: warning: this statement may fall
  through [-Wimplicit-fallthrough=]

Cc: Willy Tarreau <w@1wt.eu>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Miguel Ojeda <miguel.ojeda.sandonis@gmail.com>
2018-03-13 18:12:09 +01:00
Kees Cook 607a630107 auxdisplay: Convert timers to use timer_setup()
In preparation for unconditionally passing the struct timer_list pointer to
all timer callbacks, switch to using the new timer_setup() and from_timer()
to pass the timer pointer explicitly.

Cc: Paul Burton <paul.burton@imgtec.com>
Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Kees Cook <keescook@chromium.org>
Reviewed-by: Paul Burton <paul.burton@mips.com>
Tested-by: Paul Burton <paul.burton@mips.com> # for img-ascii-lcd
2017-11-02 15:50:37 -07:00
Willy Tarreau 93dc1774d2 auxdisplay: charlcd: properly restore atomic counter on error path
Commit f4757af ("staging: panel: Fix single-open policy race condition")
introduced in 3.19-rc1 attempted to fix a race condition on the open, but
failed to properly do it and used to exit without restoring the semaphore.

This results in -EBUSY being returned after the first open error until
the module is reloaded or the system restarted (ie: consecutive to a
dual open resulting in -EBUSY or to a permission error).

[ Note for stable maintainers: the code moved from drivers/misc/panel.c
  to drivers/auxdisplay/{charlcd,panel}.c during 4.12. The patch easily
  applies there (modulo the renamed atomic counter) but I can provide a
  tested backport if desired. ]

Fixes: f4757af85 # 3.19-rc1
Cc: stable@vger.kernel.org
Cc: Mariusz Gorski <marius.gorski@gmail.com>
Cc: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Miguel Ojeda Sandonis <miguel.ojeda.sandonis@gmail.com>
Signed-off-by: Willy Tarreau <w@1wt.eu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-09-18 16:06:00 +02:00
Arvind Yadav 7b948f1377 auxdisplay: constify charlcd_ops.
charlcd_ops are not supposed to change at runtime. All functions
working with charlcd_ops provided by <misc/charlcd.h> work with
const charlcd_ops. So mark the non-const structs as const.

File size before:
   text	   data	    bss	    dec	    hex	filename
  12750	    560	    362	  13672	   3568	drivers/auxdisplay/panel.o

File size After adding 'const':
   text	   data	    bss	    dec	    hex	filename
  12942	    368	    362	  13672	   3568	drivers/auxdisplay/panel.o

Signed-off-by: Arvind Yadav <arvind.yadav.cs@gmail.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-07-17 17:23:16 +02:00
Wei Yongjun 4654bdb639 auxdisplay: Convert list_for_each to entry variant
convert list_for_each() to list_for_each_entry() where
applicable.

Signed-off-by: Wei Yongjun <weiyongjun1@huawei.com>
Reviewed-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-05-25 18:24:03 +02:00
Andy Shevchenko 51c1e9b554 auxdisplay: Move panel.c to drivers/auxdisplay folder
It looks like panel.c belongs to auxdisplay subsystem.

Move it to drivers/auxdisplay folder.
No functional changes intended.

Acked-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2017-04-08 17:48:20 +02:00