Lines Matching refs:from
164 int fb_copy_cmap(const struct fb_cmap *from, struct fb_cmap *to) in fb_copy_cmap() argument
169 if (to->start > from->start) in fb_copy_cmap()
170 fromoff = to->start - from->start; in fb_copy_cmap()
172 tooff = from->start - to->start; in fb_copy_cmap()
174 if (size > (int) (from->len - fromoff)) in fb_copy_cmap()
175 size = from->len - fromoff; in fb_copy_cmap()
180 memcpy(to->red+tooff, from->red+fromoff, size); in fb_copy_cmap()
181 memcpy(to->green+tooff, from->green+fromoff, size); in fb_copy_cmap()
182 memcpy(to->blue+tooff, from->blue+fromoff, size); in fb_copy_cmap()
183 if (from->transp && to->transp) in fb_copy_cmap()
184 memcpy(to->transp+tooff, from->transp+fromoff, size); in fb_copy_cmap()
188 int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to) in fb_cmap_to_user() argument
193 if (to->start > from->start) in fb_cmap_to_user()
194 fromoff = to->start - from->start; in fb_cmap_to_user()
196 tooff = from->start - to->start; in fb_cmap_to_user()
198 if (size > (int) (from->len - fromoff)) in fb_cmap_to_user()
199 size = from->len - fromoff; in fb_cmap_to_user()
204 if (copy_to_user(to->red+tooff, from->red+fromoff, size)) in fb_cmap_to_user()
206 if (copy_to_user(to->green+tooff, from->green+fromoff, size)) in fb_cmap_to_user()
208 if (copy_to_user(to->blue+tooff, from->blue+fromoff, size)) in fb_cmap_to_user()
210 if (from->transp && to->transp) in fb_cmap_to_user()
211 if (copy_to_user(to->transp+tooff, from->transp+fromoff, size)) in fb_cmap_to_user()