From patchwork Wed Nov 1 21:05:51 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mauro Carvalho Chehab X-Patchwork-Id: 10037107 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 7A0B6600C5 for ; Wed, 1 Nov 2017 21:06:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74E6B28BDF for ; Wed, 1 Nov 2017 21:06:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6926928BF0; Wed, 1 Nov 2017 21:06:38 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id D757C28BDF for ; Wed, 1 Nov 2017 21:06:37 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=uAY+snCoRz610jizYnYk5u88lnjE3uj0+1sQiOZfYmM=; b=pz5QDVTZdXR7w7nWIf/5IL3t8l TB2qXTfI5awqFbnktIRSLcopUg5K+N63qg3vL5DU6DBaPHOTTYSjTf3f5dO9D5+sPfRbySpA9b7By J+0LFc5dJOy2+kAhITwQDahijVNWwspG7YVsctVaxaCTv2I72bSOfHeODZfDatT1WrlNrhJ4vLPyI 0NcR4FoXXG6Ea2Y5zHOv/4OsdX+XrTJtBIy5LNPRwzbwYlTImNecXmPp2xJVS7rGaCLFj218HCprv m8p5AjwWzptyc4qUhJXpkFOaQQvJfzNQ6HoCVRmpeE8PztOkPxGvZg+01GPuTqHZn6smVXVSty6VV /uvXO5lw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eA0Db-0007Lt-QF; Wed, 01 Nov 2017 21:06:35 +0000 Received: from osg.samsung.com ([64.30.133.232]) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eA0DY-0006n0-A4 for linux-arm-kernel@lists.infradead.org; Wed, 01 Nov 2017 21:06:34 +0000 Received: from localhost (localhost [127.0.0.1]) by osg.samsung.com (Postfix) with ESMTP id A60CC1187F; Wed, 1 Nov 2017 14:06:10 -0700 (PDT) X-Virus-Scanned: Debian amavisd-new at dev.s-opensource.com X-Amavis-Alert: BAD HEADER SECTION, Duplicate header field: "References" Received: from osg.samsung.com ([127.0.0.1]) by localhost (localhost [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 1-cQp4G_rp9j; Wed, 1 Nov 2017 14:06:09 -0700 (PDT) Received: from smtp.s-opensource.com (unknown [179.95.4.10]) by osg.samsung.com (Postfix) with ESMTPSA id D3F721180E; Wed, 1 Nov 2017 14:06:06 -0700 (PDT) Received: from mchehab by smtp.s-opensource.com with local (Exim 4.89) (envelope-from ) id 1eA0D6-0000k8-Jd; Wed, 01 Nov 2017 17:06:04 -0400 From: Mauro Carvalho Chehab To: Subject: [PATCH v2 14/26] media: xilinx: fix a debug printk Date: Wed, 1 Nov 2017 17:05:51 -0400 Message-Id: X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171101_140632_431771_4A37A5EF X-CRM114-Status: GOOD ( 10.85 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, Hyun Kwon , Michal Simek , Mauro Carvalho Chehab , Mauro Carvalho Chehab , Laurent Pinchart , =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Linux Media Mailing List MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP Two orthogonal changesets caused a breakage at several printk messages inside xilinx. Changeset 859969b38e2e ("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API") made davinci to use struct fwnode_handle instead of struct device_node. Changeset 68d9c47b1679 ("media: Convert to using %pOF instead of full_name") changed the printk to not use ->full_name, but, instead, to rely on %pOF. With both patches applied, the Kernel will do the wrong thing, as warned by smatch: drivers/media/platform/xilinx/xilinx-vipp.c:108 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:117 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:126 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:138 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 3 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:148 xvip_graph_build_one() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:245 xvip_graph_build_dma() error: '%pOF' expects argument of type 'struct device_node*', argument 3 has type 'void*' drivers/media/platform/xilinx/xilinx-vipp.c:254 xvip_graph_build_dma() error: '%pOF' expects argument of type 'struct device_node*', argument 4 has type 'void*' So, change the logic to actually print the device name that was obtained before the print logic. Fixes: 68d9c47b1679 ("media: Convert to using %pOF instead of full_name") Fixes: 859969b38e2e ("[media] v4l: Switch from V4L2 OF not V4L2 fwnode API") Signed-off-by: Mauro Carvalho Chehab --- drivers/media/platform/xilinx/xilinx-vipp.c | 31 ++++++++++++++++------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/drivers/media/platform/xilinx/xilinx-vipp.c b/drivers/media/platform/xilinx/xilinx-vipp.c index d881cf09876d..dd777c834c43 100644 --- a/drivers/media/platform/xilinx/xilinx-vipp.c +++ b/drivers/media/platform/xilinx/xilinx-vipp.c @@ -65,6 +65,9 @@ xvip_graph_find_entity(struct xvip_composite_device *xdev, return NULL; } +#define LOCAL_NAME(link) to_of_node(link.local_node)->full_name +#define REMOTE_NAME(link) to_of_node(link.remote_node)->full_name + static int xvip_graph_build_one(struct xvip_composite_device *xdev, struct xvip_graph_entity *entity) { @@ -103,9 +106,9 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, * the link. */ if (link.local_port >= local->num_pads) { - dev_err(xdev->dev, "invalid port number %u for %pOF\n", + dev_err(xdev->dev, "invalid port number %u for %s\n", link.local_port, - to_of_node(link.local_node)); + LOCAL_NAME(link)); v4l2_fwnode_put_link(&link); ret = -EINVAL; break; @@ -114,8 +117,8 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, local_pad = &local->pads[link.local_port]; if (local_pad->flags & MEDIA_PAD_FL_SINK) { - dev_dbg(xdev->dev, "skipping sink port %pOF:%u\n", - to_of_node(link.local_node), + dev_dbg(xdev->dev, "skipping sink port %s:%u\n", + LOCAL_NAME(link), link.local_port); v4l2_fwnode_put_link(&link); continue; @@ -123,8 +126,8 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, /* Skip DMA engines, they will be processed separately. */ if (link.remote_node == of_fwnode_handle(xdev->dev->of_node)) { - dev_dbg(xdev->dev, "skipping DMA port %pOF:%u\n", - to_of_node(link.local_node), + dev_dbg(xdev->dev, "skipping DMA port %s:%u\n", + REMOTE_NAME(link), link.local_port); v4l2_fwnode_put_link(&link); continue; @@ -134,8 +137,8 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, ent = xvip_graph_find_entity(xdev, to_of_node(link.remote_node)); if (ent == NULL) { - dev_err(xdev->dev, "no entity found for %pOF\n", - to_of_node(link.remote_node)); + dev_err(xdev->dev, "no entity found for %s\n", + REMOTE_NAME(link)); v4l2_fwnode_put_link(&link); ret = -ENODEV; break; @@ -144,8 +147,8 @@ static int xvip_graph_build_one(struct xvip_composite_device *xdev, remote = ent->entity; if (link.remote_port >= remote->num_pads) { - dev_err(xdev->dev, "invalid port number %u on %pOF\n", - link.remote_port, to_of_node(link.remote_node)); + dev_err(xdev->dev, "invalid port number %u on %s\n", + link.remote_port, REMOTE_NAME(link)); v4l2_fwnode_put_link(&link); ret = -EINVAL; break; @@ -241,17 +244,17 @@ static int xvip_graph_build_dma(struct xvip_composite_device *xdev) ent = xvip_graph_find_entity(xdev, to_of_node(link.remote_node)); if (ent == NULL) { - dev_err(xdev->dev, "no entity found for %pOF\n", - to_of_node(link.remote_node)); + dev_err(xdev->dev, "no entity found for %s\n", + REMOTE_NAME(link)); v4l2_fwnode_put_link(&link); ret = -ENODEV; break; } if (link.remote_port >= ent->entity->num_pads) { - dev_err(xdev->dev, "invalid port number %u on %pOF\n", + dev_err(xdev->dev, "invalid port number %u on %s\n", link.remote_port, - to_of_node(link.remote_node)); + REMOTE_NAME(link)); v4l2_fwnode_put_link(&link); ret = -EINVAL; break;