From: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
To: Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>,
Andy Shevchenko <andriy.shevchenko@linux.intel.com>,
Geert Uytterhoeven <geert@linux-m68k.org>,
devicetree@vger.kernel.org, linux-kernel@vger.kernel.org
Cc: Andy Shevchenko <andy@kernel.org>,
Rob Herring <robh+dt@kernel.org>,
Krzysztof Kozlowski <krzysztof.kozlowski+dt@linaro.org>,
Conor Dooley <conor+dt@kernel.org>,
Robin van der Gracht <robin@protonic.nl>,
Paul Burton <paulburton@kernel.org>
Subject: [PATCH v3 3/9] auxdisplay: ht16k33: Add default to switch-cases
Date: Mon, 19 Feb 2024 18:58:02 +0200 [thread overview]
Message-ID: <20240219170337.2161754-4-andriy.shevchenko@linux.intel.com> (raw)
In-Reply-To: <20240219170337.2161754-1-andriy.shevchenko@linux.intel.com>
Currently the compiler (GCC) is able to figure out that there is no
other choices possible than those that are already listed in the
switch-cases. However, if we want to move some code to the callback,
compiler will start complaining that no default is defined. Make
sure we have all switch-cases equiped with default.
Reported-by: Geert Uytterhoeven <geert@linux-m68k.org>
Signed-off-by: Andy Shevchenko <andriy.shevchenko@linux.intel.com>
---
drivers/auxdisplay/ht16k33.c | 14 +++++++++-----
1 file changed, 9 insertions(+), 5 deletions(-)
diff --git a/drivers/auxdisplay/ht16k33.c b/drivers/auxdisplay/ht16k33.c
index 19805f39a257..c0067a3b2b61 100644
--- a/drivers/auxdisplay/ht16k33.c
+++ b/drivers/auxdisplay/ht16k33.c
@@ -677,11 +677,6 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
return err;
switch (priv->type) {
- case DISP_MATRIX:
- /* not handled here */
- err = -EINVAL;
- break;
-
case DISP_QUAD_7SEG:
INIT_DELAYED_WORK(&priv->work, ht16k33_seg7_update);
seg->map.seg7 = initial_map_seg7;
@@ -695,6 +690,9 @@ static int ht16k33_seg_probe(struct device *dev, struct ht16k33_priv *priv,
seg->map_size = sizeof(seg->map.seg14);
err = device_create_file(dev, &dev_attr_map_seg14);
break;
+
+ default:
+ return -EINVAL;
}
if (err)
return err;
@@ -772,6 +770,9 @@ static int ht16k33_probe(struct i2c_client *client)
/* Segment Display */
err = ht16k33_seg_probe(dev, priv, dft_brightness);
break;
+
+ default:
+ return -EINVAL;
}
return err;
}
@@ -796,6 +797,9 @@ static void ht16k33_remove(struct i2c_client *client)
device_remove_file(&client->dev, &dev_attr_map_seg7);
device_remove_file(&client->dev, &dev_attr_map_seg14);
break;
+
+ default:
+ break;
}
}
--
2.43.0.rc1.1.gbec44491f096
next prev parent reply other threads:[~2024-02-19 17:03 UTC|newest]
Thread overview: 31+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-19 16:57 [PATCH v3 0/9] auxdisplay: linedisp: Clean up and add new driver Andy Shevchenko
2024-02-19 16:58 ` [PATCH v3 1/9] auxdisplay: linedisp: Group display drivers together Andy Shevchenko
2024-02-26 15:28 ` Geert Uytterhoeven
2024-02-26 16:00 ` Andy Shevchenko
2024-02-26 16:03 ` Geert Uytterhoeven
2024-02-26 16:15 ` Andy Shevchenko
2024-02-19 16:58 ` [PATCH v3 2/9] auxdisplay: linedisp: Allocate buffer for the string Andy Shevchenko
2024-02-26 15:36 ` Geert Uytterhoeven
2024-02-19 16:58 ` Andy Shevchenko [this message]
2024-02-26 15:38 ` [PATCH v3 3/9] auxdisplay: ht16k33: Add default to switch-cases Geert Uytterhoeven
2024-02-19 16:58 ` [PATCH v3 4/9] auxdisplay: ht16k33: Move ht16k33_linedisp_ops down Andy Shevchenko
2024-02-19 16:58 ` [PATCH v3 5/9] auxdisplay: ht16k33: Define a few helper macros Andy Shevchenko
2024-02-20 18:05 ` Andy Shevchenko
2024-02-26 15:40 ` Geert Uytterhoeven
2024-02-19 16:58 ` [PATCH v3 6/9] auxdisplay: ht16k33: Switch to use line display character mapping Andy Shevchenko
2024-02-19 16:58 ` [PATCH v3 7/9] auxdisplay: ht16k33: Drop struct ht16k33_seg Andy Shevchenko
2024-02-26 15:44 ` Geert Uytterhoeven
2024-02-19 16:58 ` [PATCH v3 8/9] dt-bindings: auxdisplay: Add Maxim MAX6958/6959 Andy Shevchenko
2024-02-26 15:52 ` Geert Uytterhoeven
2024-02-26 17:03 ` Andy Shevchenko
2024-02-19 16:58 ` [PATCH v3 9/9] auxdisplay: Add driver for MAX695x 7-segment LED controllers Andy Shevchenko
2024-02-26 16:01 ` Geert Uytterhoeven
2024-02-26 16:17 ` Andy Shevchenko
2024-02-26 16:58 ` Geert Uytterhoeven
2024-02-26 17:04 ` Andy Shevchenko
2024-02-22 13:51 ` [PATCH v3 0/9] auxdisplay: linedisp: Clean up and add new driver Andy Shevchenko
2024-02-22 13:56 ` Geert Uytterhoeven
2024-02-26 14:30 ` Andy Shevchenko
2024-02-26 16:24 ` Andy Shevchenko
2024-02-26 18:00 ` Andy Shevchenko
2024-02-26 18:13 ` Geert Uytterhoeven
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240219170337.2161754-4-andriy.shevchenko@linux.intel.com \
--to=andriy.shevchenko@linux.intel.com \
--cc=andy@kernel.org \
--cc=conor+dt@kernel.org \
--cc=devicetree@vger.kernel.org \
--cc=geert@linux-m68k.org \
--cc=krzysztof.kozlowski+dt@linaro.org \
--cc=krzysztof.kozlowski@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=paulburton@kernel.org \
--cc=robh+dt@kernel.org \
--cc=robin@protonic.nl \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).