Received: by 2002:ac0:bc90:0:0:0:0:0 with SMTP id a16csp1324387img; Fri, 22 Mar 2019 23:16:31 -0700 (PDT) X-Google-Smtp-Source: APXvYqz5rZNuYVdqATFMDVewO1pDeRHQGA/bYIp41IC12Q5UORrVOTNTOq1btYp1nej+VxXh1kYR X-Received: by 2002:a63:7153:: with SMTP id b19mr6396536pgn.289.1553321791235; Fri, 22 Mar 2019 23:16:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1553321791; cv=none; d=google.com; s=arc-20160816; b=kPNEdRpfV/dC/k2z3uPm+1vkCiFZ/PvVzvmyGucrTOiQfW0B1f4Kr4RmJRWiycie0a gL3mwmbVQOxCjnelgATJqydxEgyu6QoJBkk0SNuFVqVCAt7Lc7tAIkqceGOgwye8Fu8l Fmx1CE8kM+BnP6x4/6eTYEyCBRWmmKoNcG3xiAbqvc7/iT8lW85YHUAmyOMrqDSbMIr9 kcla8WSaxKgOQkBIaKt1vWqZLWnOFIz4eGZ5D1mhCtKTwNoVCmHDH2DO+OhiGglhDy0t H4gLqgjUmocdP/m6U56bvUhr095Sh8tQXm5aP3M2BAUQ+qJTAPzs7jzFDWi8yk573KBC fRwA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from; bh=rhqV9YI181i2oezZAbFWeSm7voe9Nz6uYjxH2ENP8hY=; b=A1rwPZw+J+H03lhvBUiocJavPC3GOsQtHXTRleoOK3cVVR/4vuGzp1xIyTvcwyVrX7 QOxe7AUE+1ksWga6xmDlinBkoXp/nwDIWSxAcs1GT0/1qSQIBNvPT4/VxsRmdh03mpS6 gp95r+4Si6DBMS3QrZE/V+lx+DhYfd2WrZYtJ9t8ef8XRXt8119bhN83TAH9VAK7cRCx ewpfRUTcrimfe4EHhJCYa2FAr3lYOmdffTE+1At7WLSz2nD/Sr3jrxgOCKZgcVbzRfgu Z7AGprfNJOYQasPcIMBDvb4c5yQJ99cYJLr75hJi5iyU1DXLpQ785uPq6xIp+rUhAU1F 3TiA== 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 20si8450639pgr.200.2019.03.22.23.16.15; Fri, 22 Mar 2019 23:16:31 -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; 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 S1726085AbfCWGPl (ORCPT + 99 others); Sat, 23 Mar 2019 02:15:41 -0400 Received: from mxhk.zte.com.cn ([63.217.80.70]:49006 "EHLO mxhk.zte.com.cn" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726029AbfCWGPk (ORCPT ); Sat, 23 Mar 2019 02:15:40 -0400 Received: from mse01.zte.com.cn (unknown [10.30.3.20]) by Forcepoint Email with ESMTPS id 133E8B483DC486D6D641; Sat, 23 Mar 2019 14:15:38 +0800 (CST) Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id x2N6FOOh076138; Sat, 23 Mar 2019 14:15:24 +0800 (GMT-8) (envelope-from wen.yang99@zte.com.cn) Received: from fox-host8.localdomain ([10.74.120.8]) by szsmtp06.zte.com.cn (Lotus Domino Release 8.5.3FP6) with ESMTP id 2019032314161028-6075699 ; Sat, 23 Mar 2019 14:16:10 +0800 From: Wen Yang To: yamada.masahiro@socionext.com Cc: linux-kernel@vger.kernel.org, wang.yi59@zte.com.cn, Wen Yang , Julia Lawall , Gilles Muller , Nicolas Palix , Michal Marek , cocci@systeme.lip6.fr Subject: [PATCH] coccinelle: put_device: reduce false positives Date: Sat, 23 Mar 2019 14:14:31 +0800 Message-Id: <1553321671-27749-1-git-send-email-wen.yang99@zte.com.cn> X-Mailer: git-send-email 1.8.3.1 X-MIMETrack: Itemize by SMTP Server on SZSMTP06/server/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2019-03-23 14:16:10, Serialize by Router on notes_smtp/zte_ltd(Release 9.0.1FP7|August 17, 2016) at 2019-03-23 14:15:05, Serialize complete at 2019-03-23 14:15:05 X-MAIL: mse01.zte.com.cn x2N6FOOh076138 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Don't complain about a return when this function returns "&pdev->dev". Reported-by: Julia Lawall Signed-off-by: Wen Yang Cc: Julia Lawall Cc: Gilles Muller Cc: Nicolas Palix Cc: Michal Marek Cc: Masahiro Yamada CC: cocci@systeme.lip6.fr Cc: linux-kernel@vger.kernel.org --- scripts/coccinelle/free/put_device.cocci | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/coccinelle/free/put_device.cocci b/scripts/coccinelle/free/put_device.cocci index 7395697..c9f071b 100644 --- a/scripts/coccinelle/free/put_device.cocci +++ b/scripts/coccinelle/free/put_device.cocci @@ -32,6 +32,7 @@ if (id == NULL || ...) { ... return ...; } ( id | (T2)dev_get_drvdata(&id->dev) | (T3)platform_get_drvdata(id) +| &id->dev ); | return@p2 ...; ) -- 2.9.5