Lines Matching refs:bufsize
71 unsigned int bufsize; in copyin() local
76 if (get_user(bufsize, &info->oprom_size)) in copyin()
79 if (bufsize == 0) in copyin()
85 if (bufsize > OPROMMAXPARAM) in copyin()
86 bufsize = OPROMMAXPARAM; in copyin()
88 if (!(*opp_p = kmalloc(sizeof(int) + bufsize + 1, GFP_KERNEL))) in copyin()
90 memset(*opp_p, 0, sizeof(int) + bufsize + 1); in copyin()
93 &info->oprom_array, bufsize)) { in copyin()
97 return bufsize; in copyin()
102 int n, bufsize; in getstrings() local
114 n = bufsize = 0; in getstrings()
115 while ((n < 2) && (bufsize < OPROMMAXPARAM)) { in getstrings()
116 if (get_user(c, &info->oprom_array[bufsize])) { in getstrings()
122 (*opp_p)->oprom_array[bufsize++] = c; in getstrings()
128 return bufsize; in getstrings()
151 int bufsize, len, error = 0; in openprom_sunos_ioctl() local
156 bufsize = getstrings((void *)arg, &opp); in openprom_sunos_ioctl()
158 bufsize = copyin((void *)arg, &opp); in openprom_sunos_ioctl()
160 if (bufsize < 0) in openprom_sunos_ioctl()
161 return bufsize; in openprom_sunos_ioctl()
170 if (len <= 0 || len > bufsize) { in openprom_sunos_ioctl()
176 len = prom_getproperty(node, opp->oprom_array, buffer, bufsize); in openprom_sunos_ioctl()
183 error = copyout((void *)arg, opp, sizeof(int) + bufsize); in openprom_sunos_ioctl()
193 if (len == 0 || len + 1 > bufsize) { in openprom_sunos_ioctl()
202 error = copyout((void *)arg, opp, sizeof(int) + bufsize); in openprom_sunos_ioctl()
208 len = opp->oprom_array + bufsize - buf; in openprom_sunos_ioctl()
222 if (bufsize < sizeof(int)) { in openprom_sunos_ioctl()
241 error = copyout((void *)arg, opp, bufsize + sizeof(int)); in openprom_sunos_ioctl()
247 if (bufsize >= 2*sizeof(int)) { in openprom_sunos_ioctl()
260 error = copyout((void *)arg, opp, bufsize + sizeof(int)); in openprom_sunos_ioctl()
274 error = copyout((void *)arg, opp, bufsize + sizeof(int)); in openprom_sunos_ioctl()
282 if (len > bufsize) { in openprom_sunos_ioctl()
290 error = copyout((void *)arg, opp, bufsize + sizeof(int)); in openprom_sunos_ioctl()