lkml.org 
[lkml]   [2019]   [Oct]   [29]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: detecting misuse of of_get_property
On Tue, Oct 29, 2019 at 01:50:58PM +0300, Dan Carpenter wrote:
> +static void match_of_get_property(const char *fn, struct expression *expr, void *unused)
> +{
> + struct expression *left = expr->left;
> + struct symbol *type;
> +
> + type = get_type(left);
> + if (!type || type->type != SYM_PTR)
> + return;
> + type = get_base_type(type);
> + if (type_bits(type) == 8)
> + return;
> + if (type->type == SYM_RESTRICT)
> + return;

Wouldn't this also silently accept assignments to any bitwise
type: __le32, __be16, ... ?

-- Luc

\
 
 \ /
  Last update: 2019-10-29 12:49    [W:0.106 / U:0.396 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site