Received: by 2002:ab2:7988:0:b0:1f4:b336:87c4 with SMTP id g8csp93787lqj; Thu, 11 Apr 2024 10:43:45 -0700 (PDT) X-Forwarded-Encrypted: i=3; AJvYcCUqFBCGE0Eqi4ZLS2Hq+0P8/sVnnTN4x4jEhGsOtWfsaIwOmUcB4FvenA5+SqMr3zvTtlNSFcLWaqbgdxssM7E+IL6L8udvwwfVyLeBOg== X-Google-Smtp-Source: AGHT+IHUNvTg5gg9bXA/IyDbsraGEZzguf63gL/xXCMx0utcbVA2yh/p/jJpyUkrpE8mVjBjZPql X-Received: by 2002:a05:6a20:760f:b0:1a7:4f94:659 with SMTP id m15-20020a056a20760f00b001a74f940659mr462988pze.61.1712857425267; Thu, 11 Apr 2024 10:43:45 -0700 (PDT) ARC-Seal: i=2; a=rsa-sha256; t=1712857425; cv=pass; d=google.com; s=arc-20160816; b=Oct56tVEa9b02aIaRvilitRyhrAI0Ldl6MFjxs26xWxpmsuXWYWg0coPTIZoIIb47y WYpazt7QnCvOdAPjm0EGZDAjmwH9NokmNWhoLSlv9zGHY7dAWW5f/QflMuAsNIx1CRV2 GVbXknNhShWIYLNwqsc+WaQPQ0VFf2asx7E9dNAv94ozTDtVrqpcHtJ2PuE7qYr70hhy gQ8sUGbw288PE2mTg3/lQx3KJV4tLOu7FeJGwCR+VZ+cMjry68khFfNERN0hQZr6tZqR ncpVQty8RYkSDK018xQqXimPcfxPE8zXQ+i+mTxuVMZJ7yGWwGwcVNzQuOUniuEEMS7c yTFw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:in-reply-to:message-id :date:subject:cc:to:from:dkim-signature; bh=824kdpvNQEIg3JNyqLD6HhMGF1p3p7yQd55ATdhdNV4=; fh=2FInBIgEh7xt9W7JS1z2wQ7fUhvLHtwfAfkXluU3JoI=; b=yi2T3TYeeYh2eq85SZ/0aUU6Pw3A+3W0pIaWUe0TlgcpEpdU3KZ+UjAYRf2Zd0wUcM GnUIMkEfSPAa9eXSrpXH3KMTqWGUEinq15YiMoMOjXdURgdsN3iHZmG6C5V5j/oMIAWj GOIn9Ye2G6KLvLez2/1bzc7qLi4tAmebmRaj5KrVyMolq3CC8InPM9rjf2/BQVAcjdMD e6bOzzzBNSON1Ao1QHn3bPq06nIPWKQ5bO1uEKwVOYAhU+RHtrBINWaR3NH5OAvgbsLA RzB98okqtBZIhn2EVUtYrfo/WgbggtZ3Ub5vGnGKsa14m1csguWUvFrYNIs7dtb8CAIG 80kg==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=MIzfvxo+; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-141221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141221-linux.lists.archive=gmail.com@vger.kernel.org" Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [147.75.48.161]) by mx.google.com with ESMTPS id k4-20020a63f004000000b005f3cd789fd8si1595037pgh.7.2024.04.11.10.43.44 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 10:43:45 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel+bounces-141221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) client-ip=147.75.48.161; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel-dk.20230601.gappssmtp.com header.s=20230601 header.b=MIzfvxo+; arc=pass (i=1 spf=pass spfdomain=kernel.dk dkim=pass dkdomain=kernel-dk.20230601.gappssmtp.com); spf=pass (google.com: domain of linux-kernel+bounces-141221-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.48.161 as permitted sender) smtp.mailfrom="linux-kernel+bounces-141221-linux.lists.archive=gmail.com@vger.kernel.org" Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by sy.mirrors.kernel.org (Postfix) with ESMTPS id DDAB5B2CB8F for ; Thu, 11 Apr 2024 17:20:05 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 54E9F204A01; Thu, 11 Apr 2024 15:43:50 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b="MIzfvxo+" Received: from mail-io1-f43.google.com (mail-io1-f43.google.com [209.85.166.43]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 3042B2049E6 for ; Thu, 11 Apr 2024 15:43:47 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.166.43 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850229; cv=none; b=WSEf6LSBu8rvlICZXtrBUWE6lwfAu2T+H/nxXlI8Gnhxvg7KoFVnA8oWeJONYXpkZGhprkiCjJyldChubT8zUA/wSrTmwevYTXgdd3Wzm6gEiGkM/7DULiFYtSM17xrSSDTIdCyESfVPNjqlO4Ut87L7YB29Uw8O583Xm2Afz9U= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1712850229; c=relaxed/simple; bh=sv+Gy7cP78hJU/E9MRKEv2Jk7PK6pCxYpgtnsPuhQ9I=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=LqMAiqB/QR/2mNPwBaVvVYlhMBFCKEOsqcODPzePzdkIHGEJF3QoUJNCOp2XeZAdCZzovNjIdleYokczhqiY5vV+NvuoSXFakQwdKn52NZJC8ESaasQBVQG8qK6WW32p/NOMvJy1HlPRYbr9N6hfVaZgTCmpSA+lKTwZ6KyrsMc= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk; spf=pass smtp.mailfrom=kernel.dk; dkim=pass (2048-bit key) header.d=kernel-dk.20230601.gappssmtp.com header.i=@kernel-dk.20230601.gappssmtp.com header.b=MIzfvxo+; arc=none smtp.client-ip=209.85.166.43 Authentication-Results: smtp.subspace.kernel.org; dmarc=none (p=none dis=none) header.from=kernel.dk Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kernel.dk Received: by mail-io1-f43.google.com with SMTP id ca18e2360f4ac-7d6112ba6baso58297839f.1 for ; Thu, 11 Apr 2024 08:43:47 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel-dk.20230601.gappssmtp.com; s=20230601; t=1712850227; x=1713455027; darn=vger.kernel.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=824kdpvNQEIg3JNyqLD6HhMGF1p3p7yQd55ATdhdNV4=; b=MIzfvxo+y6fUVIbKE7P0VtLAg5TOqui2CVzW6n9d1UAJ4p4tm5Jjuo8cbSwYEgenhk AjFvHJ7oEMXzLAGGdnysMyUfqGW12wWdUmTvc4+bXWe/X4O98JZu5fNncCaEXkY3Yk8q 2l/wYYwI49aC38kRUcEXt8tQBxgrnGkTZ9SBdXqq5Hqh2r6u+CR8nV7PZ+PJuCin3ciJ 2L6HHPfY0exDGMC/poQzws4PhJ4rj094oMZwdMatzKoOQSNivgSsakRRb6Ejv2+2tM3h /0IGGVHxSQI0sDGD15gyzW6vV91ycZHhhFcvnuNNZzgQlPSSteI680NxJes00wikgsVY EFog== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1712850227; x=1713455027; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=824kdpvNQEIg3JNyqLD6HhMGF1p3p7yQd55ATdhdNV4=; b=q6NqIjOO5mHHnC2/DhjJI7JXum7m4LC/DOPAD8Oat1cR/BkW+mmtyO5U2uMJZ10n8S vpVrNLOFxH942oh2wulb4f9sK32xlZ0PGbtnNZO5pnruCbldEm/7olrr3W7+Sqr1EGiv ItAZKbpDV1dAG1Mr3Lo3viWY4vfd+u1k6DFYDwff58NmZKsQNj3CeV91peK9UZkg724K tlwcl6Ds5K5BX6r/rIWQQ7NTs5ojczzt8JnRWtJOyvqTH1v0cQn2acULShO6npocR1zm SpBWOasiaBILsNIfX48F3DZ9le+r6OYGqlxAwA2dC/a5GCmsuXA3Nflrb3ueO5M2OebG gmtw== X-Gm-Message-State: AOJu0Yw5QTU8579wbHpBiZ+T0bVycYYchzyNEULt+Uwn6eBFJiVKpQd6 7bxvecdpFp5XNnA1ctFALIKqvCLXNV7gdRUK4ihJPeQjtYK97IU+R5ihUTuatDuuR7djjCGVqpR x X-Received: by 2002:a92:60b:0:b0:369:f53b:6c2 with SMTP id x11-20020a92060b000000b00369f53b06c2mr5354910ilg.1.1712850227027; Thu, 11 Apr 2024 08:43:47 -0700 (PDT) Received: from localhost.localdomain ([96.43.243.2]) by smtp.gmail.com with ESMTPSA id jc25-20020a056638891900b0047f14b7f6c0sm457056jab.5.2024.04.11.08.43.45 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 11 Apr 2024 08:43:45 -0700 (PDT) From: Jens Axboe To: linux-kernel@vger.kernel.org Cc: Jens Axboe Subject: [PATCH 434/437] lib/string_helpers: kill parse_int_array_user() Date: Thu, 11 Apr 2024 09:19:34 -0600 Message-ID: <20240411153126.16201-435-axboe@kernel.dk> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20240411153126.16201-1-axboe@kernel.dk> References: <20240411153126.16201-1-axboe@kernel.dk> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit It's no longer used, get rid of it. Signed-off-by: Jens Axboe --- include/linux/string_helpers.h | 1 - lib/string_helpers.c | 61 ++++++++++------------------------ 2 files changed, 18 insertions(+), 44 deletions(-) diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.h index f38157114fc0..5e913f1fad60 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -32,7 +32,6 @@ enum string_size_units { int string_get_size(u64 size, u64 blk_size, const enum string_size_units units, char *buf, int len); -int parse_int_array_user(const char __user *from, size_t count, int **array); int parse_int_array_iter(struct iov_iter *from, int **array); #define UNESCAPE_SPACE BIT(0) diff --git a/lib/string_helpers.c b/lib/string_helpers.c index ced4f77dc5e8..8582f9adfa76 100644 --- a/lib/string_helpers.c +++ b/lib/string_helpers.c @@ -138,10 +138,27 @@ int string_get_size(u64 size, u64 blk_size, const enum string_size_units units, } EXPORT_SYMBOL(string_get_size); -static int __parse_int_array(char *buf, int **array) +/** + * parse_int_array_iter - Split string into a sequence of integers + * @from: The iov_iter buffer to read from + * @array: Returned pointer to sequence of integers + * + * On success @array is allocated and initialized with a sequence of + * integers extracted from the @from plus an additional element that + * begins the sequence and specifies the integers count. + * + * Caller takes responsibility for freeing @array when it is no longer + * needed. + */ +int parse_int_array_iter(struct iov_iter *from, int **array) { int *ints, nints; int ret = 0; + char *buf; + + buf = iterdup_nul(from, iov_iter_count(from)); + if (IS_ERR(buf)) + return PTR_ERR(buf); get_options(buf, 0, &nints); if (!nints) { @@ -161,49 +178,7 @@ static int __parse_int_array(char *buf, int **array) free_buf: kfree(buf); return ret; -} - -/** - * parse_int_array_user - Split string into a sequence of integers - * @from: The user space buffer to read from - * @count: The maximum number of bytes to read - * @array: Returned pointer to sequence of integers - * - * On success @array is allocated and initialized with a sequence of - * integers extracted from the @from plus an additional element that - * begins the sequence and specifies the integers count. - * - * Caller takes responsibility for freeing @array when it is no longer - * needed. - */ -int parse_int_array_user(const char __user *from, size_t count, int **array) -{ - char *buf; - - buf = memdup_user_nul(from, count); - if (IS_ERR(buf)) - return PTR_ERR(buf); - - return __parse_int_array(buf, array); -} -EXPORT_SYMBOL(parse_int_array_user); - -/** - * parse_int_array_iter - Split string into a sequence of integers - * @from: The iov_iter buffer to read from - * @array: Returned pointer to sequence of integers - * - * See @parse_int_array_user, this is just the iov_iter variant. - */ -int parse_int_array_iter(struct iov_iter *from, int **array) -{ - char *buf; - - buf = iterdup_nul(from, iov_iter_count(from)); - if (IS_ERR(buf)) - return PTR_ERR(buf); - return __parse_int_array(buf, array); } EXPORT_SYMBOL(parse_int_array_iter); -- 2.43.0