[PATCH] staging: greybus: fix warnings detected by sparse
This patch fix the following warnings from sparse, $ make C=2 drivers/staging/greybus/ drivers/staging/greybus/audio_codec.c:691:36: warning: incorrect type in initializer (different base types) drivers/staging/greybus/audio_codec.c:691:36:expected unsigned long long [usertype] formats drivers/staging/greybus/audio_codec.c:691:36:got restricted snd_pcm_format_t [usertype] drivers/staging/greybus/audio_codec.c:701:36: warning: incorrect type in initializer (different base types) drivers/staging/greybus/audio_codec.c:701:36:expected unsigned long long [usertype] formats drivers/staging/greybus/audio_codec.c:701:36:got restricted snd_pcm_format_t [usertype] drivers/staging/greybus/audio_module.c:222:25: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_module.c:222:25:expected restricted __le16 [usertype] data_cport drivers/staging/greybus/audio_module.c:222:25:got unsigned short [usertype] intf_cport_id drivers/staging/greybus/audio_topology.c:460:40: warning: restricted __le32 degrades to integer drivers/staging/greybus/audio_topology.c:691:41: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:691:41:expected unsigned int access drivers/staging/greybus/audio_topology.c:691:41:got restricted __le32 [usertype] access drivers/staging/greybus/audio_topology.c:746:44: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:746:44:expected unsigned int drivers/staging/greybus/audio_topology.c:746:44:got restricted __le32 drivers/staging/greybus/audio_topology.c:748:52: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:748:52:expected unsigned int drivers/staging/greybus/audio_topology.c:748:52:got restricted __le32 drivers/staging/greybus/audio_topology.c:802:42: warning: restricted __le32 degrades to integer drivers/staging/greybus/audio_topology.c:805:50: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:805:50:expected restricted __le32 drivers/staging/greybus/audio_topology.c:805:50:got unsigned int drivers/staging/greybus/audio_topology.c:814:50: warning: restricted __le32 degrades to integer drivers/staging/greybus/audio_topology.c:817:58: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:817:58:expected restricted __le32 drivers/staging/greybus/audio_topology.c:817:58:got unsigned int drivers/staging/greybus/audio_topology.c:889:25: warning: incorrect type in assignment (different base types) drivers/staging/greybus/audio_topology.c:889:25:expected unsigned int access drivers/staging/greybus/audio_topology.c:889:25:got restricted __le32 [usertype] access Signed-off-by: Coiby Xu --- drivers/staging/greybus/audio_codec.c| 4 ++-- drivers/staging/greybus/audio_module.c | 2 +- drivers/staging/greybus/audio_topology.c | 18 +- 3 files changed, 12 insertions(+), 12 deletions(-) diff --git a/drivers/staging/greybus/audio_codec.c b/drivers/staging/greybus/audio_codec.c index 74538f8c5fa4..494aa823e998 100644 --- a/drivers/staging/greybus/audio_codec.c +++ b/drivers/staging/greybus/audio_codec.c @@ -688,7 +688,7 @@ static struct snd_soc_dai_driver gbaudio_dai[] = { .playback = { .stream_name = "I2S 0 Playback", .rates = SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FORMAT_S16_LE, + .formats = SNDRV_PCM_FMTBIT_S16_LE, .rate_max = 48000, .rate_min = 48000, .channels_min = 1, @@ -698,7 +698,7 @@ static struct snd_soc_dai_driver gbaudio_dai[] = { .capture = { .stream_name = "I2S 0 Capture", .rates = SNDRV_PCM_RATE_48000, - .formats = SNDRV_PCM_FORMAT_S16_LE, + .formats = SNDRV_PCM_FMTBIT_S16_LE, .rate_max = 48000, .rate_min = 48000, .channels_min = 1, diff --git a/drivers/staging/greybus/audio_module.c b/drivers/staging/greybus/audio_module.c index 16f60256adb2..00848b84b022 100644 --- a/drivers/staging/greybus/audio_module.c +++ b/drivers/staging/greybus/audio_module.c @@ -219,7 +219,7 @@ static int gb_audio_add_data_connection(struct gbaudio_module_info *gbmodule, greybus_set_drvdata(bundle, gbmodule); dai->id = 0; - dai->data_cport = connection->intf_cport_id; + dai->data_cport = cpu_to_le16(connection->intf_cport_id); dai->connection = connection; list_add(&dai->list, &gbmodule->data_list); diff --git a/drivers/staging/greybus/audio_topology.c b/drivers/staging/greybus/audio_topology.c index 83b38ae8908
Re: [PATCH] media: staging/intel-ipu3: css: Correctly reset some memory
Thanks for the patch. On 8/22/20 9:11 PM, Christophe JAILLET wrote: > The intent here is to reset the whole 'scaler_coeffs_luma' array, not just > the first element. > > Fixes:e0a5b744 ("media: staging/intel-ipu3: css: Compute and > program ccs") > Signed-off-by: Christophe JAILLET > --- > drivers/staging/media/ipu3/ipu3-css-params.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/staging/media/ipu3/ipu3-css-params.c > b/drivers/staging/media/ipu3/ipu3-css-params.c > index fbd53d7c097c..e9d6bd9e9332 100644 > --- a/drivers/staging/media/ipu3/ipu3-css-params.c > +++ b/drivers/staging/media/ipu3/ipu3-css-params.c > @@ -159,7 +159,7 @@ imgu_css_scaler_calc(u32 input_width, u32 input_height, > u32 target_width, > > memset(&cfg->scaler_coeffs_chroma, 0, > sizeof(cfg->scaler_coeffs_chroma)); > - memset(&cfg->scaler_coeffs_luma, 0, sizeof(*cfg->scaler_coeffs_luma)); > + memset(&cfg->scaler_coeffs_luma, 0, sizeof(cfg->scaler_coeffs_luma)); > do { > phase_step_correction++; > > Reviewed-by: Bingbu Cao -- Best regards, Bingbu Cao ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH 00/49] DRM driver for Hikey 970
Hi John, Em Wed, 19 Aug 2020 20:28:44 -0700 John Stultz escreveu: > That said even with the patches I've got on top of your series, I > still see a few issues: > 1) I'm seeing red-blue swap with your driver. I need to dig a bit to > see what the difference is, I know gralloc has a config option for > this, and maybe the version of the driver I'm carrying has it wrong? Maybe it is due to this: drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c: hal_fmt = HISI_FB_PIXEL_FORMAT_BGRA_;/* dss_get_format(fb->pixel_format); */ It sounds to me that someone added a hack hardcoding BGRA_ over there. Btw, I removed the hack, with: diff --git a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c index a68db1a27bbf..ba64aae371e4 100644 --- a/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c +++ b/drivers/staging/hikey9xx/gpu/kirin9xx_drm_overlay_utils.c @@ -857,7 +857,7 @@ void hisi_fb_pan_display(struct drm_plane *plane) rect.right = src_w - 1; rect.top = 0; rect.bottom = src_h - 1; - hal_fmt = HISI_FB_PIXEL_FORMAT_BGRA_;/* dss_get_format(fb->pixel_format); */ + hal_fmt = dss_get_format(fb->format->format); DRM_DEBUG_DRIVER("channel%d: src:(%d,%d, %dx%d) crtc:(%d,%d, %dx%d), rect(%d,%d,%d,%d),fb:%dx%d, pixel_format=%d, stride=%d, paddr=0x%x, bpp=%d.\n", chn_idx, src_x, src_y, src_w, src_h, And now red and blue are swapped on my HDMI screen too. I'll compare this part with your version, but I guess the bug is on this logic. Thanks, Mauro ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel