From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2B3EAC54EE9 for ; Fri, 2 Sep 2022 09:05:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235731AbiIBJFL (ORCPT ); Fri, 2 Sep 2022 05:05:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44010 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236088AbiIBJE5 (ORCPT ); Fri, 2 Sep 2022 05:04:57 -0400 Received: from mail-qt1-x836.google.com (mail-qt1-x836.google.com [IPv6:2607:f8b0:4864:20::836]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3F91C1057F for ; Fri, 2 Sep 2022 02:04:56 -0700 (PDT) Received: by mail-qt1-x836.google.com with SMTP id x5so970602qtv.9 for ; Fri, 02 Sep 2022 02:04:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=A0lRx9LcG2f6vdkkySTxdBxFyRczSLUlrhv0k8CVfMQ=; b=PqG6a4MKk2roT2Ce/PJEt8kCVddWYbqLQh141ATH+SE8SYCKK/ZFS9/OCHdfbfSgP8 mQREKuMuSelAb6SBLEEu74TKUjSBBmwZ8WjygarTrIA/KvHYGyMp8a2J70T92Jg3Pcrb kcjEtRkQqjOXCQllUJDzs4CbTXcsIuMEFmKFSormg00PlTnX1F1InK7vkFbhfO4twbjw wX8s3+vO/eXcBlAlq1ZPFwMRXYokbFEoLvKUt2HuPvjJ+iL9BHtDGUWj4Z7VTMBrr1UC L7HTZSBcu84jPm1mYMiEOrw0O3Q0JaNpk4QrVKItYAbCjz/FlYGhDCg+mGNEqLY5iH3A 0oww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=A0lRx9LcG2f6vdkkySTxdBxFyRczSLUlrhv0k8CVfMQ=; b=OddTsxKWlZVwlZaO+UZXNq+LjKgLLjZ3zuicp5+w+OoOS2izx1kwHTgPTBj0UWRm8G tfmVxgoWAOaV7mK5FQGLCoqemHkYfRzYMfdmifrin+ZchRwtAwrRSsr0iGndI2tTUVRn jOHmqAbccRbHCBJNNEab21PnDB3YYi5T/UzxwFF86g4UBE78fT1bLgUE1LQcp08Fsn/c Fnb+r4T1XhOdLegskFhWmvBMzd8eTkvHa9Pg4z+rKzC7xemI0yYEMNcwdSHJ+CsC5Fol ySOieGgd74HA0nBZLlEKp8v7nI4uAIpx07hnsrFVBiTd6czJNAhhwJfGVlHFguTmgZLt 08gg== X-Gm-Message-State: ACgBeo1FRElTGUwwAKhDbdmi8VEr+asNP0A9KTTybwEhcoTAepfbru/v GPhcHlnQNkvdddayCyPatMIAQOTqMRqHANL1iks= X-Google-Smtp-Source: AA6agR7C4/X8eo8OV4IEGqRGWP09L1le/kpVLIzKikXVS/h8SIICiTqB0VGNInh/3lWYFp6j5asmpgMaMlwtPWel10o= X-Received: by 2002:ac8:7dd0:0:b0:344:afc1:b11d with SMTP id c16-20020ac87dd0000000b00344afc1b11dmr26659521qte.195.1662109495202; Fri, 02 Sep 2022 02:04:55 -0700 (PDT) MIME-Version: 1.0 References: <20220901175022.334824-1-cezary.rojewski@intel.com> <20220901175022.334824-2-cezary.rojewski@intel.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 2 Sep 2022 12:04:19 +0300 Message-ID: Subject: Re: [PATCH v3 1/2] lib/string_helpers: Introduce tokenize_user_input() To: Cezary Rojewski Cc: ALSA Development Mailing List , Mark Brown , Takashi Iwai , Jaroslav Kysela , amadeuszx.slawinski@linux.intel.com, Pierre-Louis Bossart , Hans de Goede , Liam Girdwood , Kai Vehmanen , =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= , Ranjani Sridharan , Bard Liao , Andy Shevchenko , Linux Kernel Mailing List , Matthew Wilcox Content-Type: text/plain; charset="UTF-8" Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Sep 2, 2022 at 10:46 AM Cezary Rojewski wrote: > On 2022-09-01 9:34 PM, Andy Shevchenko wrote: > > On Thu, Sep 1, 2022 at 8:40 PM Cezary Rojewski > > wrote: ... > >> +int tokenize_user_input(const char __user *from, size_t count, int **tkns); > > > > Not sure how I can deduct from the name what function is actually > > doing. Suggested new name: int_array_parse_user(). > > > > int int_array_parse_user(const char __user *from, size_t count, int **array); > > > > (Note that we have _user suffix for many APIs in the kernel that does > > interact with user space memory) > > That's why I've added '_user_' in the middle! Anyway, I guess the > expectation is that it's a suffix - precisely at the end of the name. > > Could we reorder it a bit: "parse_int_array_user"? Most of the exported functions that have 'parse' word, have it after namespace, but in this case there is no dedicated namespace and it also will be in alignment with parse_options_str. That said, go for it. -- With Best Regards, Andy Shevchenko From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from alsa0.perex.cz (alsa0.perex.cz [77.48.224.243]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CD5CFC54EE9 for ; Fri, 2 Sep 2022 09:05:58 +0000 (UTC) Received: from alsa1.perex.cz (alsa1.perex.cz [207.180.221.201]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by alsa0.perex.cz (Postfix) with ESMTPS id 2FEC41632; Fri, 2 Sep 2022 11:05:06 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa0.perex.cz 2FEC41632 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=alsa-project.org; s=default; t=1662109556; bh=DByZzEa0/SSV2mogx+3VMuO9XtQSfHUPqskbOIRJ/hI=; h=References:In-Reply-To:From:Date:Subject:To:Cc:List-Id: List-Unsubscribe:List-Archive:List-Post:List-Help:List-Subscribe: From; b=TQ9LQ4Cso+LLR1U8kq72MK3F5qbgC2gEk3jVcCei22E6yTUsSmRjs6T3v8v4yrTBT NBI+1IdW0a3Gx7P8WL3bUZOiLK59pGRQfj8P2d0TKscXwkHVlEnG77wbElGJdIuAkf YNFowos33gUeu6jA3QqTWQy/EX45QM6Rv0DTV4Q0= Received: from alsa1.perex.cz (localhost.localdomain [127.0.0.1]) by alsa1.perex.cz (Postfix) with ESMTP id 8884AF8020D; Fri, 2 Sep 2022 11:05:05 +0200 (CEST) Received: by alsa1.perex.cz (Postfix, from userid 50401) id 65798F8027B; Fri, 2 Sep 2022 11:05:04 +0200 (CEST) Received: from mail-qt1-x82b.google.com (mail-qt1-x82b.google.com [IPv6:2607:f8b0:4864:20::82b]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by alsa1.perex.cz (Postfix) with ESMTPS id 82D7AF80125 for ; Fri, 2 Sep 2022 11:04:57 +0200 (CEST) DKIM-Filter: OpenDKIM Filter v2.11.0 alsa1.perex.cz 82D7AF80125 Authentication-Results: alsa1.perex.cz; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="PqG6a4MK" Received: by mail-qt1-x82b.google.com with SMTP id c20so971519qtw.8 for ; Fri, 02 Sep 2022 02:04:57 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=A0lRx9LcG2f6vdkkySTxdBxFyRczSLUlrhv0k8CVfMQ=; b=PqG6a4MKk2roT2Ce/PJEt8kCVddWYbqLQh141ATH+SE8SYCKK/ZFS9/OCHdfbfSgP8 mQREKuMuSelAb6SBLEEu74TKUjSBBmwZ8WjygarTrIA/KvHYGyMp8a2J70T92Jg3Pcrb kcjEtRkQqjOXCQllUJDzs4CbTXcsIuMEFmKFSormg00PlTnX1F1InK7vkFbhfO4twbjw wX8s3+vO/eXcBlAlq1ZPFwMRXYokbFEoLvKUt2HuPvjJ+iL9BHtDGUWj4Z7VTMBrr1UC L7HTZSBcu84jPm1mYMiEOrw0O3Q0JaNpk4QrVKItYAbCjz/FlYGhDCg+mGNEqLY5iH3A 0oww== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=A0lRx9LcG2f6vdkkySTxdBxFyRczSLUlrhv0k8CVfMQ=; b=x33TmmtIw9Edfuh1Y4q6bBEKbAM2NLBHpVKVwvhP0Qlo00c1NtkMyEUOsyCDdr7b2l o5SviU3GuC2n6RcZww8mH0w6mbyFkzRYGQhYjp+mUAGIraJ2iqdltzD0Yo1EzpP7ySr4 ThJoikgh2QMLlXfQvfYmBGZ78Bu2L5IfnuAifgGPcKxWPfqZiHhWbX7fahxJFbfkApNw xWaj7B/auMsqYpzUvt0eilYnwCo4OEo0r1O+VdPJhUBlCv8GTlQdHk7UuuKIbFoTxQFL UKJJGWYPgtqwN1JwdE34KwK9oxEW1kGDGveWzHAplo1/wY6xrTF+ySWtzKIKTCSylSEI UMvw== X-Gm-Message-State: ACgBeo1G/tU3qFIPW8vezlo84qh0Pg6iZW0HisBK6UySUlAJINoFqC2D LDKW3wdg32BUcOVyp9vp8MMNzZcNwMyBUMfUPhY= X-Google-Smtp-Source: AA6agR7C4/X8eo8OV4IEGqRGWP09L1le/kpVLIzKikXVS/h8SIICiTqB0VGNInh/3lWYFp6j5asmpgMaMlwtPWel10o= X-Received: by 2002:ac8:7dd0:0:b0:344:afc1:b11d with SMTP id c16-20020ac87dd0000000b00344afc1b11dmr26659521qte.195.1662109495202; Fri, 02 Sep 2022 02:04:55 -0700 (PDT) MIME-Version: 1.0 References: <20220901175022.334824-1-cezary.rojewski@intel.com> <20220901175022.334824-2-cezary.rojewski@intel.com> In-Reply-To: From: Andy Shevchenko Date: Fri, 2 Sep 2022 12:04:19 +0300 Message-ID: Subject: Re: [PATCH v3 1/2] lib/string_helpers: Introduce tokenize_user_input() To: Cezary Rojewski Content-Type: text/plain; charset="UTF-8" Cc: Andy Shevchenko , ALSA Development Mailing List , Kai Vehmanen , Liam Girdwood , Bard Liao , Pierre-Louis Bossart , Matthew Wilcox , Takashi Iwai , Hans de Goede , Mark Brown , Ranjani Sridharan , amadeuszx.slawinski@linux.intel.com, =?UTF-8?Q?P=C3=A9ter_Ujfalusi?= , Linux Kernel Mailing List X-BeenThere: alsa-devel@alsa-project.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: "Alsa-devel mailing list for ALSA developers - http://www.alsa-project.org" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: alsa-devel-bounces@alsa-project.org Sender: "Alsa-devel" On Fri, Sep 2, 2022 at 10:46 AM Cezary Rojewski wrote: > On 2022-09-01 9:34 PM, Andy Shevchenko wrote: > > On Thu, Sep 1, 2022 at 8:40 PM Cezary Rojewski > > wrote: ... > >> +int tokenize_user_input(const char __user *from, size_t count, int **tkns); > > > > Not sure how I can deduct from the name what function is actually > > doing. Suggested new name: int_array_parse_user(). > > > > int int_array_parse_user(const char __user *from, size_t count, int **array); > > > > (Note that we have _user suffix for many APIs in the kernel that does > > interact with user space memory) > > That's why I've added '_user_' in the middle! Anyway, I guess the > expectation is that it's a suffix - precisely at the end of the name. > > Could we reorder it a bit: "parse_int_array_user"? Most of the exported functions that have 'parse' word, have it after namespace, but in this case there is no dedicated namespace and it also will be in alignment with parse_options_str. That said, go for it. -- With Best Regards, Andy Shevchenko