From patchwork Wed Mar 18 00:10:08 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kaaira Gupta X-Patchwork-Id: 3151 Return-Path: Received: from mail-pj1-x102e.google.com (mail-pj1-x102e.google.com [IPv6:2607:f8b0:4864:20::102e]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 946D760422 for ; Wed, 18 Mar 2020 01:10:50 +0100 (CET) Received: by mail-pj1-x102e.google.com with SMTP id nu11so461857pjb.1 for ; Tue, 17 Mar 2020 17:10:50 -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=LYLnbya1xX1x1ggDavhU4Gu2iookTyUdcQMMKnU3CvCNF0ymrCzGOfouQLAUgNX85G 32V/Zoa6RhIrwWXx3F39CbQVFkQTni5MRWkvzbArq9wiI2uZG9CTVjjz4A1Y8bQCwPMl tbwcf01W80Sm38a2f8NzGcRE7HRYs7fieKHqYfjx3vN646Q/8uD/mkDglc42GkR/Zrzb pCY97qRpW5Ha9Cbng5U6nwa6qC5oUR2KExRCJIPSgZp5iiBEotoAUTQwOtFWEz5x9hZW +iAqj36PXtiHal4sM1Hy+YEdq/YMZf7H+sIY9P/Wb554DdRP4NDiFpc16N7oBvXGWyau hpeA== 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=lfZx046UbP0gkPOXnjjjJLpr3kTAOE5V0dLFNTpm45OI/cSuOE++GCy0QiUTsuG3J3 Xx/zlefkKeHeIPTOhxP8wfOZ2ubJDabzuRN5MZCTflpoP1fRWajneEEL6zGq9sGUgl2w tbAOqHyenBfWB7qvRM2YmeUznIO8VLOksVLpcNDzurHHVfDYsCCsSe4UE9KKD6XMhML1 jVg0/G6np9P07eojv+mffCavvWeDOTLWsQe7Yw/f3PMxb0cJ+BrQM4PtUN2DSAkeGy7g WUKENOSk6si1J3XhWOWrRk/29tlmRH82xu0f72lrvfRj1vUBoZ4nXLKW/jfNCMmgk9Tq uU2g== X-Gm-Message-State: ANhLgQ2Oy/LIG61s7jHYwT3MIFlbgUP9Y5a6qWINvUgBJyLkxX3HPDWZ 8aBqqDpKFcZGWceOAWLNfmlefQ== X-Google-Smtp-Source: ADFU+vv9rRehpEy71JAeilQhuqyGQUhA5QD7G0Jgo1hQzBO1KEJyYbWrhY0/lQItFH2eJYAKas8/6w== X-Received: by 2002:a17:902:7d8f:: with SMTP id a15mr1188851plm.175.1584490249109; Tue, 17 Mar 2020 17:10:49 -0700 (PDT) Received: from kaaira-HP-Pavilion-Notebook ([103.113.213.153]) by smtp.gmail.com with ESMTPSA id w205sm4318658pfc.75.2020.03.17.17.10.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 17 Mar 2020 17:10:48 -0700 (PDT) From: Kaaira Gupta To: kieran.bingham@ideasonboard.com, libcamera-devel@lists.libcamera.org, Helen Koike , Vaishali Thakkar Cc: Kaaira Gupta Date: Wed, 18 Mar 2020 05:40:08 +0530 Message-Id: <20200318001009.32512-6-kgupta@es.iitr.ac.in> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20200318001009.32512-1-kgupta@es.iitr.ac.in> References: <20200318001009.32512-1-kgupta@es.iitr.ac.in> Subject: [libcamera-devel] [PATCH LIBCAMERA v2 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 00:10:50 -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)