Skip to contentSkip to conversation

sound/soc/sof/intel/hda.c:1126:9: error: assigning to 'struct snd_soc_acpi_link_adr *' from 'const struct snd_soc_acpi_link_adr *' discards qualifiers

PATCH Nick Desaulniers 2 participants 2 messages Jan 13, 2020 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): 202001111315.uMPWi1Pb%[email protected]

#1 lore raw

Hi Bard,
Below is a warning from a 0day bot build with Clang. The warning looks legit, can you please take a look?

Quoted 99 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
TO: Bard Liao <[email protected]>
CC: "Pierre-Louis Bossart" <[email protected]>

tree:   https://github.com/plbossart/sound integration/soundwire-sof-20200109
head:   aa85a698ad25db1ca48acb16c0661c4b998bd7ee
commit: aa85a698ad25db1ca48acb16c0661c4b998bd7ee [14/14] ASoC: SOF: select machine driver with sdw adr.
config: arm64-allyesconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project 4ebb589629b0d3de0827cab179338836ebb3a8b6)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout aa85a698ad25db1ca48acb16c0661c4b998bd7ee
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

sound/soc/sof/intel/hda.c:1126:9: error: assigning to 'struct snd_soc_acpi_link_adr *' from 'const struct snd_soc_acpi_link_adr *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

                           link = mach->links;
                                ^ ~~~~~~~~~~~

1 error generated.

vim +1126 sound/soc/sof/intel/hda.c

1097
1098 static int hda_sdw_machine_select(struct snd_sof_dev *sdev) 1099 {

  1100          struct hdac_bus *bus = sof_to_bus(sdev);
  1101          struct snd_soc_acpi_mach *mach;
  1102          struct snd_sof_pdata *pdata = sdev->pdata;
  1103          struct sof_intel_hda_dev *hdev = pdata->hw_pdata;
  1104          u32 link_mask;
  1105          struct snd_soc_acpi_link_adr *link;
  1106          int i;
  1107
  1108          link_mask = hdev->info.link_mask;
  1109
  1110          /*
  1111           * Select SoundWire machine driver if needed using the
  1112           * alternate tables. This case deals with SoundWire-only
  1113           * machines, for mixed cases with I2C/I2S the detection relies
  1114           * on the HID list.
  1115           */

1116 if (link_mask && !pdata->machine) {
1117 for (mach = pdata->desc->alt_machines;
1118 mach && mach->link_mask; mach++) {
1119 if (mach->link_mask != link_mask)
1120 continue;
1121
1122 /* No need to match adr if there is no links defined */
1123 if (!mach->links)
1124 break;
1125

Quoted 1 line

1126 link = mach->links;

1127 for (i = 0; i < hdev->info.count; i++, link++) {
1128 /*

  1129                                   * Try next machine if any expected Slaves
  1130                                   * are not found on this link.
  1131                                   */
  1132                                  if (!link_slaves_found(sdev, link, hdev->sdw))
  1133                                          break;
  1134                          }
  1135                          /* Found if all Slaves are checked */
  1136                          if (i == hdev->info.count)
  1137                                  break;
  1138                  }
  1139                  if (mach && mach->link_mask) {
  1140                          dev_dbg(bus->dev,
  1141                                  "SoundWire machine driver %s topology %s\n",
  1142                                  mach->drv_name,
  1143                                  mach->sof_tplg_filename);
  1144                          pdata->machine = mach;
  1145                          mach->mach_params.platform = dev_name(sdev->dev);
  1146                          pdata->fw_filename = mach->sof_fw_filename;
  1147                          pdata->tplg_filename = mach->sof_tplg_filename;
  1148                  } else {
  1149                          dev_info(sdev->dev,
  1150                                   "No SoundWire machine driver found\n");
  1151                  }
  1152          }
  1153
  1154          return 0;
  1155  }
  1156  #else
  1157  static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
  1158  {

1159 return 0;
1160 }
1161 #endif
1162

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation

Signature · 2 lines
Thanks,
~Nick Desaulniers
#2 lore raw

Fixed already

Quoted 107 lines · Nick Desaulniers

