All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
@ 2019-09-30 14:18 Jani Nikula
  2019-09-30 14:31 ` Rasmus Villemoes
                   ` (6 more replies)
  0 siblings, 7 replies; 18+ messages in thread
From: Jani Nikula @ 2019-09-30 14:18 UTC (permalink / raw)
  To: linux-kernel
  Cc: jani.nikula, Joonas Lahtinen, Rodrigo Vivi, intel-gfx,
	Vishal Kulkarni, netdev, Greg Kroah-Hartman, linux-usb,
	Andrew Morton, Julia Lawall, Rasmus Villemoes

The kernel has plenty of ternary operators to choose between constant
strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
"s":

$ git grep '? "yes" : "no"' | wc -l
258
$ git grep '? "on" : "off"' | wc -l
204
$ git grep '? "enabled" : "disabled"' | wc -l
196
$ git grep '? "" : "s"' | wc -l
25

Additionally, there are some occurences of the same in reverse order,
split to multiple lines, or otherwise not caught by the simple grep.

Add helpers to return the constant strings. Remove existing equivalent
and conflicting functions in i915, cxgb4, and USB core. Further
conversion can be done incrementally.

While the main goal here is to abstract recurring patterns, and slightly
clean up the code base by not open coding the ternary operators, there
are also some space savings to be had via better string constant
pooling.

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: Vishal Kulkarni <vishal@chelsio.com>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

v2: add string-choice.[ch] to not clutter kernel.h and to actually save
space on string constants.

Example of further cleanup possibilities are at [1], to be done
incrementally afterwards.

[1] http://lore.kernel.org/r/20190903133731.2094-2-jani.nikula@intel.com
---
 drivers/gpu/drm/i915/i915_utils.h             | 16 +---------
 .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 12 +------
 drivers/usb/core/config.c                     |  6 +---
 drivers/usb/core/generic.c                    |  6 +---
 include/linux/kernel.h                        |  1 +
 include/linux/string-choice.h                 | 16 ++++++++++
 lib/Makefile                                  |  2 +-
 lib/string-choice.c                           | 31 +++++++++++++++++++
 8 files changed, 53 insertions(+), 37 deletions(-)
 create mode 100644 include/linux/string-choice.h
 create mode 100644 lib/string-choice.c

diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index 562f756da421..794f02a90efe 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -28,6 +28,7 @@
 #include <linux/list.h>
 #include <linux/overflow.h>
 #include <linux/sched.h>
+#include <linux/string-choice.h>
 #include <linux/types.h>
 #include <linux/workqueue.h>
 
@@ -395,21 +396,6 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms)
 #define MBps(x) KBps(1000 * (x))
 #define GBps(x) ((u64)1000 * MBps((x)))
 
