320 if (sym_name_is("kmalloc_array", expr->fn))
321 return 1;
322 if (sym_name_is("vmalloc_array", expr->fn))
323 return 1;
324 if (sym_name_is("kvmalloc_array", expr->fn))
325 return 1;
326
327 if (sym_name_is("mmu_memory_cache_alloc", expr->fn))
328 return 1;
329 if (sym_name_is("kmem_alloc", expr->fn))
330 return 1;
331 if (sym_name_is("alloc_pages", expr->fn))
332 return 1;
333
334 if (sym_name_is("netdev_priv", expr->fn))
335 return 1;
336 if (sym_name_is("dev_get_drvdata", expr->fn))
337 return 1;
338 if (sym_name_is("i2c_get_clientdata", expr->fn))
339 return 1;
340
341 return 0;
342 }
343
344 static int is_uncasted_pointer_assign(void)
345 {
346 struct expression *expr;
347 struct symbol *left_type, *right_type;
348
349 expr = get_faked_expression();
350 if (!expr)
351 return 0;
352 if (expr->type == EXPR_PREOP || expr->type == EXPR_POSTOP) {
353 if (expr->op == SPECIAL_INCREMENT || expr->op == SPECIAL_DECREMENT)
354 return 1;
355 }
356 if (expr->type != EXPR_ASSIGNMENT)
357 return 0;
358 left_type = get_type(expr->left);
359 right_type = get_type(expr->right);
|
320 if (sym_name_is("kmalloc_array", expr->fn))
321 return 1;
322 if (sym_name_is("vmalloc_array", expr->fn))
323 return 1;
324 if (sym_name_is("kvmalloc_array", expr->fn))
325 return 1;
326
327 if (sym_name_is("mmu_memory_cache_alloc", expr->fn))
328 return 1;
329 if (sym_name_is("kmem_alloc", expr->fn))
330 return 1;
331 if (sym_name_is("alloc_pages", expr->fn))
332 return 1;
333
334 if (sym_name_is("netdev_priv", expr->fn))
335 return 1;
336 if (sym_name_is("dev_get_drvdata", expr->fn))
337 return 1;
338 if (sym_name_is("i2c_get_clientdata", expr->fn))
339 return 1;
340 if (sym_name_is("idr_find", expr->fn))
341 return 1;
342
343 return 0;
344 }
345
346 static int is_uncasted_pointer_assign(void)
347 {
348 struct expression *expr;
349 struct symbol *left_type, *right_type;
350
351 expr = get_faked_expression();
352 if (!expr)
353 return 0;
354 if (expr->type == EXPR_PREOP || expr->type == EXPR_POSTOP) {
355 if (expr->op == SPECIAL_INCREMENT || expr->op == SPECIAL_DECREMENT)
356 return 1;
357 }
358 if (expr->type != EXPR_ASSIGNMENT)
359 return 0;
360 left_type = get_type(expr->left);
361 right_type = get_type(expr->right);
|