[linux-next:master 7482/8423] sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   b9011c7e671dbbf59bb753283ddfd03f0c9eb865
commit: 03e786bd43410fa93e5d2459f7a43e90ff0ae801 [7482/8423] ASoC: sh: Add RZ/G2L SSIF-2 driver
config: arc-randconfig-s031-20210816 (attached as .config)
compiler: arceb-elf-gcc (GCC) 11.2.0
reproduce:
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # apt-get install sparse
        # sparse version: v0.6.3-348-gf0e6938b-dirty
        # https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=03e786bd43410fa93e5d2459f7a43e90ff0ae801
        git remote add linux-next https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
        git fetch --no-tags linux-next master
        git checkout 03e786bd43410fa93e5d2459f7a43e90ff0ae801
        # save the attached .config to linux build tree
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=arc SHELL=/bin/bash sound/soc/sh/

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@xxxxxxxxx>


sparse warnings: (new ones prefixed by >>)
>> sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression
>> sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression
>> sound/soc/sh/rz-ssi.c:317:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:317:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:317:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:335:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:335:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:335:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:338:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:338:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:338:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:340:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:340:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:340:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:343:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:343:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:343:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:359:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:359:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:359:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:432:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:432:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:432:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:488:30: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:488:30: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:488:30: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:524:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:524:46: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:524:46: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:546:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:546:38: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:546:38: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:562:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:562:38: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:562:38: sparse:     got struct rz_ssi_priv *ssi
   sound/soc/sh/rz-ssi.c:563:38: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected struct rz_ssi_priv [noderef] __iomem *priv @@     got struct rz_ssi_priv *ssi @@
   sound/soc/sh/rz-ssi.c:563:38: sparse:     expected struct rz_ssi_priv [noderef] __iomem *priv
   sound/soc/sh/rz-ssi.c:563:38: sparse:     got struct rz_ssi_priv *ssi
>> sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression
>> sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression
>> sound/soc/sh/rz-ssi.c:148:15: sparse: sparse: dereference of noderef expression
   sound/soc/sh/rz-ssi.c:150:9: sparse: sparse: dereference of noderef expression
   sound/soc/sh/rz-ssi.c:150:9: sparse: sparse: dereference of noderef expression

