[v3,2/2] ASoC: fsl_ssi: Use the tolower() function
diff mbox

Message ID 1491421446-13799-2-git-send-email-festevam@gmail.com
State New
Headers show

Commit Message

Fabio Estevam April 5, 2017, 7:44 p.m. UTC
From: Fabio Estevam <fabio.estevam@nxp.com>

Code can be simplified by using the standard tolower() funtion.

Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>
---
Changes since v2:
- None

 sound/soc/fsl/fsl_ssi.c | 13 +++++--------
 1 file changed, 5 insertions(+), 8 deletions(-)

Comments

Timur Tabi April 5, 2017, 7:51 p.m. UTC | #1
On 04/05/2017 02:44 PM, Fabio Estevam wrote:
> From: Fabio Estevam <fabio.estevam@nxp.com>
> 
> Code can be simplified by using the standard tolower() funtion.
> 
> Signed-off-by: Fabio Estevam <fabio.estevam@nxp.com>

ACK

Patch
diff mbox

diff --git a/sound/soc/fsl/fsl_ssi.c b/sound/soc/fsl/fsl_ssi.c
index 0b74d1c..173cb84 100644
--- a/sound/soc/fsl/fsl_ssi.c
+++ b/sound/soc/fsl/fsl_ssi.c
@@ -35,6 +35,7 @@ 
 #include <linux/module.h>
 #include <linux/interrupt.h>
 #include <linux/clk.h>
+#include <linux/ctype.h>
 #include <linux/device.h>
 #include <linux/delay.h>
 #include <linux/slab.h>
@@ -1315,14 +1316,10 @@  static struct snd_ac97_bus_ops fsl_ssi_ac97_ops = {
  */
 static void make_lowercase(char *s)
 {
-	char *p = s;
-	char c;
-
-	while ((c = *p)) {
-		if ((c >= 'A') && (c <= 'Z'))
-			*p = c + ('a' - 'A');
-		p++;
-	}
+	if (!s)
+		return;
+	for (; *s; s++)
+		*s = tolower(*s);
 }
 
 static int fsl_ssi_imx_probe(struct platform_device *pdev,