From: yxj Date: Thu, 16 Aug 2012 01:54:03 +0000 (+0800) Subject: fix bug in set_dsp_lut,only 10 words can updated by user before this bug fixed X-Git-Tag: firefly_0821_release~8806 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=12c4a147646b641ec7fb01749fa567be82796921;p=firefly-linux-kernel-4.4.55.git fix bug in set_dsp_lut,only 10 words can updated by user before this bug fixed --- diff --git a/drivers/video/rockchip/rkfb_sysfs.c b/drivers/video/rockchip/rkfb_sysfs.c index 240d48364e54..1ee1b06ceaaa 100644 --- a/drivers/video/rockchip/rkfb_sysfs.c +++ b/drivers/video/rockchip/rkfb_sysfs.c @@ -247,7 +247,7 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, { int dsp_lut[256]; char *start = buf; - int i=256,temp; + int i=256,j,temp; int space_max = 10; struct fb_info *fbi = dev_get_drvdata(dev); @@ -259,9 +259,10 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, temp = i; dsp_lut[i] = temp + (temp<<8) + (temp<<16); //init by default value } - //printk("%s\n",start); + //printk("count:%d\n>>%s\n\n",count,start); for(i=0;i<256;i++) { + space_max = 10; //max space number 10; temp = simple_strtoul(start,NULL,10); dsp_lut[i] = temp; do @@ -275,7 +276,14 @@ static ssize_t set_dsp_lut(struct device *dev,struct device_attribute *attr, else start++; } - +#if 0 + for(i=0;i<16;i++) + { + for(j=0;j<16;j++) + printk("0x%08x ",dsp_lut[i*16+j]); + printk("\n"); + } +#endif dev_drv->set_dsp_lut(dev_drv,dsp_lut); return count;