vim +148 sound/soc/sh/rz-ssi.c

   142	
   143	static void rz_ssi_reg_mask_setl(struct rz_ssi_priv __iomem *priv, uint reg,
   144					 u32 bclr, u32 bset)
   145	{
   146		u32 val;
   147	
 > 148		val = readl(priv->base + reg);
   149		val = (val & ~bclr) | bset;
   150		writel(val, (priv->base + reg));
   151	}
   152	
   153	static inline struct snd_soc_dai *
   154	rz_ssi_get_dai(struct snd_pcm_substream *substream)
   155	{
   156		struct snd_soc_pcm_runtime *rtd = asoc_substream_to_rtd(substream);
   157	
   158		return asoc_rtd_to_cpu(rtd, 0);
   159	}
   160	
   161	static inline bool rz_ssi_stream_is_play(struct rz_ssi_priv *ssi,
   162						 struct snd_pcm_substream *substream)
   163	{
   164		return substream->stream == SNDRV_PCM_STREAM_PLAYBACK;
   165	}
   166	
   167	static inline struct rz_ssi_stream *
   168	rz_ssi_stream_get(struct rz_ssi_priv *ssi, struct snd_pcm_substream *substream)
   169	{
   170		struct rz_ssi_stream *stream = &ssi->playback;
   171	
   172		if (substream->stream != SNDRV_PCM_STREAM_PLAYBACK)
   173			stream = &ssi->capture;
   174	
   175		return stream;
   176	}
   177	
   178	static int rz_ssi_stream_is_valid(struct rz_ssi_priv *ssi,
   179					  struct rz_ssi_stream *strm)
   180	{
   181		unsigned long flags;
   182		int ret;
   183	
   184		spin_lock_irqsave(&ssi->lock, flags);
   185		ret = !!(strm->substream && strm->substream->runtime);
   186		spin_unlock_irqrestore(&ssi->lock, flags);
   187	
   188		return ret;
   189	}
   190	
   191	static int rz_ssi_stream_init(struct rz_ssi_priv *ssi,
   192				      struct rz_ssi_stream *strm,
   193				      struct snd_pcm_substream *substream)
   194	{
   195		struct snd_pcm_runtime *runtime = substream->runtime;
   196	
   197		strm->substream = substream;
   198		strm->sample_width = samples_to_bytes(runtime, 1);
   199		strm->period_counter = 0;
   200		strm->buffer_pos = 0;
   201	
   202		strm->oerr_num = 0;
   203		strm->uerr_num = 0;
   204		strm->running = 0;
   205	
   206		/* fifo init */
   207		strm->fifo_sample_size = SSI_FIFO_DEPTH;
   208	
   209		return 0;
   210	}
   211	
   212	static void rz_ssi_stream_quit(struct rz_ssi_priv *ssi,
   213				       struct rz_ssi_stream *strm)
   214	{
   215		struct snd_soc_dai *dai = rz_ssi_get_dai(strm->substream);
   216		unsigned long flags;
   217	
   218		spin_lock_irqsave(&ssi->lock, flags);
   219		strm->substream = NULL;
   220		spin_unlock_irqrestore(&ssi->lock, flags);
   221	
   222		if (strm->oerr_num > 0)
   223			dev_info(dai->dev, "overrun = %d\n", strm->oerr_num);
   224	
   225		if (strm->uerr_num > 0)
   226			dev_info(dai->dev, "underrun = %d\n", strm->uerr_num);
   227	}
   228	
   229	static int rz_ssi_clk_setup(struct rz_ssi_priv *ssi, unsigned int rate,
   230				    unsigned int channels)
   231	{
   232		static s8 ckdv[16] = { 1,  2,  4,  8, 16, 32, 64, 128,
   233				       6, 12, 24, 48, 96, -1, -1, -1 };
   234		unsigned int channel_bits = 32;	/* System Word Length */
   235		unsigned long bclk_rate = rate * channels * channel_bits;
   236		unsigned int div;
   237		unsigned int i;
   238		u32 ssicr = 0;
   239		u32 clk_ckdv;
   240	
   241		/* Clear AUCKE so we can set MST */
   242		rz_ssi_reg_writel(ssi, SSIFCR, 0);
   243	
   244		/* Continue to output LRCK pin even when idle */
   245		rz_ssi_reg_writel(ssi, SSIOFR, SSIOFR_LRCONT);
   246		if (ssi->audio_clk_1 && ssi->audio_clk_2) {
   247			if (ssi->audio_clk_1 % bclk_rate)
   248				ssi->audio_mck = ssi->audio_clk_2;
   249			else
   250				ssi->audio_mck = ssi->audio_clk_1;
   251		}
   252	
   253		/* Clock setting */
   254		ssicr |= SSICR_MST;
   255		if (ssi->audio_mck == ssi->audio_clk_1)
   256			ssicr |= SSICR_CKS;
   257		if (ssi->bckp_rise)
   258			ssicr |= SSICR_BCKP;
   259		if (ssi->lrckp_fsync_fall)
   260			ssicr |= SSICR_LRCKP;
   261	
   262		/* Determine the clock divider */
   263		clk_ckdv = 0;
   264		div = ssi->audio_mck / bclk_rate;
   265		/* try to find an match */
   266		for (i = 0; i < ARRAY_SIZE(ckdv); i++) {
   267			if (ckdv[i] == div) {
   268				clk_ckdv = i;
   269				break;
   270			}
   271		}
   272	
   273		if (i == ARRAY_SIZE(ckdv)) {
   274			dev_err(ssi->dev, "Rate not divisible by audio clock source\n");
   275			return -EINVAL;
   276		}
   277	
   278		/*
   279		 * DWL: Data Word Length = 16 bits
   280		 * SWL: System Word Length = 32 bits
   281		 */
   282		ssicr |= SSICR_CKDV(clk_ckdv);
   283		ssicr |= SSICR_DWL(1) | SSICR_SWL(3);
   284		rz_ssi_reg_writel(ssi, SSICR, ssicr);
   285		rz_ssi_reg_writel(ssi, SSIFCR,
   286				  (SSIFCR_AUCKE | SSIFCR_TFRST | SSIFCR_RFRST));
   287	
   288		return 0;
   289	}
   290	
   291	static int rz_ssi_start(struct rz_ssi_priv *ssi, struct rz_ssi_stream *strm)
   292	{
   293		bool is_play = rz_ssi_stream_is_play(ssi, strm->substream);
   294		u32 ssicr, ssifcr;
   295	
   296		ssicr = rz_ssi_reg_readl(ssi, SSICR);
   297		ssifcr = rz_ssi_reg_readl(ssi, SSIFCR) & ~0xF;
   298	
   299		/* FIFO interrupt thresholds */
   300		rz_ssi_reg_writel(ssi, SSISCR,
   301				  SSISCR_TDES(strm->fifo_sample_size / 2 - 1) |
   302				  SSISCR_RDFS(0));
   303	
   304		/* enable IRQ */
   305		if (is_play) {
   306			ssicr |= SSICR_TUIEN | SSICR_TOIEN;
   307			ssifcr |= SSIFCR_TIE | SSIFCR_RFRST;
   308		} else {
   309			ssicr |= SSICR_RUIEN | SSICR_ROIEN;
   310			ssifcr |= SSIFCR_RIE | SSIFCR_TFRST;
   311		}
   312	
   313		rz_ssi_reg_writel(ssi, SSICR, ssicr);
   314		rz_ssi_reg_writel(ssi, SSIFCR, ssifcr);
   315	
   316		/* Clear all error flags */
 > 317		rz_ssi_reg_mask_setl(ssi, SSISR,
   318				     (SSISR_TOIRQ | SSISR_TUIRQ | SSISR_ROIRQ |
   319				      SSISR_RUIRQ), 0);
   320	
   321		strm->running = 1;
   322		ssicr |= is_play ? SSICR_TEN : SSICR_REN;
   323		rz_ssi_reg_writel(ssi, SSICR, ssicr);
   324	
   325		return 0;
   326	}
   327	

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Bugtraq]     [Linux OMAP]     [Linux MIPS]     [eCos]     [Asterisk Internet PBX]     [Linux API]

  Powered by Linux