Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4401243ybg; Tue, 29 Oct 2019 06:39:44 -0700 (PDT) X-Google-Smtp-Source: APXvYqxuHZzj5qjn6rPHyEO0Kx4YXkU0NpnEli1sf77b2u7HIlU/lYuuty8j1LBxqIPzoJaDzcCC X-Received: by 2002:a50:f781:: with SMTP id h1mr9130041edn.9.1572356384400; Tue, 29 Oct 2019 06:39:44 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572356384; cv=none; d=google.com; s=arc-20160816; b=jGalvSViWCGE/Ad2Fa4dwsJ6eYHo6/9ojoBiRcP7SVyEdMzQPMgAL/ekw1JMuFH+SS 8P8Mzwq1YDV5fRwMEsx3lzNXGr+wKGTOMSZtH/tBtDrvhK4Wo+hE/CjxhqWd0ndx0eoA gydTz52L10gJLKvTu7cTMMExfeDvOKN2KPdb32sx2m3ewnHNeZzyQsjaTTHimGp+sCMi jR/84wwwHz9qfP+JJgiKrOx7JOCuRatgePRFnDC8lvwzH/JyqWQUPocrjD15lUsN3AmL f1O679qkRLi77sjAwf/3cj3E7OaMuwP4UgmmpIBP/NaZ/0yKJBdHNICF6ztvTW8OIwu9 4UmA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=xiMDm1ky06nmshR0GScrWBxrzoPoulophvZ9wLbseww=; b=vhhJCCByQRIkuJIPb0D2mEmLVP/Ryb145FxJao0CM5AaOnYyZI3/azKo24n8ESPKKV QYby8ScZzVbiow39zyU1JMC1MVosRf3iQhXINWK4RtnJxD2xzrdQL7p1jFp7+sXsLw2J oE5sncduiPPI2HFc9/itNlm48pyfgs27HQSZm75AttKdwVKL/um/10NDB3/aESWJ1cfP nv/zgCCwGcU5s94v0EEx7n5ACshTq17ABAGKo3VdgHLCrflXTx19J4ZooJ7HmTgiPs+A +Rd8/ywqJKsonGGJAy9uJnH9ir6Voa10d+9SaHSFnwMEvu1KxBKE59F7p12v/+UdwmPP eong== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+ASarVj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si8375712ejz.43.2019.10.29.06.39.20; Tue, 29 Oct 2019 06:39:44 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=e+ASarVj; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2388799AbfJ2NiC (ORCPT + 99 others); Tue, 29 Oct 2019 09:38:02 -0400 Received: from mail-wr1-f52.google.com ([209.85.221.52]:41681 "EHLO mail-wr1-f52.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388578AbfJ2NiC (ORCPT ); Tue, 29 Oct 2019 09:38:02 -0400 Received: by mail-wr1-f52.google.com with SMTP id p4so13678780wrm.8; Tue, 29 Oct 2019 06:38:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=xiMDm1ky06nmshR0GScrWBxrzoPoulophvZ9wLbseww=; b=e+ASarVjckjzvyw0nQ7ljwc0J5bn9wwd19sEw98XUVM0LbXK6CZOfT6hSi0t9l37LO m9dRkbrsROVqUv6+7SYo5AzV+iKMdixExYZYLJ6NxlU3fhiny4GQ8vdS1h+197N73lW7 rArv8yKBuDLKVOwUiV83yyqe4llt/avnVYp2VVkJXkh5wUKPUj1WGooV/HfmqZ2PWKL2 4K7D0idXeb3gJ8dOtjgjkTwVOSSNawi5+VFalyGAetWILpS1fnUMJAQDAS7OtryydDXP LW946YNqADyO/INrnjFOfErLFxF2hq3kNAjzSflmRnud/63zA0+hWojEmyFIyAS0/jnK RvQA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=xiMDm1ky06nmshR0GScrWBxrzoPoulophvZ9wLbseww=; b=rkqioeXmhPvhNMnczHQll0jycIJxCr1VHNhl4ZK0gRTedopjguW4c/tDL4WLwZ8egJ /hNB5AsAWWRZwhyQbZgQEFZPQY8h/N3O0eZkv8/0WQssHwThQ49aibxgGBcAA6vaGf+A G1aPaXOolf2oRA1GeqWVfuzAkcmmRvEnbAYly1w1KY1YCKyZGmxfxrtCQMZ3futDELxM nnaJXfYnmo4l0YHnARXtm2SVxv9UT/5y0tTs7NpzHSXXIj0lDp33KOJ/Be+nH8JT013R NSAoky+CynTYQcH+4o3lQ9kjYj7z/ZRD0v9iS9sPXNn3XcmbrBwHSMq7CRtO0CywQTMb emAw== X-Gm-Message-State: APjAAAXUkYgD6MJnwOJEhFcIRz/3rQDg6hj4Vo2MLh6IEOWDk4YqTMxA Q1y5N3J5tNV+fuR2zV8fUhdKwt+I X-Received: by 2002:a5d:5383:: with SMTP id d3mr18655697wrv.55.1572356280195; Tue, 29 Oct 2019 06:38:00 -0700 (PDT) Received: from ltop.local ([2a02:a03f:40ac:ce00:e50c:dda6:99a6:2dfe]) by smtp.gmail.com with ESMTPSA id o15sm14429536wrv.76.2019.10.29.06.37.58 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2019 06:37:59 -0700 (PDT) Date: Tue, 29 Oct 2019 14:37:57 +0100 From: Luc Van Oostenryck To: Dan Carpenter Cc: Rasmus Villemoes , Dan Carpenter , linux-sparse@vger.kernel.org, LKML Subject: Re: detecting misuse of of_get_property Message-ID: <20191029133756.qpqk5vf6txapqm35@ltop.local> References: <20191029104917.GI1944@kadam> <20191029114750.a7inago2vd2o4lzl@ltop.local> <20191029125519.GA1705@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191029125519.GA1705@kadam> User-Agent: NeoMutt/20180716 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Oct 29, 2019 at 03:55:19PM +0300, Dan Carpenter wrote: > On Tue, Oct 29, 2019 at 12:47:50PM +0100, Luc Van Oostenryck wrote: > > 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, ... ? > > It does, yes. I'm not sure how big of an issue that is... Probably not much if it's just a one shot for Rasmus and probably not much more otherwise. > I always > just throw a check together and test it before I decide if it's worth > investing more time into it. Sure, but I was thinking about false negatives here. Regards, -- Luc