From patchwork Sun Mar 24 18:33:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Khem Raj X-Patchwork-Id: 19799 Return-Path: X-Original-To: parsemail@patchwork.libcamera.org Delivered-To: parsemail@patchwork.libcamera.org Received: from lancelot.ideasonboard.com (lancelot.ideasonboard.com [92.243.16.209]) by patchwork.libcamera.org (Postfix) with ESMTPS id D387FBD160 for ; Sun, 24 Mar 2024 18:33:18 +0000 (UTC) Received: from lancelot.ideasonboard.com (localhost [IPv6:::1]) by lancelot.ideasonboard.com (Postfix) with ESMTP id 6E8F06308D; Sun, 24 Mar 2024 19:33:17 +0100 (CET) Authentication-Results: lancelot.ideasonboard.com; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="M5PtbkKM"; dkim-atps=neutral Received: from mail-pl1-x630.google.com (mail-pl1-x630.google.com [IPv6:2607:f8b0:4864:20::630]) by lancelot.ideasonboard.com (Postfix) with ESMTPS id 2304C61C3C for ; Sun, 24 Mar 2024 19:33:13 +0100 (CET) Received: by mail-pl1-x630.google.com with SMTP id d9443c01a7336-1dee5ef2a7bso26146285ad.1 for ; Sun, 24 Mar 2024 11:33:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1711305191; x=1711909991; darn=lists.libcamera.org; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:from:to:cc:subject:date:message-id:reply-to; bh=LMNY02B6zIhcvIGKHG7na34DctvN1cJEm8YrA8ae/0Q=; b=M5PtbkKMnxxK6uoahGhBApyO9LYRQPpbAUnfUnrROVStV0eSJknnlM/CdYYCdROpVk Iocal5n9esPCgfk6jamb72cSodqT3LVDsTcD/2OxDC/tIhDILH4khEMLx0wSML55ELc6 8AWIWGZmVJz06Bv7Nur2wRvFjbgMkUzaYdLv83PBiEQVJH9x0C6d2lbC6MaUU5uUmsE3 /REAqIwveVV7NaulHP6S66YmfilbNlEJqrovYScdyRXkDFOlzNzENFyV2zfBS2EchNS+ 69h4sSHOnK1qgkeNFnLcGCOCeKm3d/BPw8E4Dhu9pPc+GSkm7oMkW1csz6Mas7v0AqUR 1F/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1711305191; x=1711909991; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to; bh=LMNY02B6zIhcvIGKHG7na34DctvN1cJEm8YrA8ae/0Q=; b=uZvemSVQZkKxOJuf3DEYVG+2CtIyd3sjuiMJZir9SPlqn4zOySDeWx985Bi0tSF6un rgKe9TrncBFUmQayynzvttfgJQwobKUG616fD6hCMth972C3YVQLL3P8W5DPesOcDoB1 Sf/65t5HYkTGxaZeJDxJ53dz7b2UxYkr0frOAp0X86sHGhG02WZ+DCF0ykDVeLjDAuh5 sKYreG7YE+sK2vWCehnPlTqb0Ygz1ovEgJiYXXV4t2Wwn6DiVzsbqows717Kk2bPbLuD 6CtlnWILoX4DiraHs3odRH28eY2JIenBoF/wT3sgcoz+RwAtRc70koM9dlOhWQnzNvFy VSfA== X-Gm-Message-State: AOJu0YxiP+V1xlIfvEgMce9nx5NTGol0XFvEzh8Dc6V/Kd78+4eTSb06 punxBdSeM3GzVDNRPKSHROn09ziC61S7dlYMka0oYJO4iOpztAf1LG/SCR4G X-Google-Smtp-Source: AGHT+IHDjXCJ9dO6hipy9FRZ1e3IqVkS+g023c53CszXMDp3seUOqy7jETtDZq8Nn1NewVclgGkqTA== X-Received: by 2002:a17:903:2448:b0:1dd:a33f:5913 with SMTP id l8-20020a170903244800b001dda33f5913mr7126957pls.30.1711305190604; Sun, 24 Mar 2024 11:33:10 -0700 (PDT) Received: from apollo.hsd1.ca.comcast.net ([2601:646:9d80:4380::779c]) by smtp.gmail.com with ESMTPSA id w1-20020a170902e88100b001db8f7720e2sm2754315plg.288.2024.03.24.11.33.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 24 Mar 2024 11:33:10 -0700 (PDT) From: Khem Raj To: libcamera-devel@lists.libcamera.org Cc: laurent.pinchart@ideasonboard.com, kieran.bingham@ideasonboard.com, Khem Raj Subject: [PATCH] ipu3: Use posix basename Date: Sun, 24 Mar 2024 11:33:07 -0700 Message-ID: <20240324183307.3833076-1-raj.khem@gmail.com> X-Mailer: git-send-email 2.44.0 MIME-Version: 1.0 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: , Errors-To: libcamera-devel-bounces@lists.libcamera.org Sender: "libcamera-devel" musl does not implement GNU basename extention and with latest musl the prototype from string.h is also removed [1] which now results in compile errors e.g. ../git/utils/ipu3/ipu3-pack.c:21:47: error: call to undeclared function 'basename'; ISO C99 and later do not support implicit function declarations [-Wimplicit-function-declaration] These utilities are using this function in usage() which is used just before program exit. Always use the basename APIs from libgen.h which is posix implementation [1] https://git.musl-libc.org/cgit/musl/commit/?id=725e17ed6dff4d0cd22487bb64470881e86a92e7 Signed-off-by: Khem Raj Reviewed-by: Kieran Bingham --- utils/ipu3/ipu3-pack.c | 4 ++-- utils/ipu3/ipu3-unpack.c | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/utils/ipu3/ipu3-pack.c b/utils/ipu3/ipu3-pack.c index decbfc6c..23d2db8b 100644 --- a/utils/ipu3/ipu3-pack.c +++ b/utils/ipu3/ipu3-pack.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,9 +16,8 @@ #include #include -static void usage(const char *argv0) +static void usage(char *argv0) { - printf("Usage: %s input-file output-file\n", basename(argv0)); printf("Convert unpacked RAW10 Bayer data to the IPU3 packed Bayer formats\n"); printf("If the output-file '-', output data will be written to standard output\n"); diff --git a/utils/ipu3/ipu3-unpack.c b/utils/ipu3/ipu3-unpack.c index 9d2c1200..1505a970 100644 --- a/utils/ipu3/ipu3-unpack.c +++ b/utils/ipu3/ipu3-unpack.c @@ -8,6 +8,7 @@ #include #include +#include #include #include #include @@ -15,7 +16,7 @@ #include #include -static void usage(const char *argv0) +static void usage(char *argv0) { printf("Usage: %s input-file output-file\n", basename(argv0)); printf("Unpack the IPU3 raw Bayer format to 16-bit Bayer\n");