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()
173 if (fromoff >= from->len || tooff >= to->len) in fb_copy_cmap()
176 size = min_t(size_t, to->len - tooff, from->len - fromoff); in fb_copy_cmap()
181 memcpy(to->red+tooff, from->red+fromoff, size); in fb_copy_cmap()
182 memcpy(to->green+tooff, from->green+fromoff, size); in fb_copy_cmap()
183 memcpy(to->blue+tooff, from->blue+fromoff, size); in fb_copy_cmap()
184 if (from->transp && to->transp) in fb_copy_cmap()
185 memcpy(to->transp+tooff, from->transp+fromoff, size); in fb_copy_cmap()
189 int fb_cmap_to_user(const struct fb_cmap *from, struct fb_cmap_user *to) in fb_cmap_to_user() argument
194 if (to->start > from->start) in fb_cmap_to_user()
195 fromoff = to->start - from->start; in fb_cmap_to_user()
197 tooff = from->start - to->start; in fb_cmap_to_user()
198 if (fromoff >= from->len || tooff >= to->len) in fb_cmap_to_user()
201 size = min_t(size_t, to->len - tooff, from->len - fromoff); in fb_cmap_to_user()
206 if (copy_to_user(to->red+tooff, from->red+fromoff, size)) in fb_cmap_to_user()
208 if (copy_to_user(to->green+tooff, from->green+fromoff, size)) in fb_cmap_to_user()
210 if (copy_to_user(to->blue+tooff, from->blue+fromoff, size)) in fb_cmap_to_user()
212 if (from->transp && to->transp) in fb_cmap_to_user()
213 if (copy_to_user(to->transp+tooff, from->transp+fromoff, size)) in fb_cmap_to_user()