Received: by 2002:a05:6358:45e:b0:b5:b6eb:e1f9 with SMTP id 30csp1121008rwe; Thu, 1 Sep 2022 12:55:06 -0700 (PDT) X-Google-Smtp-Source: AA6agR6ZX6F4WmuD4pO+M+ISXtoDbp/gQ04i9XfzNaxZnvdhN17HYOWd8emEJowR01xw0fcTd5nM X-Received: by 2002:a05:6402:4517:b0:443:7fe1:2d60 with SMTP id ez23-20020a056402451700b004437fe12d60mr30247967edb.133.1662062106085; Thu, 01 Sep 2022 12:55:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662062106; cv=none; d=google.com; s=arc-20160816; b=lw1RfdjGzjLdCF6dzMRKEWqE4eJzJWv0LnakGdsvvvPEY2PPwiaz4uHLih/ZlPtD2m b3wLEOu8QNlmHC0NMCwacVIY0sxSY4r1hmBoAeYuDB/KNGp4VcAclGFyLpE5S8vsGZ4B eR1eRwsDf6ZDbWzbcQSx2X/Rhw+UoSoJ64GXv645aOJ7UgOuWzVg0wBmhTAmMHaUO6Z0 Qr52MKOIkZmcSgTsj/EVE8+L8l3FHKPq8rJFCMTWRQTRLga+zbyrNjQn+sIPERLPF029 CCnMjcCYGGV0V8lfk/IOZwnDA1KFMjn4oO7UZ4v+e+ybSHtMOMCyVihYJwmufJKm63eE OV1A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=UTBH3ZdVXDU80DZLVRDqtIzjJqfExVq6UuHtVbe7ytw=; b=wAkFOAyjLemO5/BHDOda+Q/LiJJ+awEmSTpesZBxaVev7OKnq+zQzwyLYdJftwy0qU 6rKYnuaPpkEQg7ZaDVCcCbvz4FF75bgf8qeGqgSDD0KBkRaAVP3SEXEPD65meEADvmxz pGuvC4gDUZzpouYs0aYwjqyEyDrkGZjbHbc84WvcQD8BLImPUv1PmdL8mGeM4bt1yVWr lrudzVZwf1pQRt35SBqsyhXI/UsHVSNg44R4UVYLmurIArgPMwuVrPwLvmP55KMS14MU tfQtKtPQPFhGzzU8cbYZLwbjXGAT5zJe0wDV689JnJ9ki40IyoF9TU2pGW1H0NZqPEvp wCNA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cc6qIcfe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id m19-20020a056402511300b00443a8854bd1si38397edd.219.2022.09.01.12.54.40; Thu, 01 Sep 2022 12:55:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=cc6qIcfe; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234282AbiIATfe (ORCPT + 99 others); Thu, 1 Sep 2022 15:35:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34476 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234043AbiIATfb (ORCPT ); Thu, 1 Sep 2022 15:35:31 -0400 Received: from mail-qv1-xf2c.google.com (mail-qv1-xf2c.google.com [IPv6:2607:f8b0:4864:20::f2c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3D54C371B2 for ; Thu, 1 Sep 2022 12:35:30 -0700 (PDT) Received: by mail-qv1-xf2c.google.com with SMTP id f9so10582574qvw.11 for ; Thu, 01 Sep 2022 12:35:30 -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=UTBH3ZdVXDU80DZLVRDqtIzjJqfExVq6UuHtVbe7ytw=; b=cc6qIcfeYMZ/SYFhyoOYaOlejSar4fvt7eaC6hWph8Vm89PxHJePz6jHQuUA3uKOxW xoTb/FIeZEjEW9w4NCFuhaYpPrfpJV/zJIvQufFLDvYJBV7rG0whxvGEaiET0X4TnOKI CSxHkTzgBb8BNcBUXa8evSulFwvVWMOZxIt6Xq7Iy/0ifZixSTfYHgKw8O7+5E4bZSaz IwcCzXTwudYYjaV7t+vQkIg8sXbOoMQYCDo7bFvAUQ9/3bNuTFPDqiIOzv11BkZhxiIH 0CtLSbVdwVcJ+EDSJAr48KcnueG6sU7NHnMJu9KdeaNijV2p21nG5lVZ1LSvqy8PbkTP ARyA== 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=UTBH3ZdVXDU80DZLVRDqtIzjJqfExVq6UuHtVbe7ytw=; b=cmZuzl2HIeLZLe7uLj/CedRvMeROvgPI142qeVHu7qt6fnQ6Ld43KbaBid16e2setG d8xcWfnYQGvF0IkQ5K72twy2KGOi9YtqkBMbGowTzPDbFY2yByTm0BA6PTVpbnVtIYRO y6gytNL2HhUvJaeIUbiGMjFt97Wh4Q98ynApRTbTvRiMxxqnwMzV+E2FF900KKWW9NqC wQ510PbDbF3P/IjCh/1UDYPdUhd1BwXVkbedJ11OP6yTEY5ieUbmZXhFYXMA/VsoF44O SwJ/6ZVMhAuZZQmFE+NW9E2w8lOB1VYA6O4CWtMq1yRUeKGhF5THQei41paJQoycfQ9w qFiw== X-Gm-Message-State: ACgBeo0L76pHbS84KCkFblQxx1j5gmOK0ppjvZrM/PWd03rNNNEJIsIu X71JeOG8a2OJ/26j4uCKxqzRxT1U15tq1cAQnzE= X-Received: by 2002:a05:6214:c8f:b0:499:21eb:ba3b with SMTP id r15-20020a0562140c8f00b0049921ebba3bmr7362076qvr.97.1662060929333; Thu, 01 Sep 2022 12:35:29 -0700 (PDT) MIME-Version: 1.0 References: <20220901175022.334824-1-cezary.rojewski@intel.com> <20220901175022.334824-2-cezary.rojewski@intel.com> In-Reply-To: <20220901175022.334824-2-cezary.rojewski@intel.com> From: Andy Shevchenko Date: Thu, 1 Sep 2022 22:34:53 +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" X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Sep 1, 2022 at 8:40 PM Cezary Rojewski wrote: > > Add new helper function to allow for splitting specified user string > into a sequence of integers. Internally it makes use of get_options() so > the returned sequence contains the integers extracted plus an additional > element that begins the sequence and specifies the integers count. Thanks! In general it looks good to me, but a few minor comments below. ... > +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) ... > + * @tkns: Returned pointer to sequence of integers array ... If you are okay with this, you may add my Reviewed-by: Andy Shevchenko -- With Best Regards, Andy Shevchenko