From patchwork Wed Mar 18 11:58:45 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3167 Return-Path: Received: from mail-pl1-x62f.google.com (mail-pl1-x62f.google.com [IPv6:2607:f8b0:4864:20::62f]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 9F70F60418 for ; Wed, 18 Mar 2020 12:59:34 +0100 (CET) Received: by mail-pl1-x62f.google.com with SMTP id h11so11089025plk.7 for ; Wed, 18 Mar 2020 04:59:34 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=es-iitr-ac-in.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=9ua74D+pawbGOHEp2jkPTCrGO8MCR0QT8xKXKQ8HvG0=; b=SUp8S9ZOG/9Yq5OGbQIKPS2i3I38RV4wnQeqtwUyoNGhuvxiyaCFyJT6k2YofeI20T piWUVI32G49w20k8ukdzCqQAUSoJ1lgra6ceLxs2yjuLbA+aq+ql8mJFtCt+iBP1eP7s o2ECOfCcnCEzCbZju9WcqdkwWCC3mSwxs+bHTXSQbHYI51dklhIwOpn7M57xS4ghCecr QyoLggcRP1MDEdFtAsMAyp4Tpf96hB6Z6bqK8emLkQpVEssIzugIFV2k5CwYI0jLvN7c 53wp/uuqK2/u5oWTHD0PdAiDlBtl4NeThZ2OLH+QJDPIMaaqUgSauGV8xwmwQWsJSSyt jUhg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=9ua74D+pawbGOHEp2jkPTCrGO8MCR0QT8xKXKQ8HvG0=; b=kgIliijTd2KVuTPpMaKLeFAlhsn217+MpBFZ9/MTVDBT1LfrKnCFdt7lwdk2243Q1q xD+UEO46N89HXYUxTKIBm/hx8zwA6Eu1WmaOm9LbZjYLrp7Gs4YldaAOiAFY9wD8oInQ RHois0fuLzEpEv8NuO31q4+xHTkWnKz2C/6+Ihsdbup8jc05NxhacGMSsXCQWRc8efba LuW5UqLXowQhpue+21ot9b6NfnFZMsGGU6IwoSGhEzKfo4VPGr43TOmWiqabSXrLjjPZ g2q2SZL9CrPPTt/tij6yRc3zdb9Orqjzto9GHqnkCLFceu85QQT9YuUWJUH8FekYrdz6 p89g== X-Gm-Message-State: ANhLgQ0sKSa3nI3xghhcPK3AZzWCivrU8mRl7QUSd5wFkH/1nRNS8tK9 xODkzs2j13auJ8Q1/5wa68VmVA== X-Google-Smtp-Source: ADFU+vsZqqhy6NBdWaVB/hHnvbRBVURdD7miE7eUgwek5N6FmXWnPP4jrEV3hYopqyK3AJX7VhYJYQ== X-Received: by 2002:a17:90a:3328:: with SMTP id m37mr4296506pjb.158.1584532773127; Wed, 18 Mar 2020 04:59:33 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id y131sm6613014pfg.25.2020.03.18.04.59.32 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 18 Mar 2020 04:59:32 -0700 (PDT) From: Kaaira Gupta To: Helen Koike , Vaishali Thakkar , kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org Cc: Kaaira Gupta Date: Wed, 18 Mar 2020 17:28:45 +0530 Message-Id: <20200318115846.7975-6-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318115846.7975-1-kgupta@es.iitr.ac.in> References: <20200318115846.7975-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA v3 5/6] libcamera: ipa_manager: replace by utils functions X-BeenThere: libcamera-devel@lists.libcamera.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 18 Mar 2020 11:59:34 -0000 Now that functions isLibcameraInstalled() and libcameraPath() are defined in utils, they don't need to be defined here again. Hence remove them and replace them with utils' functions. Signed-off-by: Kaaira Gupta --- src/libcamera/ipa_manager.cpp | 36 ++--------------------------------- 1 file changed, 2 insertions(+), 34 deletions(-) diff --git a/src/libcamera/ipa_manager.cpp b/src/libcamera/ipa_manager.cpp index 238433d..0bd280c 100644 --- a/src/libcamera/ipa_manager.cpp +++ b/src/libcamera/ipa_manager.cpp @@ -9,9 +9,6 @@ #include #include -#include -#include -#include #include #include @@ -27,35 +24,6 @@ * \brief Image Processing Algorithm module manager */ -static bool isLibcameraInstalled() -{ - /* musl doesn't declare _DYNAMIC in link.h, declare it manually. */ - extern ElfW(Dyn) _DYNAMIC[]; - - /* - * DT_RUNPATH (DT_RPATH when the linker uses old dtags) is removed on - * install. - */ - for (const ElfW(Dyn) *dyn = _DYNAMIC; dyn->d_tag != DT_NULL; ++dyn) { - if (dyn->d_tag == DT_RUNPATH || dyn->d_tag == DT_RPATH) - return false; - } - - return true; -} - -static std::string libcameraPath() -{ - Dl_info info; - - /* Look up our own symbol. */ - int ret = dladdr(reinterpret_cast(libcameraPath), &info); - if (ret == 0) - return nullptr; - - return info.dli_fname; -} - namespace libcamera { LOG_DEFINE_CATEGORY(IPAManager) @@ -151,8 +119,8 @@ IPAManager::IPAManager() * path for the IPA from that point. We need to recurse one level of * sub-directories to match the build tree. */ - if (!isLibcameraInstalled()) { - std::string ipaBuildPath = utils::dirname(libcameraPath()) + "/../ipa"; + if (!utils::isLibcameraInstalled()) { + std::string ipaBuildPath = utils::dirname(utils::libcameraPath()) + "/../ipa"; constexpr int maxDepth = 1; LOG(IPAManager, Info)