Hi Bard,
Below is a warning from a 0day bot build with Clang. The warning looks legit, can you please take a look?

Quoted 99 lines · kbuild test robot

CC: kbuild-all(a)lists.01.org
TO: Bard Liao <[email protected]>
CC: "Pierre-Louis Bossart" <[email protected]>

tree:   https://github.com/plbossart/sound integration/soundwire-sof-20200109
head:   aa85a698ad25db1ca48acb16c0661c4b998bd7ee
commit: aa85a698ad25db1ca48acb16c0661c4b998bd7ee [14/14] ASoC: SOF: select machine driver with sdw adr.
config: arm64-allyesconfig (attached as .config)
compiler: clang version 10.0.0 (git://gitmirror/llvm_project 4ebb589629b0d3de0827cab179338836ebb3a8b6)

reproduce:
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross
git checkout aa85a698ad25db1ca48acb16c0661c4b998bd7ee
# save the attached .config to linux build tree
make.cross ARCH=arm64

If you fix the issue, kindly add following tag

All errors (new ones prefixed by >>):

Quoted 1 line
Quoted 1 line

sound/soc/sof/intel/hda.c:1126:9: error: assigning to 'struct snd_soc_acpi_link_adr *' from 'const struct snd_soc_acpi_link_adr *' discards qualifiers [-Werror,-Wincompatible-pointer-types-discards-qualifiers]

                            link = mach->links;
                                 ^ ~~~~~~~~~~~
    1 error generated.

vim +1126 sound/soc/sof/intel/hda.c

   1097
   1098  static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
   1099  {
   1100          struct hdac_bus *bus = sof_to_bus(sdev);
   1101          struct snd_soc_acpi_mach *mach;
   1102          struct snd_sof_pdata *pdata = sdev->pdata;
   1103          struct sof_intel_hda_dev *hdev = pdata->hw_pdata;
   1104          u32 link_mask;
   1105          struct snd_soc_acpi_link_adr *link;
   1106          int i;
   1107
   1108          link_mask = hdev->info.link_mask;
   1109
   1110          /*
   1111           * Select SoundWire machine driver if needed using the
   1112           * alternate tables. This case deals with SoundWire-only
   1113           * machines, for mixed cases with I2C/I2S the detection relies
   1114           * on the HID list.
   1115           */
   1116          if (link_mask && !pdata->machine) {
   1117                  for (mach = pdata->desc->alt_machines;
   1118                       mach && mach->link_mask; mach++) {
   1119                          if (mach->link_mask != link_mask)
   1120                                  continue;
   1121
   1122                          /* No need to match adr if there is no links defined */
   1123                          if (!mach->links)
   1124                                  break;
   1125
Quoted 1 line

1126 link = mach->links;

   1127                          for (i = 0; i < hdev->info.count; i++, link++) {
   1128                                  /*
   1129                                   * Try next machine if any expected Slaves
   1130                                   * are not found on this link.
   1131                                   */
   1132                                  if (!link_slaves_found(sdev, link, hdev->sdw))
   1133                                          break;
   1134                          }
   1135                          /* Found if all Slaves are checked */
   1136                          if (i == hdev->info.count)
   1137                                  break;
   1138                  }
   1139                  if (mach && mach->link_mask) {
   1140                          dev_dbg(bus->dev,
   1141                                  "SoundWire machine driver %s topology %s\n",
   1142                                  mach->drv_name,
   1143                                  mach->sof_tplg_filename);
   1144                          pdata->machine = mach;
   1145                          mach->mach_params.platform = dev_name(sdev->dev);
   1146                          pdata->fw_filename = mach->sof_fw_filename;
   1147                          pdata->tplg_filename = mach->sof_tplg_filename;
   1148                  } else {
   1149                          dev_info(sdev->dev,
   1150                                   "No SoundWire machine driver found\n");
   1151                  }
   1152          }
   1153
   1154          return 0;
   1155  }
   1156  #else
   1157  static int hda_sdw_machine_select(struct snd_sof_dev *sdev)
   1158  {
   1159          return 0;
   1160  }
   1161  #endif
   1162

---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org Intel Corporation