All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Kuninori Morimoto <kuninori.morimoto.gx@renesas.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [morimoto:sound-cleanup-2026-07-17-2 301/301] sound/soc/codecs/max98088.c:1434 max98088_setup_eq1() warn: inconsistent indenting
Date: Sat, 18 Jul 2026 21:07:17 +0800	[thread overview]
Message-ID: <202607182013.DwiU3hSD-lkp@intel.com> (raw)

tree:   https://github.com/morimoto/linux sound-cleanup-2026-07-17-2
head:   0031be0dff2c86cbb204c3d1bb5ee9797cb9cb53
commit: 0c857e9649f4f24d4bded34db298d59905f59971 [301/301] dai
config: i386-randconfig-141 (https://download.01.org/0day-ci/archive/20260718/202607182013.DwiU3hSD-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
smatch: v0.5.0-9185-gbcc58b9c

If you fix the issue in a separate patch/commit (i.e. not just a new version of
the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202607182013.DwiU3hSD-lkp@intel.com/

New smatch warnings:
sound/soc/codecs/max98088.c:1434 max98088_setup_eq1() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1482 max98088_setup_eq2() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1581 max98088_handle_eq_pdata() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1642 max98088_handle_pdata() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1675 max98088_probe() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1736 max98088_remove() warn: inconsistent indenting

Old smatch warnings:
sound/soc/codecs/max98088.c:657 max98088_line_pga() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1026 max98088_dai2_hw_params() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1096 max98088_dai_set_sysclk() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1100 max98088_dai_set_sysclk() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1112 max98088_dai_set_sysclk() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1141 max98088_dai1_set_fmt() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1212 max98088_dai2_set_fmt() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1279 max98088_dai1_mute() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1295 max98088_dai2_mute() warn: inconsistent indenting
sound/soc/codecs/max98088.c:1537 max98088_put_eq_enum() warn: inconsistent indenting

vim +1434 sound/soc/codecs/max98088.c

  1430	
  1431	static void max98088_setup_eq1(struct snd_soc_component *component)
  1432	{
  1433		struct device *dev = snd_soc_component_to_dev(component);
> 1434	       struct max98088_priv *max98088 = dev_get_drvdata(dev);
  1435	       struct max98088_pdata *pdata = max98088->pdata;
  1436	       struct max98088_eq_cfg *coef_set;
  1437	       int best, best_val, save, i, sel, fs;
  1438	       struct max98088_cdata *cdata;
  1439	
  1440	       cdata = &max98088->dai[0];
  1441	
  1442	       if (!pdata || !max98088->eq_textcnt)
  1443	               return;
  1444	
  1445	       /* Find the selected configuration with nearest sample rate */
  1446	       fs = cdata->rate;
  1447	       sel = cdata->eq_sel;
  1448	
  1449	       best = 0;
  1450	       best_val = INT_MAX;
  1451	       for (i = 0; i < pdata->eq_cfgcnt; i++) {
  1452	               if (strcmp(pdata->eq_cfg[i].name, max98088->eq_texts[sel]) == 0 &&
  1453	                   abs(pdata->eq_cfg[i].rate - fs) < best_val) {
  1454	                       best = i;
  1455	                       best_val = abs(pdata->eq_cfg[i].rate - fs);
  1456	               }
  1457	       }
  1458	
  1459	       dev_dbg(dev, "Selected %s/%dHz for %dHz sample rate\n",
  1460	               pdata->eq_cfg[best].name,
  1461	               pdata->eq_cfg[best].rate, fs);
  1462	
  1463	       /* Disable EQ while configuring, and save current on/off state */
  1464	       save = snd_soc_component_read(component, M98088_REG_49_CFG_LEVEL);
  1465	       snd_soc_component_update_bits(component, M98088_REG_49_CFG_LEVEL, M98088_EQ1EN, 0);
  1466	
  1467	       coef_set = &pdata->eq_cfg[sel];
  1468	
  1469	       m98088_eq_band(component, 0, 0, coef_set->band1);
  1470	       m98088_eq_band(component, 0, 1, coef_set->band2);
  1471	       m98088_eq_band(component, 0, 2, coef_set->band3);
  1472	       m98088_eq_band(component, 0, 3, coef_set->band4);
  1473	       m98088_eq_band(component, 0, 4, coef_set->band5);
  1474	
  1475	       /* Restore the original on/off state */
  1476	       snd_soc_component_update_bits(component, M98088_REG_49_CFG_LEVEL, M98088_EQ1EN, save);
  1477	}
  1478	
  1479	static void max98088_setup_eq2(struct snd_soc_component *component)
  1480	{
  1481		struct device *dev = snd_soc_component_to_dev(component);
> 1482	       struct max98088_priv *max98088 = dev_get_drvdata(dev);
  1483	       struct max98088_pdata *pdata = max98088->pdata;
  1484	       struct max98088_eq_cfg *coef_set;
  1485	       int best, best_val, save, i, sel, fs;
  1486	       struct max98088_cdata *cdata;
  1487	
  1488	       cdata = &max98088->dai[1];
  1489	
  1490	       if (!pdata || !max98088->eq_textcnt)
  1491	               return;
  1492	
  1493	       /* Find the selected configuration with nearest sample rate */
  1494	       fs = cdata->rate;
  1495	
  1496	       sel = cdata->eq_sel;
  1497	       best = 0;
  1498	       best_val = INT_MAX;
  1499	       for (i = 0; i < pdata->eq_cfgcnt; i++) {
  1500	               if (strcmp(pdata->eq_cfg[i].name, max98088->eq_texts[sel]) == 0 &&
  1501	                   abs(pdata->eq_cfg[i].rate - fs) < best_val) {
  1502	                       best = i;
  1503	                       best_val = abs(pdata->eq_cfg[i].rate - fs);
  1504	               }
  1505	       }
  1506	
  1507	       dev_dbg(dev, "Selected %s/%dHz for %dHz sample rate\n",
  1508	               pdata->eq_cfg[best].name,
  1509	               pdata->eq_cfg[best].rate, fs);
  1510	
  1511	       /* Disable EQ while configuring, and save current on/off state */
  1512	       save = snd_soc_component_read(component, M98088_REG_49_CFG_LEVEL);
  1513	       snd_soc_component_update_bits(component, M98088_REG_49_CFG_LEVEL, M98088_EQ2EN, 0);
  1514	
  1515	       coef_set = &pdata->eq_cfg[sel];
  1516	
  1517	       m98088_eq_band(component, 1, 0, coef_set->band1);
  1518	       m98088_eq_band(component, 1, 1, coef_set->band2);
  1519	       m98088_eq_band(component, 1, 2, coef_set->band3);
  1520	       m98088_eq_band(component, 1, 3, coef_set->band4);
  1521	       m98088_eq_band(component, 1, 4, coef_set->band5);
  1522	
  1523	       /* Restore the original on/off state */
  1524	       snd_soc_component_update_bits(component, M98088_REG_49_CFG_LEVEL, M98088_EQ2EN,
  1525	               save);
  1526	}
  1527	
  1528	static int max98088_put_eq_enum(struct snd_kcontrol *kcontrol,
  1529	                                struct snd_ctl_elem_value *ucontrol)
  1530	{
  1531	       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
  1532	       struct device *dev = snd_soc_component_to_dev(component);
  1533	       struct max98088_priv *max98088 = dev_get_drvdata(dev);
  1534	       struct max98088_pdata *pdata = max98088->pdata;
  1535	       int channel = max98088_get_channel(component, kcontrol->id.name);
  1536	       struct max98088_cdata *cdata;
  1537		int sel = ucontrol->value.enumerated.item[0];
  1538	
  1539	       if (channel < 0)
  1540		       return channel;
  1541	
  1542	       cdata = &max98088->dai[channel];
  1543	
  1544	       if (sel >= pdata->eq_cfgcnt)
  1545	               return -EINVAL;
  1546	
  1547	       cdata->eq_sel = sel;
  1548	
  1549	       switch (channel) {
  1550	       case 0:
  1551	               max98088_setup_eq1(component);
  1552	               break;
  1553	       case 1:
  1554	               max98088_setup_eq2(component);
  1555	               break;
  1556	       }
  1557	
  1558	       return 0;
  1559	}
  1560	
  1561	static int max98088_get_eq_enum(struct snd_kcontrol *kcontrol,
  1562	                                struct snd_ctl_elem_value *ucontrol)
  1563	{
  1564	       struct snd_soc_component *component = snd_kcontrol_chip(kcontrol);
  1565	       struct device *dev = snd_soc_component_to_dev(component);
  1566	       struct max98088_priv *max98088 = dev_get_drvdata(dev);
  1567	       int channel = max98088_get_channel(component, kcontrol->id.name);
  1568	       struct max98088_cdata *cdata;
  1569	
  1570	       if (channel < 0)
  1571		       return channel;
  1572	
  1573	       cdata = &max98088->dai[channel];
  1574	       ucontrol->value.enumerated.item[0] = cdata->eq_sel;
  1575	       return 0;
  1576	}
  1577	
  1578	static void max98088_handle_eq_pdata(struct snd_soc_component *component)
  1579	{
  1580		struct device *dev = snd_soc_component_to_dev(component);
> 1581	       struct max98088_priv *max98088 = dev_get_drvdata(dev);
  1582	       struct max98088_pdata *pdata = max98088->pdata;
  1583	       struct max98088_eq_cfg *cfg;
  1584	       unsigned int cfgcnt;
  1585	       int i, j;
  1586	       const char **t;
  1587	       int ret;
  1588	       struct snd_kcontrol_new controls[] = {
  1589	               SOC_ENUM_EXT((char *)eq_mode_name[0],
  1590	                       max98088->eq_enum,
  1591	                       max98088_get_eq_enum,
  1592	                       max98088_put_eq_enum),
  1593	               SOC_ENUM_EXT((char *)eq_mode_name[1],
  1594	                       max98088->eq_enum,
  1595	                       max98088_get_eq_enum,
  1596	                       max98088_put_eq_enum),
  1597	       };
  1598	       BUILD_BUG_ON(ARRAY_SIZE(controls) != ARRAY_SIZE(eq_mode_name));
  1599	
  1600	       cfg = pdata->eq_cfg;
  1601	       cfgcnt = pdata->eq_cfgcnt;
  1602	
  1603	       /* Setup an array of texts for the equalizer enum.
  1604	        * This is based on Mark Brown's equalizer driver code.
  1605	        */
  1606	       max98088->eq_textcnt = 0;
  1607	       max98088->eq_texts = NULL;
  1608	       for (i = 0; i < cfgcnt; i++) {
  1609	               for (j = 0; j < max98088->eq_textcnt; j++) {
  1610	                       if (strcmp(cfg[i].name, max98088->eq_texts[j]) == 0)
  1611	                               break;
  1612	               }
  1613	
  1614	               if (j != max98088->eq_textcnt)
  1615	                       continue;
  1616	
  1617	               /* Expand the array */
  1618	               t = krealloc(max98088->eq_texts,
  1619	                            sizeof(char *) * (max98088->eq_textcnt + 1),
  1620	                            GFP_KERNEL);
  1621	               if (t == NULL)
  1622	                       continue;
  1623	
  1624	               /* Store the new entry */
  1625	               t[max98088->eq_textcnt] = cfg[i].name;
  1626	               max98088->eq_textcnt++;
  1627	               max98088->eq_texts = t;
  1628	       }
  1629	
  1630	       /* Now point the soc_enum to .texts array items */
  1631	       max98088->eq_enum.texts = max98088->eq_texts;
  1632	       max98088->eq_enum.items = max98088->eq_textcnt;
  1633	
  1634	       ret = snd_soc_component_add_controls(component, controls, ARRAY_SIZE(controls));
  1635	       if (ret != 0)
  1636	               dev_err(dev, "Failed to add EQ control: %d\n", ret);
  1637	}
  1638	

--
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki

                 reply	other threads:[~2026-07-18 13:08 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=202607182013.DwiU3hSD-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=kuninori.morimoto.gx@renesas.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /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 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.