Received: by 2002:a25:d7c1:0:0:0:0:0 with SMTP id o184csp4271861ybg; Tue, 29 Oct 2019 04:49:07 -0700 (PDT) X-Google-Smtp-Source: APXvYqwOKr3E+eBw4X/nX0d+K4eQYQHr3LAYbX+1jXx6fum+/hobDAry3a1Fj/t/tlpQy+fNwTZD X-Received: by 2002:aa7:cdc6:: with SMTP id h6mr25441361edw.243.1572349747093; Tue, 29 Oct 2019 04:49:07 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1572349747; cv=none; d=google.com; s=arc-20160816; b=xASd91ea0dYE8ZA3KEfQzjpg0e7TR33WMldnDUl3Ufeu0u5kjiJzvvMfamdC7rHXGR 5eCzB5QkxxKOcevW5p78Jx3DJ3UcKdshBr93q7U0sxHbMUdGDn7jceli9kjbU+UP6WnD N0vGxFOBSGWFkAcOrX9/DGTHqC4ea4qYeQieu8utU1vfLvcFW6eV/e2YUmYGaLeweUi4 D5skP1FzZc0WXM8IKtPlrZKtViBhnbBxZVgO5BYfgHZFR2MK9rASpLbK6lFBX73u+HBG oKz5b0igROD/QxWHQf4zy9uua5yuuDPboo3wTGb13ZK9rV1mybraJOq/Nq7GSnQ/9ZsG szHw== 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=2/TTI53BPrTu7UjSNB/6Zde/szNTNtQeVJ8mD6hzll4=; b=FI6Jufwo3iLX254j4eHVTdi379P8wXkWAWOvtOAHkyvbf9MwZ3AScFytofpWK50mEY DRLUzI81y/r6fO6AbW6FCty7NEY6PgdNoWVzqdC3Qu+aC0MNBI/NuQ3otbAfStcWkA5l zFcN6qxc65FilKTYqQWgPmCT6l2RT1IMw0cW9wnC5A31hXXnl+9CUrx0o2ZM24Og/h7U G3XVwOKond3Yk6tC+vM73yUv993UgnsLAGkB95IwuHr7gh8o3ReSD8OQZGCRprOk0716 F5KnkgOstUqsFEXMEnTmJBpKUsK1tD4QTQMd8Bk+l9jDdKwsm8pyuLPDR6f2UtBTJ4Aq 8tJw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b="kd/Jys8O"; 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 cf22si8265345ejb.290.2019.10.29.04.48.43; Tue, 29 Oct 2019 04:49:07 -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="kd/Jys8O"; 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 S1732776AbfJ2Lrz (ORCPT + 99 others); Tue, 29 Oct 2019 07:47:55 -0400 Received: from mail-wr1-f65.google.com ([209.85.221.65]:42106 "EHLO mail-wr1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725776AbfJ2Lry (ORCPT ); Tue, 29 Oct 2019 07:47:54 -0400 Received: by mail-wr1-f65.google.com with SMTP id a15so1008137wrf.9; Tue, 29 Oct 2019 04:47:52 -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=2/TTI53BPrTu7UjSNB/6Zde/szNTNtQeVJ8mD6hzll4=; b=kd/Jys8OJtaYytj37wMPpfr7AqETl83AzLSViwAqk7yl+1EOQ80amPKIXb++fjZyvf CuGHhyCTniyKWy7h7BcocyCGY6Bq1EE742MOFinQ07GRw4kj3YTNhwLGLKhwkP4MpDiV xP5CNJSlSsN1VEBNwrUPwKlyODAMO2jSlXNupjZJdNRUwCRthmO++sx3jlnkO9i7flJ9 RGLKdcCdsBmGKdNiJBbv59MHPK6cyxHZ5VHa9Qa0hguEM2F4RRPi4tOl7SiBSZu1bnC+ C9oZ0t7QHegmxJG0Qk7DEd3R1Z84Lvhjl57UTm5HrHPtBnmyOkic4T06pVMpmgCxj87Q LY1g== 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=2/TTI53BPrTu7UjSNB/6Zde/szNTNtQeVJ8mD6hzll4=; b=iH0y82e95XckkzXKM8XevzA/SkSUaBohTn81qeISyAd0lV1ap7JZqYoSEzAhLUIthc LFNHmDMl9Is+GP+hhs4oE5glHPjZN5wQFlbEZ3FCvFgKbV1hmHaXVImmZWdUmy4GlfEa 8oeEUzxmZ3TsJLLAL6fDW6haGa4sL0sl8LCnErKpHAQn954tilSYc/qGM/CEz0Bpu0ZK dAh5tw5ynb5aUEgu1jtkcS4XvOlCR7q3nK2Ncvf7urqR8r62zPS0p/piolBag3uRXTKs OIBAfXvSg2WPS8NcapxdLnNJ0sQSfM1CXuSgDEPF0xMJmStuxb596K3UHiD283kTSFhI zp7A== X-Gm-Message-State: APjAAAWmO8Hp34SYWSgSb1a6gZ+NIJ8+oODRScRgTgbuoRt24GUIG20G qRvxaDFp9di9HZJoWnk6Qk4= X-Received: by 2002:a5d:5391:: with SMTP id d17mr2566603wrv.382.1572349672177; Tue, 29 Oct 2019 04:47:52 -0700 (PDT) Received: from ltop.local ([2a02:a03f:40ac:ce00:c1a7:4ac0:2d11:a4f8]) by smtp.gmail.com with ESMTPSA id 74sm17489735wrm.92.2019.10.29.04.47.51 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 29 Oct 2019 04:47:51 -0700 (PDT) Date: Tue, 29 Oct 2019 12:47:50 +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: <20191029114750.a7inago2vd2o4lzl@ltop.local> References: <20191029104917.GI1944@kadam> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191029104917.GI1944@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 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