Re: [PATCH 2/11] staging: udlfb: fbdev character read and write support

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

 



On 08/18/2010 10:39 PM, Bernie Thompson wrote:
> +static ssize_t dlfb_ops_write(struct fb_info *info, const char __user *buf,
> +			  size_t count, loff_t *ppos)
> +{
> +	ssize_t result = -ENOSYS;
> +	struct dlfb_data *dev = info->par;
> +	u32 offset = (u32) *ppos;
> +
> +#if defined CONFIG_FB_SYS_FOPS || defined CONFIG_FB_SYS_FOPS_MODULE
> +
> +	result = fb_sys_write(info, buf, count, ppos);
> +
> +	if (result > 0) {
> +		int start = max((int)(offset / info->fix.line_length) - 1, 0);
> +		int lines = min((u32)((result / info->fix.line_length) + 1),
> +				(u32)info->var.yres);

This looks bogus. You are casting to u32 in min and then assigning to
int. First,  min_t and max_t helpers exist and should be used instead of
casting. Second, why you cast to u32 and assign the result to int?

thanks,
-- 
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