Re: [PATCH] staging/msm: clearup read syscalls in kernel space

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

 



On 03/18/2011 10:37 AM, Xiaochen Wang wrote:
> Description:
>  1. use filp_open/vfs_read/filp_close instead of system calls
>  2. fix double calling of sys_close when first sys_lseek fails
>  3. reset segment fs when reading file into kernel space buffer

Hmm, this is still ugly and no driver should do that. This should rather
be converted to request_firmware, right?

> @@ -40,9 +40,15 @@ static void memset16(void *_ptr, unsigned short val, unsigned count)
>  int load_565rle_image(char *filename)
>  {
>  	struct fb_info *info;
> -	int fd, err = 0;
> +	struct file *filp;
> +	int err = 0;
>  	unsigned count, max;
>  	unsigned short *data, *bits, *ptr;
> +	mm_segment_t fs;
> +	loff_t pos;
> +
> +	fs = get_fs();
> +	set_fs(get_ds());
>  
>  	info = registered_fb[0];
>  	if (!info) {
...

regards,
-- 
js
_______________________________________________
devel mailing list
devel@xxxxxxxxxxxxxxxxxxxxxx
http://driverdev.linuxdriverproject.org/mailman/listinfo/devel


[Index of Archives]     [Linux Driver Backports]     [DMA Engine]     [Linux GPIO]     [Linux SPI]     [Video for Linux]     [Linux USB Devel]     [Linux Coverity]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Yosemite Backpacking]
  Powered by Linux