From: kernel test robot <lkp@intel.com>
To: kbuild-all@lists.01.org
Subject: [omap-audio:peter/linux-next-wip 1/64] sound/soc/ti/davinci-mcasp.c:863:56: warning: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from 384 to 128
Date: Mon, 05 Jul 2021 18:58:26 +0800 [thread overview]
Message-ID: <202107051820.cB7Ux3ab-lkp@intel.com> (raw)
[-- Attachment #1: Type: text/plain, Size: 6683 bytes --]
tree: https://github.com/omap-audio/linux-audio peter/linux-next-wip
head: 2f0a632db0b52321f1fc3623d088a741aeb72ef7
commit: aa00ca91ffa8bfc79cc25d1d957ef7dd0c7ae4ba [1/64] ASoC: ti: davinci-mcasp: Fix DIT mode support
config: x86_64-randconfig-a015-20210705 (attached as .config)
compiler: clang version 13.0.0 (https://github.com/llvm/llvm-project 3f9bf9f42a9043e20c6d2a74dd4f47a90a7e2b41)
reproduce (this is a W=1 build):
wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
chmod +x ~/bin/make.cross
# install x86_64 cross compiling tool for clang build
# apt-get install binutils-x86-64-linux-gnu
# https://github.com/omap-audio/linux-audio/commit/aa00ca91ffa8bfc79cc25d1d957ef7dd0c7ae4ba
git remote add omap-audio https://github.com/omap-audio/linux-audio
git fetch --no-tags omap-audio peter/linux-next-wip
git checkout aa00ca91ffa8bfc79cc25d1d957ef7dd0c7ae4ba
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross ARCH=x86_64
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
>> sound/soc/ti/davinci-mcasp.c:863:56: warning: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from 384 to 128 [-Wconstant-conversion]
u8 slots = mcasp->op_mode == DAVINCI_MCASP_DIT_MODE ? 384 : mcasp->tdm_slots;
~~~~~ ^~~
1 warning generated.
vim +863 sound/soc/ti/davinci-mcasp.c
855
856 static int mcasp_common_hw_param(struct davinci_mcasp *mcasp, int stream,
857 int period_words, int channels)
858 {
859 struct snd_dmaengine_dai_dma_data *dma_data = &mcasp->dma_data[stream];
860 int i;
861 u8 tx_ser = 0;
862 u8 rx_ser = 0;
> 863 u8 slots = mcasp->op_mode == DAVINCI_MCASP_DIT_MODE ? 384 : mcasp->tdm_slots;
864 u8 max_active_serializers = (channels + slots - 1) / slots;
865 u8 max_rx_serializers, max_tx_serializers;
866 int active_serializers, numevt;
867 u32 reg;
868 /* Default configuration */
869 if (mcasp->version < MCASP_VERSION_3)
870 mcasp_set_bits(mcasp, DAVINCI_MCASP_PWREMUMGT_REG, MCASP_SOFT);
871
872 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
873 mcasp_set_reg(mcasp, DAVINCI_MCASP_TXSTAT_REG, 0xFFFFFFFF);
874 mcasp_clr_bits(mcasp, DAVINCI_MCASP_XEVTCTL_REG, TXDATADMADIS);
875 max_tx_serializers = max_active_serializers;
876 max_rx_serializers =
877 mcasp->active_serializers[SNDRV_PCM_STREAM_CAPTURE];
878 } else {
879 mcasp_set_reg(mcasp, DAVINCI_MCASP_RXSTAT_REG, 0xFFFFFFFF);
880 mcasp_clr_bits(mcasp, DAVINCI_MCASP_REVTCTL_REG, RXDATADMADIS);
881 max_tx_serializers =
882 mcasp->active_serializers[SNDRV_PCM_STREAM_PLAYBACK];
883 max_rx_serializers = max_active_serializers;
884 }
885
886 for (i = 0; i < mcasp->num_serializer; i++) {
887 mcasp_set_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
888 mcasp->serial_dir[i]);
889 if (mcasp->serial_dir[i] == TX_MODE &&
890 tx_ser < max_tx_serializers) {
891 mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
892 mcasp->dismod, DISMOD_MASK);
893 set_bit(PIN_BIT_AXR(i), &mcasp->pdir);
894 tx_ser++;
895 } else if (mcasp->serial_dir[i] == RX_MODE &&
896 rx_ser < max_rx_serializers) {
897 clear_bit(PIN_BIT_AXR(i), &mcasp->pdir);
898 rx_ser++;
899 } else {
900 /* Inactive or unused pin, set it to inactive */
901 mcasp_mod_bits(mcasp, DAVINCI_MCASP_XRSRCTL_REG(i),
902 SRMOD_INACTIVE, SRMOD_MASK);
903 /* If unused, set DISMOD for the pin */
904 if (mcasp->serial_dir[i] != INACTIVE_MODE)
905 mcasp_mod_bits(mcasp,
906 DAVINCI_MCASP_XRSRCTL_REG(i),
907 mcasp->dismod, DISMOD_MASK);
908 clear_bit(PIN_BIT_AXR(i), &mcasp->pdir);
909 }
910 }
911
912 if (stream == SNDRV_PCM_STREAM_PLAYBACK) {
913 active_serializers = tx_ser;
914 numevt = mcasp->txnumevt;
915 reg = mcasp->fifo_base + MCASP_WFIFOCTL_OFFSET;
916 } else {
917 active_serializers = rx_ser;
918 numevt = mcasp->rxnumevt;
919 reg = mcasp->fifo_base + MCASP_RFIFOCTL_OFFSET;
920 }
921
922 if (active_serializers < max_active_serializers) {
923 dev_warn(mcasp->dev, "stream has more channels (%d) than are "
924 "enabled in mcasp (%d)\n", channels,
925 active_serializers * slots);
926 return -EINVAL;
927 }
928
929 /* AFIFO is not in use */
930 if (!numevt) {
931 /* Configure the burst size for platform drivers */
932 if (active_serializers > 1) {
933 /*
934 * If more than one serializers are in use we have one
935 * DMA request to provide data for all serializers.
936 * For example if three serializers are enabled the DMA
937 * need to transfer three words per DMA request.
938 */
939 dma_data->maxburst = active_serializers;
940 } else {
941 dma_data->maxburst = 0;
942 }
943
944 goto out;
945 }
946
947 if (period_words % active_serializers) {
948 dev_err(mcasp->dev, "Invalid combination of period words and "
949 "active serializers: %d, %d\n", period_words,
950 active_serializers);
951 return -EINVAL;
952 }
953
954 /*
955 * Calculate the optimal AFIFO depth for platform side:
956 * The number of words for numevt need to be in steps of active
957 * serializers.
958 */
959 numevt = (numevt / active_serializers) * active_serializers;
960
961 while (period_words % numevt && numevt > 0)
962 numevt -= active_serializers;
963 if (numevt <= 0)
964 numevt = active_serializers;
965
966 mcasp_mod_bits(mcasp, reg, active_serializers, NUMDMA_MASK);
967 mcasp_mod_bits(mcasp, reg, NUMEVT(numevt), NUMEVT_MASK);
968
969 /* Configure the burst size for platform drivers */
970 if (numevt == 1)
971 numevt = 0;
972 dma_data->maxburst = numevt;
973
974 out:
975 mcasp->active_serializers[stream] = active_serializers;
976
977 return 0;
978 }
979
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
[-- Attachment #2: config.gz --]
[-- Type: application/gzip, Size: 41890 bytes --]
next reply other threads:[~2021-07-05 10:58 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-07-05 10:58 kernel test robot [this message]
-- strict thread matches above, loose matches on Subject: below --
2021-05-01 19:37 [omap-audio:peter/linux-next-wip 1/64] sound/soc/ti/davinci-mcasp.c:863:56: warning: implicit conversion from 'int' to 'u8' (aka 'unsigned char') changes value from 384 to 128 kernel test robot
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=202107051820.cB7Ux3ab-lkp@intel.com \
--to=lkp@intel.com \
--cc=kbuild-all@lists.01.org \
/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.