Received: by 2002:ac0:946b:0:0:0:0:0 with SMTP id j40csp1055136imj; Thu, 14 Feb 2019 00:04:39 -0800 (PST) X-Google-Smtp-Source: AHgI3Ia5gXVVFNt8CaKON64fMxatUqkRerF37Syd2m8XlUrDDCyQamy+yC39fNgF1d0nbSLZNVIc X-Received: by 2002:a63:9712:: with SMTP id n18mr2482596pge.295.1550131479663; Thu, 14 Feb 2019 00:04:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1550131479; cv=none; d=google.com; s=arc-20160816; b=rW8y+CY7iX5stx5oS5SFzX8k9Y4uo1612oXnBdsksf91D2hrAb3qzlebHMfM9I0W9U BLjIfFwxQiQkNngCsi1copuyBrjZWZoFIScz1uRAevyJB39/QNc4tYxyXLUJeOf/VwNR YphE3xKrY42Xyx/yUEJVsGwf8FmdlwKKOwT8+2SUeKwKwJacmVLvS3ad2am3LQ5EfHJc mreJBU2eTs8XsV5TPGkdhlb5LtO9iycl4JCbSlOhqs57UAzIRFKebLed1rsWIn6UDS6X GKt0SeBC77I2v3f5ZJtrpr14LM+AyQ30YB5nikERmFu3umooQ9ANGH/YSZS6M0fmdfuJ Mq2w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:references :message-id:in-reply-to:subject:cc:to:from:date; bh=PMBN1W7du0VEn0qmuPhsRZOLrA0Dw3yG26ndkjkN+ew=; b=pzJ//HgzLmJi1TwKQ13HmR8bbY7Dk8B2ya3SqfRf/7ocS4zuonSbMJc6U2MZ9JafNN ltjJgh5Gj/aIW5gi8N98/G98i1X9/2Xq/7S3jFHEHbTSXjWNLYiPIS04dE/WQMSi+AN6 6s1cdXh4u5O6iZiGx/SXs05S4EPtYjH+Cyzez3L9jCMCW2yGKeGtsAnTv9/K2JACF+1c 1zmW6ZA2jTG0y39jglwAEIr62JYME3DuFMOosEXmiwCCVjTRrECkmzrKyidoHnJ548yz tt62CJecgCHk0OsxRVIAEv6IvAeybdgLe4uKiRs1jsgGKZJ6+4Itv0Ng36anU69Rh/P0 exYw== ARC-Authentication-Results: i=1; mx.google.com; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m15si1714763pgb.425.2019.02.14.00.04.22; Thu, 14 Feb 2019 00:04:39 -0800 (PST) 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; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2394398AbfBMTwX (ORCPT + 99 others); Wed, 13 Feb 2019 14:52:23 -0500 Received: from mail2-relais-roc.national.inria.fr ([192.134.164.83]:14249 "EHLO mail2-relais-roc.national.inria.fr" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726362AbfBMTwX (ORCPT ); Wed, 13 Feb 2019 14:52:23 -0500 X-IronPort-AV: E=Sophos;i="5.58,366,1544482800"; d="scan'208";a="369313067" Received: from abo-58-107-68.mrs.modulonet.fr (HELO hadrien) ([85.68.107.58]) by mail2-relais-roc.national.inria.fr with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2019 20:52:21 +0100 Date: Wed, 13 Feb 2019 20:52:21 +0100 (CET) From: Julia Lawall X-X-Sender: jll@hadrien To: Markus Elfring cc: Wen Yang , Gilles Muller , Masahiro Yamada , Michal Marek , Nicolas Palix , Wen Yang , Xue Zhihong , Yi Wang , linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Coccinelle Subject: Re: [PATCH v3] Coccinelle: semantic patch for missing put_device() In-Reply-To: Message-ID: References: <1550039015-5587-1-git-send-email-wen.yang99@zte.com.cn> User-Agent: Alpine 2.21 (DEB 202 2017-01-01) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 13 Feb 2019, Markus Elfring wrote: > > The of_find_device_by_node() takes a reference to the underlying device > > structure, we should release that reference. > > I have got another concern for further software development considerations. > > How do you think about to describe here if it can be determined > by source code analysis that the desired release should be performed > only in the same function implementation (or not)? > > How much does this aspect influence the source code search confidence? > > > > + when != e1 = (T)id > > + when != e2 = &id->dev > > + when != e3 = get_device(&id->dev) > > + when != e4 = (T1)platform_get_drvdata(id) > > I have got another idea for a bit of software fine-tuning at such a place. > I am unsure if it can become relevant to reduce the number of metavariables > here by introducing a SmPL disjunction. > > + when != ex = \( (T)id \| &id->dev \| get_device(&id->dev) \| (T1)platform_get_drvdata(id) \) There is no need for the disjunction. There is also no need for the different variables. Different variables are only needed when the when conditions are on different ...s julia > > > Regards, > Markus >