-static inline const char *yesno(bool v)
-{
-	return v ? "yes" : "no";
-}
-
-static inline const char *onoff(bool v)
-{
-	return v ? "on" : "off";
-}
-
-static inline const char *enableddisabled(bool v)
-{
-	return v ? "enabled" : "disabled";
-}
-
 static inline void add_taint_for_CI(unsigned int taint)
 {
 	/*
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
index ae6a47dd7dc9..d9123dae1d00 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
@@ -35,6 +35,7 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/string_helpers.h>
+#include <linux/string-choice.h>
 #include <linux/sort.h>
 #include <linux/ctype.h>
 
@@ -2023,17 +2024,6 @@ static const struct file_operations rss_debugfs_fops = {
 /* RSS Configuration.
  */
 
-/* Small utility function to return the strings "yes" or "no" if the supplied
- * argument is non-zero.
- */
-static const char *yesno(int x)
-{
-	static const char *yes = "yes";
-	static const char *no = "no";
-
-	return x ? yes : no;
-}
-
 static int rss_config_show(struct seq_file *seq, void *v)
 {
 	struct adapter *adapter = seq->private;
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 151a74a54386..52cee9067eb4 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/device.h>
+#include <linux/string-choice.h>
 #include <asm/byteorder.h>
 #include "usb.h"
 
@@ -19,11 +20,6 @@
 #define USB_MAXCONFIG			8	/* Arbitrary limit */
 
 
-static inline const char *plural(int n)
-{
-	return (n == 1 ? "" : "s");
-}
-
 static int find_next_descriptor(unsigned char *buffer, int size,
     int dt1, int dt2, int *num_skipped)
 {
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 38f8b3e31762..a784a09794d6 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -21,14 +21,10 @@
 
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/string-choice.h>
 #include <uapi/linux/usb/audio.h>
 #include "usb.h"
 
-static inline const char *plural(int n)
-{
-	return (n == 1 ? "" : "s");
-}
-
 static int is_rndis(struct usb_interface_descriptor *desc)
 {
 	return desc->bInterfaceClass == USB_CLASS_COMM
diff --git a/include/linux/kernel.h b/include/linux/kernel.h
index d83d403dac2e..91ace0e6ec1d 100644
--- a/include/linux/kernel.h
+++ b/include/linux/kernel.h
@@ -1029,4 +1029,5 @@ static inline void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) { }
 	 /* OTHER_WRITABLE?  Generally considered a bad idea. */		\
 	 BUILD_BUG_ON_ZERO((perms) & 2) +					\
 	 (perms))
+
 #endif
diff --git a/include/linux/string-choice.h b/include/linux/string-choice.h
new file mode 100644
index 000000000000..1583b909e2c9
--- /dev/null
+++ b/include/linux/string-choice.h
@@ -0,0 +1,16 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __STRING_CHOICE_H__
+#define __STRING_CHOICE_H__
+
+#include <linux/types.h>
+
+const char *yesno(bool v);
+const char *onoff(bool v);
+const char *enableddisabled(bool v);
+const char *plural(long v);
+
+#endif /* __STRING_CHOICE_H__ */
diff --git a/lib/Makefile b/lib/Makefile
index c5892807e06f..30247fbf1afe 100644
--- a/lib/Makefile
+++ b/lib/Makefile
@@ -46,7 +46,7 @@ obj-y += bcd.o sort.o parser.o debug_locks.o random32.o \
 	 bsearch.o find_bit.o llist.o memweight.o kfifo.o \
 	 percpu-refcount.o rhashtable.o \
 	 once.o refcount.o usercopy.o errseq.o bucket_locks.o \
-	 generic-radix-tree.o
+	 generic-radix-tree.o string-choice.o
 obj-$(CONFIG_STRING_SELFTEST) += test_string.o
 obj-y += string_helpers.o
 obj-$(CONFIG_TEST_STRING_HELPERS) += test-string_helpers.o
diff --git a/lib/string-choice.c b/lib/string-choice.c
new file mode 100644
index 000000000000..d20680a6603e
--- /dev/null
+++ b/lib/string-choice.c
@@ -0,0 +1,31 @@
+// SPDX-License-Identifier: MIT
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#include <linux/export.h>
+#include <linux/string-choice.h>
+
+const char *yesno(bool v)
+{
+	return v ? "yes" : "no";
+}
+EXPORT_SYMBOL(yesno);
+
+const char *onoff(bool v)
+{
+	return v ? "on" : "off";
+}
+EXPORT_SYMBOL(onoff);
+
+const char *enableddisabled(bool v)
+{
+	return v ? "enabled" : "disabled";
+}
+EXPORT_SYMBOL(enableddisabled);
+
+const char *plural(long v)
+{
+	return v == 1 ? "" : "s";
+}
+EXPORT_SYMBOL(plural);
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
@ 2019-09-30 14:31 ` Rasmus Villemoes
  2019-10-01  8:07   ` [PATCH v3] string-choice: " Jani Nikula
  2019-09-30 14:53 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: " Patchwork
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 18+ messages in thread
From: Rasmus Villemoes @ 2019-09-30 14:31 UTC (permalink / raw)
  To: Jani Nikula, linux-kernel
  Cc: Joonas Lahtinen, Rodrigo Vivi, intel-gfx, Vishal Kulkarni,
	netdev, Greg Kroah-Hartman, linux-usb, Andrew Morton,
	Julia Lawall

On 30/09/2019 16.18, Jani Nikula wrote:
> The kernel has plenty of ternary operators to choose between constant
> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
> "s":
> 
> 
> ---
> 
> v2: add string-choice.[ch] to not clutter kernel.h and to actually save
> space on string constants.
> 
> +EXPORT_SYMBOL(enableddisabled);
> +
> +const char *plural(long v)
> +{
> +	return v == 1 ? "" : "s";
> +}
> +EXPORT_SYMBOL(plural);
> 


Say what? I'll bet you a beer that this is a net loss: You're adding
hundreds of bytes of export symbol overhead, plus forcing gcc to emit
actual calls at the call sites, with all the register saving/restoring
that implies.

Please just do this as static inlines. As I said, the linker is
perfectly capable of merging string literals across translation units
(but of course not between vmlinux and modules), so any built-in code
that uses those helpers (or open-codes them, doesn't matter) will
automatically share those literals.

Rasmus


^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
  2019-09-30 14:31 ` Rasmus Villemoes
@ 2019-09-30 14:53 ` Patchwork
  2019-09-30 15:20 ` ✓ Fi.CI.BAT: success " Patchwork
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-09-30 14:53 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
URL   : https://patchwork.freedesktop.org/series/67405/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
776ae2f2dd01 lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
-:165: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#165: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 145 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
  2019-09-30 14:31 ` Rasmus Villemoes
  2019-09-30 14:53 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: " Patchwork
@ 2019-09-30 15:20 ` Patchwork
  2019-09-30 19:11 ` ✓ Fi.CI.IGT: " Patchwork
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-09-30 15:20 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
URL   : https://patchwork.freedesktop.org/series/67405/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6973 -> Patchwork_14586
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/index.html

Known issues
------------

  Here are the changes found in Patchwork_14586 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@i915_module_load@reload:
    - fi-blb-e6850:       [PASS][1] -> [INCOMPLETE][2] ([fdo#107718])
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-blb-e6850/igt@i915_module_load@reload.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/fi-blb-e6850/igt@i915_module_load@reload.html

  * igt@i915_module_load@reload-no-display:
    - fi-icl-u3:          [PASS][3] -> [DMESG-WARN][4] ([fdo#107724]) +2 similar issues
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-icl-u3/igt@i915_module_load@reload-no-display.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/fi-icl-u3/igt@i915_module_load@reload-no-display.html

  * igt@i915_selftest@live_hangcheck:
    - fi-bsw-kefka:       [PASS][5] -> [INCOMPLETE][6] ([fdo#105876])
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-bsw-kefka/igt@i915_selftest@live_hangcheck.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/fi-bsw-kefka/igt@i915_selftest@live_hangcheck.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [PASS][7] -> [FAIL][8] ([fdo#111045] / [fdo#111096])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
#### Possible fixes ####

  * igt@gem_mmap@basic-small-bo:
    - fi-icl-u3:          [DMESG-WARN][9] ([fdo#107724]) -> [PASS][10] +1 similar issue
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/fi-icl-u3/igt@gem_mmap@basic-small-bo.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/fi-icl-u3/igt@gem_mmap@basic-small-bo.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#105876]: https://bugs.freedesktop.org/show_bug.cgi?id=105876
  [fdo#107718]: https://bugs.freedesktop.org/show_bug.cgi?id=107718
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#111045]: https://bugs.freedesktop.org/show_bug.cgi?id=111045
  [fdo#111096]: https://bugs.freedesktop.org/show_bug.cgi?id=111096
  [fdo#111867]: https://bugs.freedesktop.org/show_bug.cgi?id=111867


Participating hosts (53 -> 45)
------------------------------

  Additional (1): fi-cml-h 
  Missing    (9): fi-ilk-m540 fi-bxt-dsi fi-hsw-4200u fi-skl-6770hq fi-byt-squawks fi-bsw-cyan fi-icl-y fi-byt-clapper fi-bdw-samus 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6973 -> Patchwork_14586

  CI-20190529: 20190529
  CI_DRM_6973: 7462c58bba0fb6e85bd380591c3fd86e298c0f95 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5206: 5a6c68568def840cd720f18fc66f529a89f84675 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14586: 776ae2f2dd012e0dd0fc1ae9831f082e6eabfbb3 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

776ae2f2dd01 lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.IGT: success for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
                   ` (2 preceding siblings ...)
  2019-09-30 15:20 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-09-30 19:11 ` Patchwork
  2019-10-01 10:43 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2) Patchwork
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-09-30 19:11 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
URL   : https://patchwork.freedesktop.org/series/67405/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6973_full -> Patchwork_14586_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_14586_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_exec_async@concurrent-writes-bsd:
    - shard-iclb:         [PASS][1] -> [SKIP][2] ([fdo#111325]) +2 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb8/igt@gem_exec_async@concurrent-writes-bsd.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb1/igt@gem_exec_async@concurrent-writes-bsd.html

  * igt@gem_exec_schedule@deep-vebox:
    - shard-iclb:         [PASS][3] -> [INCOMPLETE][4] ([fdo#107713]) +1 similar issue
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb6/igt@gem_exec_schedule@deep-vebox.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb7/igt@gem_exec_schedule@deep-vebox.html

  * igt@gem_pread@snoop:
    - shard-apl:          [PASS][5] -> [INCOMPLETE][6] ([fdo#103927]) +1 similar issue
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-apl5/igt@gem_pread@snoop.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-apl8/igt@gem_pread@snoop.html

  * igt@i915_pm_rc6_residency@rc6-accuracy:
    - shard-kbl:          [PASS][7] -> [SKIP][8] ([fdo#109271])
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-kbl1/igt@i915_pm_rc6_residency@rc6-accuracy.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-kbl2/igt@i915_pm_rc6_residency@rc6-accuracy.html

  * igt@i915_pm_rpm@modeset-stress-extra-wait:
    - shard-glk:          [PASS][9] -> [DMESG-WARN][10] ([fdo#105763] / [fdo#106538])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-glk4/igt@i915_pm_rpm@modeset-stress-extra-wait.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-glk8/igt@i915_pm_rpm@modeset-stress-extra-wait.html

  * igt@i915_suspend@fence-restore-tiled2untiled:
    - shard-apl:          [PASS][11] -> [DMESG-WARN][12] ([fdo#108566]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-apl3/igt@i915_suspend@fence-restore-tiled2untiled.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-apl7/igt@i915_suspend@fence-restore-tiled2untiled.html

  * igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic:
    - shard-hsw:          [PASS][13] -> [FAIL][14] ([fdo#105767])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-hsw6/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-hsw6/igt@kms_cursor_legacy@2x-long-cursor-vs-flip-atomic.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-glk:          [PASS][15] -> [FAIL][16] ([fdo#105363])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render:
    - shard-iclb:         [PASS][17] -> [FAIL][18] ([fdo#103167]) +4 similar issues
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-cur-indfb-draw-render.html

  * igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min:
    - shard-skl:          [PASS][19] -> [FAIL][20] ([fdo#108145])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl2/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl9/igt@kms_plane_alpha_blend@pipe-b-constant-alpha-min.html

  * igt@kms_plane_alpha_blend@pipe-b-coverage-7efc:
    - shard-skl:          [PASS][21] -> [FAIL][22] ([fdo#108145] / [fdo#110403])
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl6/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl4/igt@kms_plane_alpha_blend@pipe-b-coverage-7efc.html

  * igt@kms_psr@psr2_cursor_render:
    - shard-iclb:         [PASS][23] -> [SKIP][24] ([fdo#109441]) +1 similar issue
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb2/igt@kms_psr@psr2_cursor_render.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb6/igt@kms_psr@psr2_cursor_render.html

  * igt@kms_setmode@basic:
    - shard-apl:          [PASS][25] -> [FAIL][26] ([fdo#99912])
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-apl1/igt@kms_setmode@basic.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-apl3/igt@kms_setmode@basic.html

  * igt@prime_busy@hang-bsd2:
    - shard-iclb:         [PASS][27] -> [SKIP][28] ([fdo#109276]) +19 similar issues
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb2/igt@prime_busy@hang-bsd2.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb7/igt@prime_busy@hang-bsd2.html

  
#### Possible fixes ####

  * igt@gem_ctx_shared@exec-single-timeline-bsd:
    - shard-iclb:         [SKIP][29] ([fdo#110841]) -> [PASS][30]
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb4/igt@gem_ctx_shared@exec-single-timeline-bsd.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb6/igt@gem_ctx_shared@exec-single-timeline-bsd.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [SKIP][31] ([fdo#111325]) -> [PASS][32] +9 similar issues
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb4/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb6/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@kms_cursor_legacy@all-pipes-torture-move:
    - shard-kbl:          [DMESG-WARN][33] ([fdo#107122]) -> [PASS][34]
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-kbl3/igt@kms_cursor_legacy@all-pipes-torture-move.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-kbl7/igt@kms_cursor_legacy@all-pipes-torture-move.html

  * igt@kms_cursor_legacy@flip-vs-cursor-atomic:
    - shard-skl:          [FAIL][35] ([fdo#102670]) -> [PASS][36]
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl3/igt@kms_cursor_legacy@flip-vs-cursor-atomic.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl8/igt@kms_cursor_legacy@flip-vs-cursor-atomic.html

  * igt@kms_flip@flip-vs-suspend:
    - shard-apl:          [DMESG-WARN][37] ([fdo#108566]) -> [PASS][38]
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-apl7/igt@kms_flip@flip-vs-suspend.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-apl8/igt@kms_flip@flip-vs-suspend.html

  * igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite:
    - shard-iclb:         [FAIL][39] ([fdo#103167]) -> [PASS][40] +3 similar issues
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-rgb565-draw-pwrite.html

  * igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min:
    - shard-skl:          [FAIL][41] ([fdo#108145]) -> [PASS][42] +1 similar issue
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl1/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl10/igt@kms_plane_alpha_blend@pipe-c-constant-alpha-min.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [FAIL][43] ([fdo#108145] / [fdo#110403]) -> [PASS][44]
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl5/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl7/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-a-tiling-x:
    - shard-iclb:         [FAIL][45] ([fdo#103166]) -> [PASS][46]
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-x.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb6/igt@kms_plane_lowres@pipe-a-tiling-x.html

  * igt@kms_psr2_su@frontbuffer:
    - shard-iclb:         [SKIP][47] ([fdo#109642] / [fdo#111068]) -> [PASS][48]
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb7/igt@kms_psr2_su@frontbuffer.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb2/igt@kms_psr2_su@frontbuffer.html

  * igt@kms_psr@psr2_primary_mmap_cpu:
    - shard-iclb:         [SKIP][49] ([fdo#109441]) -> [PASS][50] +1 similar issue
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb1/igt@kms_psr@psr2_primary_mmap_cpu.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb2/igt@kms_psr@psr2_primary_mmap_cpu.html

  * igt@kms_vblank@pipe-c-query-idle-hang:
    - shard-apl:          [INCOMPLETE][51] ([fdo#103927]) -> [PASS][52] +1 similar issue
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-apl8/igt@kms_vblank@pipe-c-query-idle-hang.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-apl5/igt@kms_vblank@pipe-c-query-idle-hang.html

  * igt@kms_vblank@pipe-c-ts-continuation-suspend:
    - shard-iclb:         [DMESG-WARN][53] ([fdo#111764]) -> [PASS][54]
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb1/igt@kms_vblank@pipe-c-ts-continuation-suspend.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb8/igt@kms_vblank@pipe-c-ts-continuation-suspend.html

  * igt@perf@blocking:
    - shard-skl:          [FAIL][55] ([fdo#110728]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-skl6/igt@perf@blocking.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-skl4/igt@perf@blocking.html

  * igt@prime_vgem@fence-wait-bsd2:
    - shard-iclb:         [SKIP][57] ([fdo#109276]) -> [PASS][58] +14 similar issues
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb8/igt@prime_vgem@fence-wait-bsd2.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb1/igt@prime_vgem@fence-wait-bsd2.html

  
#### Warnings ####

  * igt@gem_mocs_settings@mocs-isolation-bsd2:
    - shard-iclb:         [SKIP][59] ([fdo#109276]) -> [FAIL][60] ([fdo#111330])
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb7/igt@gem_mocs_settings@mocs-isolation-bsd2.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb2/igt@gem_mocs_settings@mocs-isolation-bsd2.html

  * igt@gem_mocs_settings@mocs-settings-bsd2:
    - shard-iclb:         [FAIL][61] ([fdo#111330]) -> [SKIP][62] ([fdo#109276])
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb2/igt@gem_mocs_settings@mocs-settings-bsd2.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb6/igt@gem_mocs_settings@mocs-settings-bsd2.html

  * igt@runner@aborted:
    - shard-iclb:         ([FAIL][63], [FAIL][64]) ([fdo#108654] / [fdo#111093]) -> [FAIL][65] ([fdo#111093])
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb1/igt@runner@aborted.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6973/shard-iclb1/igt@runner@aborted.html
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/shard-iclb8/igt@runner@aborted.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#102670]: https://bugs.freedesktop.org/show_bug.cgi?id=102670
  [fdo#103166]: https://bugs.freedesktop.org/show_bug.cgi?id=103166
  [fdo#103167]: https://bugs.freedesktop.org/show_bug.cgi?id=103167
  [fdo#103927]: https://bugs.freedesktop.org/show_bug.cgi?id=103927
  [fdo#105363]: https://bugs.freedesktop.org/show_bug.cgi?id=105363
  [fdo#105411]: https://bugs.freedesktop.org/show_bug.cgi?id=105411
  [fdo#105763]: https://bugs.freedesktop.org/show_bug.cgi?id=105763
  [fdo#105767]: https://bugs.freedesktop.org/show_bug.cgi?id=105767
  [fdo#106538]: https://bugs.freedesktop.org/show_bug.cgi?id=106538
  [fdo#107122]: https://bugs.freedesktop.org/show_bug.cgi?id=107122
  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#108145]: https://bugs.freedesktop.org/show_bug.cgi?id=108145
  [fdo#108566]: https://bugs.freedesktop.org/show_bug.cgi?id=108566
  [fdo#108654]: https://bugs.freedesktop.org/show_bug.cgi?id=108654
  [fdo#109271]: https://bugs.freedesktop.org/show_bug.cgi?id=109271
  [fdo#109276]: https://bugs.freedesktop.org/show_bug.cgi?id=109276
  [fdo#109441]: https://bugs.freedesktop.org/show_bug.cgi?id=109441
  [fdo#109642]: https://bugs.freedesktop.org/show_bug.cgi?id=109642
  [fdo#110403]: https://bugs.freedesktop.org/show_bug.cgi?id=110403
  [fdo#110728]: https://bugs.freedesktop.org/show_bug.cgi?id=110728
  [fdo#110841]: https://bugs.freedesktop.org/show_bug.cgi?id=110841
  [fdo#111068]: https://bugs.freedesktop.org/show_bug.cgi?id=111068
  [fdo#111093]: https://bugs.freedesktop.org/show_bug.cgi?id=111093
  [fdo#111325]: https://bugs.freedesktop.org/show_bug.cgi?id=111325
  [fdo#111330]: https://bugs.freedesktop.org/show_bug.cgi?id=111330
  [fdo#111764]: https://bugs.freedesktop.org/show_bug.cgi?id=111764
  [fdo#111781]: https://bugs.freedesktop.org/show_bug.cgi?id=111781
  [fdo#99912]: https://bugs.freedesktop.org/show_bug.cgi?id=99912


Participating hosts (16 -> 10)
------------------------------

  Missing    (6): shard-tglb1 shard-tglb2 shard-tglb3 shard-tglb4 shard-tglb5 shard-tglb6 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6973 -> Patchwork_14586

  CI-20190529: 20190529
  CI_DRM_6973: 7462c58bba0fb6e85bd380591c3fd86e298c0f95 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5206: 5a6c68568def840cd720f18fc66f529a89f84675 @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14586: 776ae2f2dd012e0dd0fc1ae9831f082e6eabfbb3 @ git://anongit.freedesktop.org/gfx-ci/linux
  piglit_4509: fdc5a4ca11124ab8413c7988896eec4c97336694 @ git://anongit.freedesktop.org/piglit

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14586/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-09-30 14:31 ` Rasmus Villemoes
@ 2019-10-01  8:07   ` Jani Nikula
  2019-10-01  9:38     ` Greg Kroah-Hartman
                       ` (2 more replies)
  0 siblings, 3 replies; 18+ messages in thread
From: Jani Nikula @ 2019-10-01  8:07 UTC (permalink / raw)
  To: Rasmus Villemoes, Jani Nikula, linux-kernel
  Cc: Joonas Lahtinen, Rodrigo Vivi, intel-gfx, Vishal Kulkarni,
	netdev, Greg Kroah-Hartman, linux-usb, Andrew Morton,
	Julia Lawall

The kernel has plenty of ternary operators to choose between constant
strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
"s":

$ git grep '? "yes" : "no"' | wc -l
258
$ git grep '? "on" : "off"' | wc -l
204
$ git grep '? "enabled" : "disabled"' | wc -l
196
$ git grep '? "" : "s"' | wc -l
25

Additionally, there are some occurences of the same in reverse order,
split to multiple lines, or otherwise not caught by the simple grep.

Add helpers to return the constant strings. Remove existing equivalent
and conflicting functions in i915, cxgb4, and USB core. Further
conversion can be done incrementally.

While the main goal here is to abstract recurring patterns, and slightly
clean up the code base by not open coding the ternary operators, there
are also some space savings to be had via better string constant
pooling.

Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: intel-gfx@lists.freedesktop.org
Cc: Vishal Kulkarni <vishal@chelsio.com>
Cc: netdev@vger.kernel.org
Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-usb@vger.kernel.org
Cc: Andrew Morton <akpm@linux-foundation.org>
Cc: linux-kernel@vger.kernel.org
Cc: Julia Lawall <julia.lawall@lip6.fr>
Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
Signed-off-by: Jani Nikula <jani.nikula@intel.com>

---

v2: add string-choice.[ch] to not clutter kernel.h and to actually save
space on string constants.

v3: back to static inlines based on Rasmus' feedback

Example of further cleanup possibilities are at [1], to be done
incrementally afterwards.

[1] http://lore.kernel.org/r/20190903133731.2094-2-jani.nikula@intel.com
---
 drivers/gpu/drm/i915/i915_utils.h             | 16 +---------
 .../ethernet/chelsio/cxgb4/cxgb4_debugfs.c    | 12 +------
 drivers/usb/core/config.c                     |  6 +---
 drivers/usb/core/generic.c                    |  6 +---
 include/linux/string-choice.h                 | 31 +++++++++++++++++++
 5 files changed, 35 insertions(+), 36 deletions(-)
 create mode 100644 include/linux/string-choice.h

diff --git a/drivers/gpu/drm/i915/i915_utils.h b/drivers/gpu/drm/i915/i915_utils.h
index 562f756da421..794f02a90efe 100644
--- a/drivers/gpu/drm/i915/i915_utils.h
+++ b/drivers/gpu/drm/i915/i915_utils.h
@@ -28,6 +28,7 @@
 #include <linux/list.h>
 #include <linux/overflow.h>
 #include <linux/sched.h>
+#include <linux/string-choice.h>
 #include <linux/types.h>
 #include <linux/workqueue.h>
 
@@ -395,21 +396,6 @@ wait_remaining_ms_from_jiffies(unsigned long timestamp_jiffies, int to_wait_ms)
 #define MBps(x) KBps(1000 * (x))
 #define GBps(x) ((u64)1000 * MBps((x)))
 
-static inline const char *yesno(bool v)
-{
-	return v ? "yes" : "no";
-}
-
-static inline const char *onoff(bool v)
-{
-	return v ? "on" : "off";
-}
-
-static inline const char *enableddisabled(bool v)
-{
-	return v ? "enabled" : "disabled";
-}
-
 static inline void add_taint_for_CI(unsigned int taint)
 {
 	/*
diff --git a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
index ae6a47dd7dc9..d9123dae1d00 100644
--- a/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
+++ b/drivers/net/ethernet/chelsio/cxgb4/cxgb4_debugfs.c
@@ -35,6 +35,7 @@
 #include <linux/seq_file.h>
 #include <linux/debugfs.h>
 #include <linux/string_helpers.h>
+#include <linux/string-choice.h>
 #include <linux/sort.h>
 #include <linux/ctype.h>
 
@@ -2023,17 +2024,6 @@ static const struct file_operations rss_debugfs_fops = {
 /* RSS Configuration.
  */
 
-/* Small utility function to return the strings "yes" or "no" if the supplied
- * argument is non-zero.
- */
-static const char *yesno(int x)
-{
-	static const char *yes = "yes";
-	static const char *no = "no";
-
-	return x ? yes : no;
-}
-
 static int rss_config_show(struct seq_file *seq, void *v)
 {
 	struct adapter *adapter = seq->private;
diff --git a/drivers/usb/core/config.c b/drivers/usb/core/config.c
index 151a74a54386..52cee9067eb4 100644
--- a/drivers/usb/core/config.c
+++ b/drivers/usb/core/config.c
@@ -10,6 +10,7 @@
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/device.h>
+#include <linux/string-choice.h>
 #include <asm/byteorder.h>
 #include "usb.h"
 
@@ -19,11 +20,6 @@
 #define USB_MAXCONFIG			8	/* Arbitrary limit */
 
 
-static inline const char *plural(int n)
-{
-	return (n == 1 ? "" : "s");
-}
-
 static int find_next_descriptor(unsigned char *buffer, int size,
     int dt1, int dt2, int *num_skipped)
 {
diff --git a/drivers/usb/core/generic.c b/drivers/usb/core/generic.c
index 38f8b3e31762..a784a09794d6 100644
--- a/drivers/usb/core/generic.c
+++ b/drivers/usb/core/generic.c
@@ -21,14 +21,10 @@
 
 #include <linux/usb.h>
 #include <linux/usb/hcd.h>
+#include <linux/string-choice.h>
 #include <uapi/linux/usb/audio.h>
 #include "usb.h"
 
-static inline const char *plural(int n)
-{
-	return (n == 1 ? "" : "s");
-}
-
 static int is_rndis(struct usb_interface_descriptor *desc)
 {
 	return desc->bInterfaceClass == USB_CLASS_COMM
diff --git a/include/linux/string-choice.h b/include/linux/string-choice.h
new file mode 100644
index 000000000000..320b598bd8f0
--- /dev/null
+++ b/include/linux/string-choice.h
@@ -0,0 +1,31 @@
+/* SPDX-License-Identifier: MIT */
+/*
+ * Copyright © 2019 Intel Corporation
+ */
+
+#ifndef __STRING_CHOICE_H__
+#define __STRING_CHOICE_H__
+
+#include <linux/types.h>
+
+static inline const char *yesno(bool v)
+{
+	return v ? "yes" : "no";
+}
+
+static inline const char *onoff(bool v)
+{
+	return v ? "on" : "off";
+}
+
+static inline const char *enableddisabled(bool v)
+{
+	return v ? "enabled" : "disabled";
+}
+
+static inline const char *plural(long v)
+{
+	return v == 1 ? "" : "s";
+}
+
+#endif /* __STRING_CHOICE_H__ */
-- 
2.20.1


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  8:07   ` [PATCH v3] string-choice: " Jani Nikula
@ 2019-10-01  9:38     ` Greg Kroah-Hartman
  2019-10-01  9:42         ` Jani Nikula
  2019-10-02 10:11     ` Jani Nikula
  2019-10-04  9:09       ` Greg Kroah-Hartman
  2 siblings, 1 reply; 18+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-01  9:38 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Rasmus Villemoes, linux-kernel, Joonas Lahtinen, Rodrigo Vivi,
	intel-gfx, Vishal Kulkarni, netdev, linux-usb, Andrew Morton,
	Julia Lawall

On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
> The kernel has plenty of ternary operators to choose between constant
> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
> "s":
> 
> $ git grep '? "yes" : "no"' | wc -l
> 258
> $ git grep '? "on" : "off"' | wc -l
> 204
> $ git grep '? "enabled" : "disabled"' | wc -l
> 196
> $ git grep '? "" : "s"' | wc -l
> 25
> 
> Additionally, there are some occurences of the same in reverse order,
> split to multiple lines, or otherwise not caught by the simple grep.
> 
> Add helpers to return the constant strings. Remove existing equivalent
> and conflicting functions in i915, cxgb4, and USB core. Further
> conversion can be done incrementally.
> 
> While the main goal here is to abstract recurring patterns, and slightly
> clean up the code base by not open coding the ternary operators, there
> are also some space savings to be had via better string constant
> pooling.
> 
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Vishal Kulkarni <vishal@chelsio.com>
> Cc: netdev@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1

As this is a totally different version, please drop my reviewed-by as
that's really not true here :(


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  9:38     ` Greg Kroah-Hartman
@ 2019-10-01  9:42         ` Jani Nikula
  0 siblings, 0 replies; 18+ messages in thread
From: Jani Nikula @ 2019-10-01  9:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: Rasmus Villemoes, linux-kernel, Joonas Lahtinen, Rodrigo Vivi,
	intel-gfx, Vishal Kulkarni, netdev, linux-usb, Andrew Morton,
	Julia Lawall

On Tue, 01 Oct 2019, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
>> The kernel has plenty of ternary operators to choose between constant
>> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
>> "s":
>> 
>> $ git grep '? "yes" : "no"' | wc -l
>> 258
>> $ git grep '? "on" : "off"' | wc -l
>> 204
>> $ git grep '? "enabled" : "disabled"' | wc -l
>> 196
>> $ git grep '? "" : "s"' | wc -l
>> 25
>> 
>> Additionally, there are some occurences of the same in reverse order,
>> split to multiple lines, or otherwise not caught by the simple grep.
>> 
>> Add helpers to return the constant strings. Remove existing equivalent
>> and conflicting functions in i915, cxgb4, and USB core. Further
>> conversion can be done incrementally.
>> 
>> While the main goal here is to abstract recurring patterns, and slightly
>> clean up the code base by not open coding the ternary operators, there
>> are also some space savings to be had via better string constant
>> pooling.
>> 
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: intel-gfx@lists.freedesktop.org
>> Cc: Vishal Kulkarni <vishal@chelsio.com>
>> Cc: netdev@vger.kernel.org
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: linux-usb@vger.kernel.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: Julia Lawall <julia.lawall@lip6.fr>
>> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
>> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
>
> As this is a totally different version, please drop my reviewed-by as
> that's really not true here :(

I did indicate it was for v1. Indeed v2 was different, but care to
elaborate what's wrong with v3?

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
@ 2019-10-01  9:42         ` Jani Nikula
  0 siblings, 0 replies; 18+ messages in thread
From: Jani Nikula @ 2019-10-01  9:42 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, netdev, intel-gfx, Rasmus Villemoes, linux-kernel,
	Julia Lawall, Vishal Kulkarni, Andrew Morton

On Tue, 01 Oct 2019, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
>> The kernel has plenty of ternary operators to choose between constant
>> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
>> "s":
>> 
>> $ git grep '? "yes" : "no"' | wc -l
>> 258
>> $ git grep '? "on" : "off"' | wc -l
>> 204
>> $ git grep '? "enabled" : "disabled"' | wc -l
>> 196
>> $ git grep '? "" : "s"' | wc -l
>> 25
>> 
>> Additionally, there are some occurences of the same in reverse order,
>> split to multiple lines, or otherwise not caught by the simple grep.
>> 
>> Add helpers to return the constant strings. Remove existing equivalent
>> and conflicting functions in i915, cxgb4, and USB core. Further
>> conversion can be done incrementally.
>> 
>> While the main goal here is to abstract recurring patterns, and slightly
>> clean up the code base by not open coding the ternary operators, there
>> are also some space savings to be had via better string constant
>> pooling.
>> 
>> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> Cc: intel-gfx@lists.freedesktop.org
>> Cc: Vishal Kulkarni <vishal@chelsio.com>
>> Cc: netdev@vger.kernel.org
>> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> Cc: linux-usb@vger.kernel.org
>> Cc: Andrew Morton <akpm@linux-foundation.org>
>> Cc: linux-kernel@vger.kernel.org
>> Cc: Julia Lawall <julia.lawall@lip6.fr>
>> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
>> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
>
> As this is a totally different version, please drop my reviewed-by as
> that's really not true here :(

I did indicate it was for v1. Indeed v2 was different, but care to
elaborate what's wrong with v3?

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  9:42         ` Jani Nikula
  (?)
@ 2019-10-01  9:59         ` Greg Kroah-Hartman
  2019-10-01 10:17           ` [Intel-gfx] " Jani Nikula
  -1 siblings, 1 reply; 18+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-01  9:59 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Rasmus Villemoes, linux-kernel, Joonas Lahtinen, Rodrigo Vivi,
	intel-gfx, Vishal Kulkarni, netdev, linux-usb, Andrew Morton,
	Julia Lawall

On Tue, Oct 01, 2019 at 12:42:34PM +0300, Jani Nikula wrote:
> On Tue, 01 Oct 2019, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
> >> The kernel has plenty of ternary operators to choose between constant
> >> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
> >> "s":
> >> 
> >> $ git grep '? "yes" : "no"' | wc -l
> >> 258
> >> $ git grep '? "on" : "off"' | wc -l
> >> 204
> >> $ git grep '? "enabled" : "disabled"' | wc -l
> >> 196
> >> $ git grep '? "" : "s"' | wc -l
> >> 25
> >> 
> >> Additionally, there are some occurences of the same in reverse order,
> >> split to multiple lines, or otherwise not caught by the simple grep.
> >> 
> >> Add helpers to return the constant strings. Remove existing equivalent
> >> and conflicting functions in i915, cxgb4, and USB core. Further
> >> conversion can be done incrementally.
> >> 
> >> While the main goal here is to abstract recurring patterns, and slightly
> >> clean up the code base by not open coding the ternary operators, there
> >> are also some space savings to be had via better string constant
> >> pooling.
> >> 
> >> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> >> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> >> Cc: intel-gfx@lists.freedesktop.org
> >> Cc: Vishal Kulkarni <vishal@chelsio.com>
> >> Cc: netdev@vger.kernel.org
> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> >> Cc: linux-usb@vger.kernel.org
> >> Cc: Andrew Morton <akpm@linux-foundation.org>
> >> Cc: linux-kernel@vger.kernel.org
> >> Cc: Julia Lawall <julia.lawall@lip6.fr>
> >> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> >> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
> >
> > As this is a totally different version, please drop my reviewed-by as
> > that's really not true here :(
> 
> I did indicate it was for v1. Indeed v2 was different, but care to
> elaborate what's wrong with v3?

No idea, but I haven't reviewed it yet, so to put my tag on there isn't
the nicest...

greg k-h

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Intel-gfx] [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  9:59         ` Greg Kroah-Hartman
@ 2019-10-01 10:17           ` Jani Nikula
  0 siblings, 0 replies; 18+ messages in thread
From: Jani Nikula @ 2019-10-01 10:17 UTC (permalink / raw)
  To: Greg Kroah-Hartman
  Cc: linux-usb, netdev, intel-gfx, Rasmus Villemoes, linux-kernel,
	Julia Lawall, Vishal Kulkarni, Andrew Morton

On Tue, 01 Oct 2019, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> On Tue, Oct 01, 2019 at 12:42:34PM +0300, Jani Nikula wrote:
>> On Tue, 01 Oct 2019, Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
>> > On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
>> >> The kernel has plenty of ternary operators to choose between constant
>> >> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
>> >> "s":
>> >> 
>> >> $ git grep '? "yes" : "no"' | wc -l
>> >> 258
>> >> $ git grep '? "on" : "off"' | wc -l
>> >> 204
>> >> $ git grep '? "enabled" : "disabled"' | wc -l
>> >> 196
>> >> $ git grep '? "" : "s"' | wc -l
>> >> 25
>> >> 
>> >> Additionally, there are some occurences of the same in reverse order,
>> >> split to multiple lines, or otherwise not caught by the simple grep.
>> >> 
>> >> Add helpers to return the constant strings. Remove existing equivalent
>> >> and conflicting functions in i915, cxgb4, and USB core. Further
>> >> conversion can be done incrementally.
>> >> 
>> >> While the main goal here is to abstract recurring patterns, and slightly
>> >> clean up the code base by not open coding the ternary operators, there
>> >> are also some space savings to be had via better string constant
>> >> pooling.
>> >> 
>> >> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
>> >> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
>> >> Cc: intel-gfx@lists.freedesktop.org
>> >> Cc: Vishal Kulkarni <vishal@chelsio.com>
>> >> Cc: netdev@vger.kernel.org
>> >> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
>> >> Cc: linux-usb@vger.kernel.org
>> >> Cc: Andrew Morton <akpm@linux-foundation.org>
>> >> Cc: linux-kernel@vger.kernel.org
>> >> Cc: Julia Lawall <julia.lawall@lip6.fr>
>> >> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
>> >> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
>> >
>> > As this is a totally different version, please drop my reviewed-by as
>> > that's really not true here :(
>> 
>> I did indicate it was for v1. Indeed v2 was different, but care to
>> elaborate what's wrong with v3?
>
> No idea, but I haven't reviewed it yet, so to put my tag on there isn't
> the nicest...

Apologies, no harm intended.

At times, I've seen the "# vN" notation used, I suppose both to indicate
that the *ideas* presented in the earlier version warranted Reviewed-by
from so-and-so, though this particular version still needs detailed
review, and that the approval of the reviewer of the earlier version
should be sought out before merging a subsequent version.

BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
                   ` (3 preceding siblings ...)
  2019-09-30 19:11 ` ✓ Fi.CI.IGT: " Patchwork
@ 2019-10-01 10:43 ` Patchwork
  2019-10-01 11:23 ` ✓ Fi.CI.BAT: success " Patchwork
  2019-10-01 15:23 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-10-01 10:43 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
URL   : https://patchwork.freedesktop.org/series/67405/
State : warning

== Summary ==

$ dim checkpatch origin/drm-tip
ff289b0aa561 string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
-:155: WARNING:FILE_PATH_CHANGES: added, moved or deleted file(s), does MAINTAINERS need updating?
#155: 
new file mode 100644

total: 0 errors, 1 warnings, 0 checks, 116 lines checked

_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.BAT: success for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
                   ` (4 preceding siblings ...)
  2019-10-01 10:43 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2) Patchwork
@ 2019-10-01 11:23 ` Patchwork
  2019-10-01 15:23 ` ✓ Fi.CI.IGT: " Patchwork
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-10-01 11:23 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
URL   : https://patchwork.freedesktop.org/series/67405/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6981 -> Patchwork_14602
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  External URL: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/index.html

Known issues
------------

  Here are the changes found in Patchwork_14602 that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@prime_busy@basic-wait-after-default:
    - fi-icl-u3:          [PASS][1] -> [DMESG-WARN][2] ([fdo#107724]) +1 similar issue
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-icl-u3/igt@prime_busy@basic-wait-after-default.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-icl-u3/igt@prime_busy@basic-wait-after-default.html

  
#### Possible fixes ####

  * igt@gem_ctx_create@basic-files:
    - fi-cml-u2:          [INCOMPLETE][3] ([fdo#110566]) -> [PASS][4]
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-cml-u2/igt@gem_ctx_create@basic-files.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-cml-u2/igt@gem_ctx_create@basic-files.html
    - fi-icl-u2:          [INCOMPLETE][5] ([fdo#107713] / [fdo#109100]) -> [PASS][6]
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-icl-u2/igt@gem_ctx_create@basic-files.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-icl-u2/igt@gem_ctx_create@basic-files.html

  * igt@gem_mmap_gtt@basic-read-no-prefault:
    - fi-icl-u3:          [DMESG-WARN][7] ([fdo#107724]) -> [PASS][8] +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-icl-u3/igt@gem_mmap_gtt@basic-read-no-prefault.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-icl-u3/igt@gem_mmap_gtt@basic-read-no-prefault.html

  * igt@gem_sync@basic-all:
    - {fi-tgl-u}:         [FAIL][9] ([fdo#111871]) -> [PASS][10]
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-tgl-u/igt@gem_sync@basic-all.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-tgl-u/igt@gem_sync@basic-all.html

  * igt@i915_module_load@reload:
    - fi-icl-u3:          [DMESG-WARN][11] ([fdo#107724] / [fdo#111214]) -> [PASS][12]
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-icl-u3/igt@i915_module_load@reload.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-icl-u3/igt@i915_module_load@reload.html

  * igt@kms_chamelium@hdmi-hpd-fast:
    - fi-kbl-7500u:       [FAIL][13] ([fdo#111407]) -> [PASS][14]
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/fi-kbl-7500u/igt@kms_chamelium@hdmi-hpd-fast.html

  
  {name}: This element is suppressed. This means it is ignored when computing
          the status of the difference (SUCCESS, WARNING, or FAILURE).

  [fdo#107713]: https://bugs.freedesktop.org/show_bug.cgi?id=107713
  [fdo#107724]: https://bugs.freedesktop.org/show_bug.cgi?id=107724
  [fdo#109100]: https://bugs.freedesktop.org/show_bug.cgi?id=109100
  [fdo#110566]: https://bugs.freedesktop.org/show_bug.cgi?id=110566
  [fdo#111214]: https://bugs.freedesktop.org/show_bug.cgi?id=111214
  [fdo#111407]: https://bugs.freedesktop.org/show_bug.cgi?id=111407
  [fdo#111871]: https://bugs.freedesktop.org/show_bug.cgi?id=111871


Participating hosts (48 -> 46)
------------------------------

  Additional (2): fi-cml-h fi-bwr-2160 
  Missing    (4): fi-ctg-p8600 fi-byt-clapper fi-ilk-m540 fi-bsw-cyan 


Build changes
-------------

  * CI: CI-20190529 -> None
  * Linux: CI_DRM_6981 -> Patchwork_14602

  CI-20190529: 20190529
  CI_DRM_6981: 3b9046f56a0924158484a0aaddd1aa3a1960ac65 @ git://anongit.freedesktop.org/gfx-ci/linux
  IGT_5208: c0131b4f132acf287d9d05b0f5078003d3159e1c @ git://anongit.freedesktop.org/xorg/app/intel-gpu-tools
  Patchwork_14602: ff289b0aa561a579575fcf3eb0827593e5e84f56 @ git://anongit.freedesktop.org/gfx-ci/linux


== Linux commits ==

ff289b0aa561 string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/index.html
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* ✓ Fi.CI.IGT: success for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
  2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
                   ` (5 preceding siblings ...)
  2019-10-01 11:23 ` ✓ Fi.CI.BAT: success " Patchwork
@ 2019-10-01 15:23 ` Patchwork
  6 siblings, 0 replies; 18+ messages in thread
From: Patchwork @ 2019-10-01 15:23 UTC (permalink / raw)
  To: Jani Nikula; +Cc: intel-gfx

== Series Details ==

Series: lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2)
URL   : https://patchwork.freedesktop.org/series/67405/
State : success

== Summary ==

CI Bug Log - changes from CI_DRM_6981_full -> Patchwork_14602_full
====================================================

Summary
-------

  **SUCCESS**

  No regressions found.

  

Known issues
------------

  Here are the changes found in Patchwork_14602_full that come from known issues:

### IGT changes ###

#### Issues hit ####

  * igt@gem_ctx_isolation@bcs0-s3:
    - shard-apl:          [PASS][1] -> [DMESG-WARN][2] ([fdo#108566]) +4 similar issues
   [1]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl3/igt@gem_ctx_isolation@bcs0-s3.html
   [2]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl6/igt@gem_ctx_isolation@bcs0-s3.html

  * igt@gem_exec_reloc@basic-write-gtt-active:
    - shard-skl:          [PASS][3] -> [DMESG-WARN][4] ([fdo#106107])
   [3]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl10/igt@gem_exec_reloc@basic-write-gtt-active.html
   [4]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl3/igt@gem_exec_reloc@basic-write-gtt-active.html

  * igt@gem_exec_schedule@out-order-bsd2:
    - shard-iclb:         [PASS][5] -> [SKIP][6] ([fdo#109276]) +22 similar issues
   [5]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb2/igt@gem_exec_schedule@out-order-bsd2.html
   [6]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb8/igt@gem_exec_schedule@out-order-bsd2.html

  * igt@gem_exec_schedule@preempt-other-chain-bsd:
    - shard-iclb:         [PASS][7] -> [SKIP][8] ([fdo#111325]) +1 similar issue
   [7]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb8/igt@gem_exec_schedule@preempt-other-chain-bsd.html
   [8]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb1/igt@gem_exec_schedule@preempt-other-chain-bsd.html

  * igt@gem_exec_suspend@basic-s3:
    - shard-kbl:          [PASS][9] -> [FAIL][10] ([fdo#103375])
   [9]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl7/igt@gem_exec_suspend@basic-s3.html
   [10]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl1/igt@gem_exec_suspend@basic-s3.html

  * igt@gem_userptr_blits@coherency-sync:
    - shard-hsw:          [PASS][11] -> [DMESG-WARN][12] ([fdo#111870]) +2 similar issues
   [11]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-hsw7/igt@gem_userptr_blits@coherency-sync.html
   [12]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-hsw5/igt@gem_userptr_blits@coherency-sync.html

  * igt@gem_userptr_blits@dmabuf-sync:
    - shard-kbl:          [PASS][13] -> [DMESG-WARN][14] ([fdo#111870])
   [13]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl1/igt@gem_userptr_blits@dmabuf-sync.html
   [14]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl3/igt@gem_userptr_blits@dmabuf-sync.html
    - shard-skl:          [PASS][15] -> [DMESG-WARN][16] ([fdo#111870])
   [15]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl8/igt@gem_userptr_blits@dmabuf-sync.html
   [16]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl10/igt@gem_userptr_blits@dmabuf-sync.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-glk:          [PASS][17] -> [DMESG-WARN][18] ([fdo#111870]) +1 similar issue
   [17]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-glk1/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [18]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-glk4/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
    - shard-iclb:         [PASS][19] -> [DMESG-WARN][20] ([fdo#111870])
   [19]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb2/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html
   [20]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb6/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html

  * igt@gem_userptr_blits@sync-unmap-after-close:
    - shard-apl:          [PASS][21] -> [DMESG-WARN][22] ([fdo#109385] / [fdo#111870]) +1 similar issue
   [21]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl6/igt@gem_userptr_blits@sync-unmap-after-close.html
   [22]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl6/igt@gem_userptr_blits@sync-unmap-after-close.html

  * igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-xtiled:
    - shard-skl:          [PASS][23] -> [FAIL][24] ([fdo#103184] / [fdo#103232])
   [23]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl3/igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-xtiled.html
   [24]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl3/igt@kms_draw_crc@draw-method-rgb565-mmap-gtt-xtiled.html

  * igt@kms_flip@2x-flip-vs-suspend:
    - shard-hsw:          [PASS][25] -> [INCOMPLETE][26] ([fdo#103540]) +2 similar issues
   [25]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-hsw6/igt@kms_flip@2x-flip-vs-suspend.html
   [26]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-hsw8/igt@kms_flip@2x-flip-vs-suspend.html

  * igt@kms_flip@dpms-vs-vblank-race-interruptible:
    - shard-apl:          [PASS][27] -> [INCOMPLETE][28] ([fdo#103927])
   [27]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl4/igt@kms_flip@dpms-vs-vblank-race-interruptible.html
   [28]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl4/igt@kms_flip@dpms-vs-vblank-race-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank:
    - shard-skl:          [PASS][29] -> [FAIL][30] ([fdo#105363])
   [29]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl6/igt@kms_flip@flip-vs-expired-vblank.html
   [30]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl10/igt@kms_flip@flip-vs-expired-vblank.html
    - shard-kbl:          [PASS][31] -> [FAIL][32] ([fdo#105363])
   [31]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl7/igt@kms_flip@flip-vs-expired-vblank.html
   [32]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl6/igt@kms_flip@flip-vs-expired-vblank.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-apl:          [PASS][33] -> [FAIL][34] ([fdo#105363])
   [33]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl4/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
   [34]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl2/igt@kms_flip@flip-vs-expired-vblank-interruptible.html

  * igt@kms_flip@flip-vs-suspend-interruptible:
    - shard-skl:          [PASS][35] -> [INCOMPLETE][36] ([fdo#109507])
   [35]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl5/igt@kms_flip@flip-vs-suspend-interruptible.html
   [36]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl7/igt@kms_flip@flip-vs-suspend-interruptible.html

  * igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt:
    - shard-iclb:         [PASS][37] -> [FAIL][38] ([fdo#103167]) +1 similar issue
   [37]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb6/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html
   [38]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb2/igt@kms_frontbuffer_tracking@fbcpsr-1p-primscrn-cur-indfb-draw-blt.html

  * igt@kms_plane_alpha_blend@pipe-c-coverage-7efc:
    - shard-skl:          [PASS][39] -> [FAIL][40] ([fdo#108145] / [fdo#110403])
   [39]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl4/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html
   [40]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl1/igt@kms_plane_alpha_blend@pipe-c-coverage-7efc.html

  * igt@kms_plane_lowres@pipe-a-tiling-y:
    - shard-iclb:         [PASS][41] -> [FAIL][42] ([fdo#103166])
   [41]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb1/igt@kms_plane_lowres@pipe-a-tiling-y.html
   [42]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb4/igt@kms_plane_lowres@pipe-a-tiling-y.html

  * igt@kms_plane_multiple@atomic-pipe-b-tiling-y:
    - shard-skl:          [PASS][43] -> [DMESG-WARN][44] ([fdo#106885])
   [43]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl2/igt@kms_plane_multiple@atomic-pipe-b-tiling-y.html
   [44]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl7/igt@kms_plane_multiple@atomic-pipe-b-tiling-y.html

  * igt@kms_psr@psr2_primary_page_flip:
    - shard-iclb:         [PASS][45] -> [SKIP][46] ([fdo#109441]) +3 similar issues
   [45]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb2/igt@kms_psr@psr2_primary_page_flip.html
   [46]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb6/igt@kms_psr@psr2_primary_page_flip.html

  * igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend:
    - shard-kbl:          [PASS][47] -> [INCOMPLETE][48] ([fdo#103665])
   [47]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl1/igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend.html
   [48]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl3/igt@kms_vblank@pipe-a-ts-continuation-dpms-suspend.html

  * igt@perf@polling:
    - shard-skl:          [PASS][49] -> [FAIL][50] ([fdo#110728])
   [49]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl10/igt@perf@polling.html
   [50]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl7/igt@perf@polling.html

  * igt@tools_test@tools_test:
    - shard-skl:          [PASS][51] -> [SKIP][52] ([fdo#109271])
   [51]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl3/igt@tools_test@tools_test.html
   [52]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl2/igt@tools_test@tools_test.html

  
#### Possible fixes ####

  * igt@gem_exec_reuse@baggage:
    - shard-glk:          [INCOMPLETE][53] ([fdo#103359] / [k.org#198133]) -> [PASS][54] +1 similar issue
   [53]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-glk2/igt@gem_exec_reuse@baggage.html
   [54]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-glk1/igt@gem_exec_reuse@baggage.html

  * igt@gem_exec_reuse@contexts:
    - shard-skl:          [INCOMPLETE][55] ([fdo#111875]) -> [PASS][56]
   [55]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl6/igt@gem_exec_reuse@contexts.html
   [56]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl4/igt@gem_exec_reuse@contexts.html
    - shard-kbl:          [INCOMPLETE][57] ([fdo#103665]) -> [PASS][58] +1 similar issue
   [57]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl2/igt@gem_exec_reuse@contexts.html
   [58]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl3/igt@gem_exec_reuse@contexts.html
    - shard-apl:          [INCOMPLETE][59] ([fdo#103927]) -> [PASS][60] +1 similar issue
   [59]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl8/igt@gem_exec_reuse@contexts.html
   [60]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl4/igt@gem_exec_reuse@contexts.html

  * igt@gem_exec_schedule@preemptive-hang-bsd:
    - shard-iclb:         [SKIP][61] ([fdo#111325]) -> [PASS][62] +4 similar issues
   [61]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb4/igt@gem_exec_schedule@preemptive-hang-bsd.html
   [62]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb6/igt@gem_exec_schedule@preemptive-hang-bsd.html

  * igt@gem_exec_schedule@promotion-bsd1:
    - shard-iclb:         [SKIP][63] ([fdo#109276]) -> [PASS][64] +13 similar issues
   [63]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb3/igt@gem_exec_schedule@promotion-bsd1.html
   [64]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb4/igt@gem_exec_schedule@promotion-bsd1.html

  * igt@gem_userptr_blits@dmabuf-unsync:
    - shard-hsw:          [DMESG-WARN][65] ([fdo#111870]) -> [PASS][66]
   [65]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-hsw8/igt@gem_userptr_blits@dmabuf-unsync.html
   [66]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-hsw5/igt@gem_userptr_blits@dmabuf-unsync.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy:
    - shard-snb:          [DMESG-WARN][67] ([fdo#110789] / [fdo#111870]) -> [PASS][68]
   [67]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-snb1/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [68]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-snb2/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
    - shard-kbl:          [DMESG-WARN][69] ([fdo#111870]) -> [PASS][70]
   [69]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl7/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [70]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl7/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
    - shard-apl:          [DMESG-WARN][71] ([fdo#109385] / [fdo#111870]) -> [PASS][72]
   [71]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl3/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html
   [72]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl7/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy.html

  * igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup:
    - shard-glk:          [DMESG-WARN][73] ([fdo#111870]) -> [PASS][74]
   [73]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-glk9/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html
   [74]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-glk6/igt@gem_userptr_blits@map-fixed-invalidate-overlap-busy-gup.html

  * igt@gem_userptr_blits@sync-unmap:
    - shard-iclb:         [DMESG-WARN][75] ([fdo#111870]) -> [PASS][76] +1 similar issue
   [75]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb1/igt@gem_userptr_blits@sync-unmap.html
   [76]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb4/igt@gem_userptr_blits@sync-unmap.html

  * igt@gem_workarounds@suspend-resume-context:
    - shard-apl:          [DMESG-WARN][77] ([fdo#108566]) -> [PASS][78] +6 similar issues
   [77]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-apl4/igt@gem_workarounds@suspend-resume-context.html
   [78]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-apl1/igt@gem_workarounds@suspend-resume-context.html

  * {igt@i915_pm_dc@dc6-dpms}:
    - shard-iclb:         [FAIL][79] ([fdo#110548]) -> [PASS][80]
   [79]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb3/igt@i915_pm_dc@dc6-dpms.html
   [80]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb7/igt@i915_pm_dc@dc6-dpms.html

  * igt@i915_suspend@sysfs-reader:
    - shard-kbl:          [INCOMPLETE][81] ([fdo#103665] / [fdo#108767]) -> [PASS][82]
   [81]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl2/igt@i915_suspend@sysfs-reader.html
   [82]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl2/igt@i915_suspend@sysfs-reader.html

  * igt@kms_big_fb@x-tiled-16bpp-rotate-0:
    - shard-iclb:         [DMESG-FAIL][83] ([fdo#107724]) -> [PASS][84]
   [83]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb2/igt@kms_big_fb@x-tiled-16bpp-rotate-0.html
   [84]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb6/igt@kms_big_fb@x-tiled-16bpp-rotate-0.html

  * igt@kms_cursor_crc@pipe-b-cursor-suspend:
    - shard-kbl:          [DMESG-WARN][85] ([fdo#108566]) -> [PASS][86]
   [85]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl7/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [86]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl2/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
    - shard-snb:          [DMESG-WARN][87] ([fdo#102365]) -> [PASS][88]
   [87]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-snb6/igt@kms_cursor_crc@pipe-b-cursor-suspend.html
   [88]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-snb1/igt@kms_cursor_crc@pipe-b-cursor-suspend.html

  * igt@kms_cursor_legacy@flip-vs-cursor-legacy:
    - shard-skl:          [FAIL][89] ([fdo#102670]) -> [PASS][90]
   [89]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl8/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html
   [90]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl10/igt@kms_cursor_legacy@flip-vs-cursor-legacy.html

  * igt@kms_flip@dpms-vs-vblank-race-interruptible:
    - shard-kbl:          [FAIL][91] ([fdo#111609]) -> [PASS][92]
   [91]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-kbl2/igt@kms_flip@dpms-vs-vblank-race-interruptible.html
   [92]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-kbl3/igt@kms_flip@dpms-vs-vblank-race-interruptible.html

  * igt@kms_flip@flip-vs-expired-vblank-interruptible:
    - shard-glk:          [FAIL][93] ([fdo#105363]) -> [PASS][94]
   [93]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-glk5/igt@kms_flip@flip-vs-expired-vblank-interruptible.html
   [94]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-glk4/igt@kms_flip@flip-vs-expired-vblank-interruptible.html

  * igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt:
    - shard-iclb:         [FAIL][95] ([fdo#103167]) -> [PASS][96] +10 similar issues
   [95]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb8/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html
   [96]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb2/igt@kms_frontbuffer_tracking@fbc-1p-primscrn-shrfb-plflip-blt.html

  * igt@kms_frontbuffer_tracking@fbc-1p-rte:
    - shard-iclb:         [FAIL][97] ([fdo#103167] / [fdo#110378]) -> [PASS][98]
   [97]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb7/igt@kms_frontbuffer_tracking@fbc-1p-rte.html
   [98]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb5/igt@kms_frontbuffer_tracking@fbc-1p-rte.html

  * igt@kms_plane@plane-panning-bottom-right-pipe-a-planes:
    - shard-skl:          [FAIL][99] ([fdo#103166]) -> [PASS][100]
   [99]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-skl3/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html
   [100]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-skl3/igt@kms_plane@plane-panning-bottom-right-pipe-a-planes.html

  * igt@kms_psr2_su@page_flip:
    - shard-iclb:         [SKIP][101] ([fdo#109642] / [fdo#111068]) -> [PASS][102]
   [101]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb6/igt@kms_psr2_su@page_flip.html
   [102]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb2/igt@kms_psr2_su@page_flip.html

  * igt@kms_psr@psr2_sprite_mmap_cpu:
    - shard-iclb:         [SKIP][103] ([fdo#109441]) -> [PASS][104]
   [103]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb8/igt@kms_psr@psr2_sprite_mmap_cpu.html
   [104]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb2/igt@kms_psr@psr2_sprite_mmap_cpu.html

  * igt@syncobj_wait@single-wait-for-submit-submitted:
    - shard-iclb:         [INCOMPLETE][105] ([fdo#107713]) -> [PASS][106] +1 similar issue
   [105]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb7/igt@syncobj_wait@single-wait-for-submit-submitted.html
   [106]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb2/igt@syncobj_wait@single-wait-for-submit-submitted.html

  
#### Warnings ####

  * igt@gem_mocs_settings@mocs-isolation-bsd2:
    - shard-iclb:         [FAIL][107] ([fdo#111330]) -> [SKIP][108] ([fdo#109276])
   [107]: https://intel-gfx-ci.01.org/tree/drm-tip/CI_DRM_6981/shard-iclb1/igt@gem_mocs_settings@mocs-isolation-bsd2.html
   [108]: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/shard-iclb5/igt@gem_mocs_settings@mocs-isolation-bsd2.html

  * igt@gem_mocs_settings@mocs-settings-bsd

== Logs ==

For more details see: https://intel-gfx-ci.01.org/tree/drm-tip/Patchwork_14602/
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  8:07   ` [PATCH v3] string-choice: " Jani Nikula
  2019-10-01  9:38     ` Greg Kroah-Hartman
@ 2019-10-02 10:11     ` Jani Nikula
  2019-10-02 11:00       ` Rasmus Villemoes
  2019-10-04  9:09       ` Greg Kroah-Hartman
  2 siblings, 1 reply; 18+ messages in thread
From: Jani Nikula @ 2019-10-02 10:11 UTC (permalink / raw)
  To: Rasmus Villemoes, linux-kernel
  Cc: Joonas Lahtinen, Rodrigo Vivi, intel-gfx, Vishal Kulkarni,
	netdev, Greg Kroah-Hartman, linux-usb, Andrew Morton,
	Julia Lawall

On Tue, 01 Oct 2019, Jani Nikula <jani.nikula@intel.com> wrote:
> While the main goal here is to abstract recurring patterns, and slightly
> clean up the code base by not open coding the ternary operators, there
> are also some space savings to be had via better string constant
> pooling.

Make that

"""
While the main goal here is to abstract recurring patterns, and slightly
clean up the code base by not open coding the ternary operators, using
functions to access the strings also makes it easier to seek different
implementation options for potential space savings on string constants
in the future.
"""

to be more explicit that this change does not directly translate to any
space savings.

Rasmus, okay with that?


BR,
Jani.


-- 
Jani Nikula, Intel Open Source Graphics Center

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-02 10:11     ` Jani Nikula
@ 2019-10-02 11:00       ` Rasmus Villemoes
  0 siblings, 0 replies; 18+ messages in thread
From: Rasmus Villemoes @ 2019-10-02 11:00 UTC (permalink / raw)
  To: Jani Nikula, linux-kernel
  Cc: Joonas Lahtinen, Rodrigo Vivi, intel-gfx, Vishal Kulkarni,
	netdev, Greg Kroah-Hartman, linux-usb, Andrew Morton,
	Julia Lawall

On 02/10/2019 12.11, Jani Nikula wrote:
> On Tue, 01 Oct 2019, Jani Nikula <jani.nikula@intel.com> wrote:
>> While the main goal here is to abstract recurring patterns, and slightly
>> clean up the code base by not open coding the ternary operators, there
>> are also some space savings to be had via better string constant
>> pooling.
> 
> Make that
> 
> """
> While the main goal here is to abstract recurring patterns, and slightly
> clean up the code base by not open coding the ternary operators, using
> functions to access the strings also makes it easier to seek different
> implementation options for potential space savings on string constants
> in the future.
> """
> 
> to be more explicit that this change does not directly translate to any
> space savings.
> 
> Rasmus, okay with that?

It's rather fluffy, but it doesn't make unfounded claims about space
savings, so in that regard I'm fine with it.

[It's probably just my lack of imagination, but I still fail to see how
one could ever achieve better than the linker creating just 1
vmlinux-wide instance of "enabled", which I believe happens regardless
of whether one uses these helpers or not.]

Rasmus


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
  2019-10-01  8:07   ` [PATCH v3] string-choice: " Jani Nikula
@ 2019-10-04  9:09       ` Greg Kroah-Hartman
  2019-10-02 10:11     ` Jani Nikula
  2019-10-04  9:09       ` Greg Kroah-Hartman
  2 siblings, 0 replies; 18+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-04  9:09 UTC (permalink / raw)
  To: Jani Nikula
  Cc: Rasmus Villemoes, linux-kernel, Joonas Lahtinen, Rodrigo Vivi,
	intel-gfx, Vishal Kulkarni, netdev, linux-usb, Andrew Morton,
	Julia Lawall

On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
> The kernel has plenty of ternary operators to choose between constant
> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
> "s":
> 
> $ git grep '? "yes" : "no"' | wc -l
> 258
> $ git grep '? "on" : "off"' | wc -l
> 204
> $ git grep '? "enabled" : "disabled"' | wc -l
> 196
> $ git grep '? "" : "s"' | wc -l
> 25
> 
> Additionally, there are some occurences of the same in reverse order,
> split to multiple lines, or otherwise not caught by the simple grep.
> 
> Add helpers to return the constant strings. Remove existing equivalent
> and conflicting functions in i915, cxgb4, and USB core. Further
> conversion can be done incrementally.
> 
> While the main goal here is to abstract recurring patterns, and slightly
> clean up the code base by not open coding the ternary operators, there
> are also some space savings to be had via better string constant
> pooling.
> 
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Vishal Kulkarni <vishal@chelsio.com>
> Cc: netdev@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

For this version at least :)

^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [PATCH v3] string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers
@ 2019-10-04  9:09       ` Greg Kroah-Hartman
  0 siblings, 0 replies; 18+ messages in thread
From: Greg Kroah-Hartman @ 2019-10-04  9:09 UTC (permalink / raw)
  To: Jani Nikula
  Cc: linux-usb, netdev, intel-gfx, Rasmus Villemoes, linux-kernel,
	Julia Lawall, Vishal Kulkarni, Andrew Morton

On Tue, Oct 01, 2019 at 11:07:39AM +0300, Jani Nikula wrote:
> The kernel has plenty of ternary operators to choose between constant
> strings, such as condition ? "yes" : "no", as well as value == 1 ? "" :
> "s":
> 
> $ git grep '? "yes" : "no"' | wc -l
> 258
> $ git grep '? "on" : "off"' | wc -l
> 204
> $ git grep '? "enabled" : "disabled"' | wc -l
> 196
> $ git grep '? "" : "s"' | wc -l
> 25
> 
> Additionally, there are some occurences of the same in reverse order,
> split to multiple lines, or otherwise not caught by the simple grep.
> 
> Add helpers to return the constant strings. Remove existing equivalent
> and conflicting functions in i915, cxgb4, and USB core. Further
> conversion can be done incrementally.
> 
> While the main goal here is to abstract recurring patterns, and slightly
> clean up the code base by not open coding the ternary operators, there
> are also some space savings to be had via better string constant
> pooling.
> 
> Cc: Joonas Lahtinen <joonas.lahtinen@linux.intel.com>
> Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
> Cc: intel-gfx@lists.freedesktop.org
> Cc: Vishal Kulkarni <vishal@chelsio.com>
> Cc: netdev@vger.kernel.org
> Cc: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
> Cc: linux-usb@vger.kernel.org
> Cc: Andrew Morton <akpm@linux-foundation.org>
> Cc: linux-kernel@vger.kernel.org
> Cc: Julia Lawall <julia.lawall@lip6.fr>
> Cc: Rasmus Villemoes <linux@rasmusvillemoes.dk>
> Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> # v1
> Signed-off-by: Jani Nikula <jani.nikula@intel.com>

Reviewed-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>

For this version at least :)
_______________________________________________
Intel-gfx mailing list
Intel-gfx@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/intel-gfx

^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2019-10-04  9:09 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-30 14:18 [PATCH v2] lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers Jani Nikula
2019-09-30 14:31 ` Rasmus Villemoes
2019-10-01  8:07   ` [PATCH v3] string-choice: " Jani Nikula
2019-10-01  9:38     ` Greg Kroah-Hartman
2019-10-01  9:42       ` Jani Nikula
2019-10-01  9:42         ` Jani Nikula
2019-10-01  9:59         ` Greg Kroah-Hartman
2019-10-01 10:17           ` [Intel-gfx] " Jani Nikula
2019-10-02 10:11     ` Jani Nikula
2019-10-02 11:00       ` Rasmus Villemoes
2019-10-04  9:09     ` Greg Kroah-Hartman
2019-10-04  9:09       ` Greg Kroah-Hartman
2019-09-30 14:53 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: " Patchwork
2019-09-30 15:20 ` ✓ Fi.CI.BAT: success " Patchwork
2019-09-30 19:11 ` ✓ Fi.CI.IGT: " Patchwork
2019-10-01 10:43 ` ✗ Fi.CI.CHECKPATCH: warning for lib/string-choice: add yesno(), onoff(), enableddisabled(), plural() helpers (rev2) Patchwork
2019-10-01 11:23 ` ✓ Fi.CI.BAT: success " Patchwork
2019-10-01 15:23 ` ✓ Fi.CI.IGT: " Patchwork

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.