Re: [PATCH v2] media: video-i2c: add video-i2c driver

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

 



Hi Matt,

Thank you for the patch! Yet something to improve:

[auto build test ERROR on linuxtv-media/master]
[also build test ERROR on v4.16-rc2 next-20180223]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]

url:    https://github.com/0day-ci/linux/commits/Matt-Ranostay/media-video-i2c-add-video-i2c-driver/20180218-181041
base:   git://linuxtv.org/media_tree.git master
config: x86_64-randconfig-n0-02241505 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All error/warnings (new ones prefixed by >>):

   drivers/media/i2c/video-i2c.c: In function 'video_i2c_thread_vid_cap':
>> drivers/media/i2c/video-i2c.c:205:12: error: implicit declaration of function 'kthread_should_stop'; did you mean 'freezer_should_skip'? [-Werror=implicit-function-declaration]
     } while (!kthread_should_stop());
               ^~~~~~~~~~~~~~~~~~~
               freezer_should_skip
   drivers/media/i2c/video-i2c.c: In function 'start_streaming':
>> drivers/media/i2c/video-i2c.c:218:26: error: implicit declaration of function 'kthread_run'; did you mean 'it_real_fn'? [-Werror=implicit-function-declaration]
     data->kthread_vid_cap = kthread_run(video_i2c_thread_vid_cap, data,
                             ^~~~~~~~~~~
                             it_real_fn
>> drivers/media/i2c/video-i2c.c:218:24: warning: assignment makes pointer from integer without a cast [-Wint-conversion]
     data->kthread_vid_cap = kthread_run(video_i2c_thread_vid_cap, data,
                           ^
   drivers/media/i2c/video-i2c.c: In function 'stop_streaming':
>> drivers/media/i2c/video-i2c.c:243:2: error: implicit declaration of function 'kthread_stop'; did you mean 'vb2_thread_stop'? [-Werror=implicit-function-declaration]
     kthread_stop(data->kthread_vid_cap);
     ^~~~~~~~~~~~
     vb2_thread_stop
   cc1: some warnings being treated as errors

vim +205 drivers/media/i2c/video-i2c.c

   164	
   165	static int video_i2c_thread_vid_cap(void *priv)
   166	{
   167		struct video_i2c_data *data = priv;
   168	
   169		set_freezable();
   170	
   171		do {
   172			unsigned long start_jiffies = jiffies;
   173			unsigned int delay = msecs_to_jiffies(1000 / data->chip->max_fps);
   174			struct video_i2c_buffer *vid_cap_buf = NULL;
   175			int schedule_delay;
   176	
   177			try_to_freeze();
   178	
   179			spin_lock(&data->slock);
   180	
   181			if (!list_empty(&data->vid_cap_active)) {
   182				vid_cap_buf = list_entry(data->vid_cap_active.next,
   183							 struct video_i2c_buffer, list);
   184				list_del(&vid_cap_buf->list);
   185			}
   186	
   187			spin_unlock(&data->slock);
   188	
   189			if (vid_cap_buf) {
   190				struct vb2_buffer *vb2_buf = &vid_cap_buf->vb.vb2_buf;
   191				void *vbuf = vb2_plane_vaddr(vb2_buf, 0);
   192				int ret = data->chip->xfer(data, vbuf);
   193	
   194				vb2_buf->timestamp = ktime_get_ns();
   195				vb2_buffer_done(vb2_buf, ret ?
   196						VB2_BUF_STATE_ERROR : VB2_BUF_STATE_DONE);
   197			}
   198	
   199			schedule_delay = delay - (jiffies - start_jiffies);
   200	
   201			if (time_after(jiffies, start_jiffies + delay))
   202				schedule_delay = delay;
   203	
   204			schedule_timeout_interruptible(schedule_delay);
 > 205		} while (!kthread_should_stop());
   206	
   207		return 0;
   208	}
   209	
   210	static int start_streaming(struct vb2_queue *vq, unsigned int count)
   211	{
   212		struct video_i2c_data *data = vb2_get_drv_priv(vq);
   213		struct video_i2c_buffer *buf, *tmp;
   214	
   215		if (data->kthread_vid_cap)
   216			return 0;
   217	
 > 218		data->kthread_vid_cap = kthread_run(video_i2c_thread_vid_cap, data,
   219						    "%s-vid-cap", data->v4l2_dev.name);
   220		if (!IS_ERR(data->kthread_vid_cap))
   221			return 0;
   222	
   223		spin_lock(&data->slock);
   224	
   225		list_for_each_entry_safe(buf, tmp, &data->vid_cap_active, list) {
   226			list_del(&buf->list);
   227			vb2_buffer_done(&buf->vb.vb2_buf,
   228					VB2_BUF_STATE_QUEUED);
   229		}
   230	
   231		spin_unlock(&data->slock);
   232	
   233		return PTR_ERR(data->kthread_vid_cap);
   234	}
   235	
   236	static void stop_streaming(struct vb2_queue *vq)
   237	{
   238		struct video_i2c_data *data = vb2_get_drv_priv(vq);
   239	
   240		if (data->kthread_vid_cap == NULL)
   241			return;
   242	
 > 243		kthread_stop(data->kthread_vid_cap);
   244	
   245		spin_lock(&data->slock);
   246	
   247		while (!list_empty(&data->vid_cap_active)) {
   248			struct video_i2c_buffer *buf;
   249	
   250			buf = list_entry(data->vid_cap_active.next,
   251					 struct video_i2c_buffer, list);
   252			list_del(&buf->list);
   253			vb2_buffer_done(&buf->vb.vb2_buf, VB2_BUF_STATE_ERROR);
   254		}
   255		spin_unlock(&data->slock);
   256	
   257		data->kthread_vid_cap = NULL;
   258	}
   259	

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Input]     [Video for Linux]     [Gstreamer Embedded]     [Mplayer Users]     [Linux USB Devel]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux