diff mbox series

[1/1] ACPI: property: Polish ignoring bad data nodes

Message ID 20240222141321.616794-1-sakari.ailus@linux.intel.com
State Accepted
Commit 8d60902f16e2a36e9138a7ac0e90eb30f35a33b5
Headers show
Series [1/1] ACPI: property: Polish ignoring bad data nodes | expand

Commit Message

Sakari Ailus Feb. 22, 2024, 2:13 p.m. UTC
Clean up ignoring data nodes in mipi-disco-img.c: use { } initialiser, fix
a kernel-doc warning and use isdigit().

Fixes: 6018731b04ca ("ACPI: property: Ignore bad graph port nodes on Dell XPS 9315")
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
---
Hi Rafael,

Feel free to squash this to the original patch.

 drivers/acpi/mipi-disco-img.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

Comments

Rafael J. Wysocki Feb. 22, 2024, 7:34 p.m. UTC | #1
On Thu, Feb 22, 2024 at 3:13 PM Sakari Ailus
<sakari.ailus@linux.intel.com> wrote:
>
> Clean up ignoring data nodes in mipi-disco-img.c: use { } initialiser, fix
> a kernel-doc warning and use isdigit().
>
> Fixes: 6018731b04ca ("ACPI: property: Ignore bad graph port nodes on Dell XPS 9315")
> Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
> ---
> Hi Rafael,
>
> Feel free to squash this to the original patch.
>
>  drivers/acpi/mipi-disco-img.c | 8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c
> index da71eb4bf6a6..d05413a0672a 100644
> --- a/drivers/acpi/mipi-disco-img.c
> +++ b/drivers/acpi/mipi-disco-img.c
> @@ -732,7 +732,7 @@ static const struct dmi_system_id dmi_ignore_port_nodes[] = {
>                         DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"),
>                 },
>         },
> -       { 0 }
> +       { }
>  };
>
>  static const char *strnext(const char *s1, const char *s2)
> @@ -749,7 +749,7 @@ static const char *strnext(const char *s1, const char *s2)
>   * acpi_graph_ignore_port - Tell whether a port node should be ignored
>   * @handle: The ACPI handle of the node (which may be a port node)
>   *
> - * Returns true if a port node should be ignored and the data to that should
> + * Return: true if a port node should be ignored and the data to that should
>   * come from other sources instead (Windows ACPI definitions and
>   * ipu-bridge). This is currently used to ignore bad port nodes related to IPU6
>   * ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with
> @@ -778,12 +778,12 @@ bool acpi_graph_ignore_port(acpi_handle handle)
>         if (!path)
>                 goto out_free;
>
> -       if (!(path[0] >= '0' && path[0] <= '9' && path[1] == '.'))
> +       if (!(isdigit(path[0]) && path[1] == '.'))
>                 goto out_free;
>
>         /* Check if the node has a "PRT" prefix. */
>         path = strnext(path, "PRT");
> -       if (path && path[0] >= '0' && path[0] <= '9' && !path[1]) {
> +       if (path && isdigit(path[0]) && !path[1]) {
>                 acpi_handle_debug(handle, "ignoring data node\n");
>
>                 kfree(orig_path);
> --

Applied, thanks!
diff mbox series

Patch

diff --git a/drivers/acpi/mipi-disco-img.c b/drivers/acpi/mipi-disco-img.c
index da71eb4bf6a6..d05413a0672a 100644
--- a/drivers/acpi/mipi-disco-img.c
+++ b/drivers/acpi/mipi-disco-img.c
@@ -732,7 +732,7 @@  static const struct dmi_system_id dmi_ignore_port_nodes[] = {
 			DMI_EXACT_MATCH(DMI_PRODUCT_NAME, "XPS 9315"),
 		},
 	},
-	{ 0 }
+	{ }
 };
 
 static const char *strnext(const char *s1, const char *s2)
@@ -749,7 +749,7 @@  static const char *strnext(const char *s1, const char *s2)
  * acpi_graph_ignore_port - Tell whether a port node should be ignored
  * @handle: The ACPI handle of the node (which may be a port node)
  *
- * Returns true if a port node should be ignored and the data to that should
+ * Return: true if a port node should be ignored and the data to that should
  * come from other sources instead (Windows ACPI definitions and
  * ipu-bridge). This is currently used to ignore bad port nodes related to IPU6
  * ("IPU?") and camera sensor devices ("LNK?") in certain Dell systems with
@@ -778,12 +778,12 @@  bool acpi_graph_ignore_port(acpi_handle handle)
 	if (!path)
 		goto out_free;
 
-	if (!(path[0] >= '0' && path[0] <= '9' && path[1] == '.'))
+	if (!(isdigit(path[0]) && path[1] == '.'))
 		goto out_free;
 
 	/* Check if the node has a "PRT" prefix. */
 	path = strnext(path, "PRT");
-	if (path && path[0] >= '0' && path[0] <= '9' && !path[1]) {
+	if (path && isdigit(path[0]) && !path[1]) {
 		acpi_handle_debug(handle, "ignoring data node\n");
 
 		kfree(orig_path);