From patchwork Thu Jan 25 00:34:30 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Niklas_S=C3=B6derlund?= X-Patchwork-Id: 10183445 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 1E64C60383 for ; Thu, 25 Jan 2018 00:41:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 14E19289BA for ; Thu, 25 Jan 2018 00:41:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 094F7289BE; Thu, 25 Jan 2018 00:41:29 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 05AD4289BA for ; Thu, 25 Jan 2018 00:41:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932615AbeAYAlZ (ORCPT ); Wed, 24 Jan 2018 19:41:25 -0500 Received: from vsp-unauthed02.binero.net ([195.74.38.227]:33821 "EHLO bin-vsp-out-03.atm.binero.net" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932302AbeAYAlY (ORCPT ); Wed, 24 Jan 2018 19:41:24 -0500 X-Halon-ID: 8e5292b7-0167-11e8-9560-0050569116f7 Authorized-sender: niklas@soderlund.pp.se Received: from bismarck.berto.se (unknown [89.233.230.99]) by bin-vsp-out-03.atm.binero.net (Halon) with ESMTPA id 8e5292b7-0167-11e8-9560-0050569116f7; Thu, 25 Jan 2018 01:35:13 +0100 (CET) From: =?UTF-8?q?Niklas=20S=C3=B6derlund?= To: Mauro Carvalho Chehab , linux-media@vger.kernel.org Cc: linux-renesas-soc@vger.kernel.org, =?UTF-8?q?Niklas=20S=C3=B6derlund?= Subject: [PATCH] v4l2-dev.h: fix symbol collision in media_entity_to_video_device() Date: Thu, 25 Jan 2018 01:34:30 +0100 Message-Id: <20180125003430.18558-1-niklas.soderlund+renesas@ragnatech.se> X-Mailer: git-send-email 2.15.1 MIME-Version: 1.0 Sender: linux-media-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-media@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP A recent change to the media_entity_to_video_device() macro breaks some use-cases for the macro due to a symbol collision. Before the change this worked: vdev = media_entity_to_video_device(link->sink->entity); While after the change it results in a compiler error "error: 'struct video_device' has no member named 'link'; did you mean 'lock'?". While the following still works after the change. struct media_entity *entity = link->sink->entity; vdev = media_entity_to_video_device(entity); Fix the collision by renaming the macro argument to 'media_entity'. Signed-off-by: Niklas Söderlund Acked-by: Sakari Ailus --- include/media/v4l2-dev.h | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) Hi Mauro, As the offending commit is not yet upstream and I'm not sure if the commit ids in the media-tree are stable. If they are please attach the following fixes tag. Fixes: 69b925c5fc36d8f1 ("media: v4l2-dev.h: add kernel-doc to two macros") Regards, // Niklas diff --git a/include/media/v4l2-dev.h b/include/media/v4l2-dev.h index 267fd2bed17bd3c1..f0fc1ebda47244b3 100644 --- a/include/media/v4l2-dev.h +++ b/include/media/v4l2-dev.h @@ -298,10 +298,10 @@ struct video_device * media_entity_to_video_device - Returns a &struct video_device from * the &struct media_entity embedded on it. * - * @entity: pointer to &struct media_entity + * @media_entity: pointer to &struct media_entity */ -#define media_entity_to_video_device(entity) \ - container_of(entity, struct video_device, entity) +#define media_entity_to_video_device(media_entity) \ + container_of(media_entity, struct video_device, entity) /** * to_video_device - Returns a &struct video_device from the