Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp4024255rwb; Tue, 16 Aug 2022 13:00:26 -0700 (PDT) X-Google-Smtp-Source: AA6agR6jziPv6n3KHxG9v6h7l9anwSJfCXXIvORViOkBIWgeRSkH3L7xd2jCr23PcmsnQPpT9lwK X-Received: by 2002:a17:902:6b82:b0:16d:d268:3842 with SMTP id p2-20020a1709026b8200b0016dd2683842mr23684081plk.16.1660680025835; Tue, 16 Aug 2022 13:00:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660680025; cv=none; d=google.com; s=arc-20160816; b=Rht25Z8EDiM9VLZPtDjNol05MC91HTMz+4tNzzy8rHgvly/8IQw2ZclXfntGyu40ws BoTpSOPF/ajMEYmKBeBYwsfDEU032HqIcuFql+eQevvfEoInf+yUk9yUHd12+h4QTBtQ gbz+vkpA2wWKP1Ay9+ZmL9rZlvXzANhtTzNXsmGVNr0S8slpdZvWAlEidAY0PS87y9Dd vvYynz5bkhNmcqoZAvMWatddrYKSypW+NpABa2NkzFfMIVOWb35a2v1uRmVhlg7TD9fV wUnVUYwCWq0nDpu94mrFFoKpRTvq2s4PL5Q7egX8xKp1b4ycHPqEZu5DBnKgGmTRAU/I byuw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :content-language:accept-language:in-reply-to:references:message-id :date:thread-index:thread-topic:subject:cc:to:from:dkim-signature; bh=kNxXhkdr74OhUzWIPaRNsxTjWoPYvj2BCzIs18HaIVo=; b=ve6kfXQMoM9nogljbT+JEjsIDQef5hMMbTfK1wvKBMGcs4gmvDE+uTV2IyqBINq92f AqVFVfifjrOIP7HAqdX+4lZTKZmEbVudExPnGn9HBvq0Ha7GEwiE9THjQSuYrF0A3bJe fdDJxFK4eDtOLnWbfUI9MeTeYnm5eGhHsCRjynaWBnbfTOCTmFpEqo7zIT/EU01kEcL6 bmDqyjqfndXA+YAtA4NdsGceXd4Wwje48wtJEfor//m9tjMCSDpewdDgtQQOCarA4SYc +jIHsT4w2W6bzd3b24CRosmh2WHSWh9fcbORCxExU6dOL7xvj8VynI+MX2+3WCM/AbZL smUA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@sberdevices.ru header.s=mail header.b=oOhLhAzp; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v186-20020a6389c3000000b004277f05f311si3454705pgd.135.2022.08.16.13.00.14; Tue, 16 Aug 2022 13:00:25 -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=@sberdevices.ru header.s=mail header.b=oOhLhAzp; 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=QUARANTINE sp=QUARANTINE dis=NONE) header.from=sberdevices.ru Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236957AbiHPTTH (ORCPT + 99 others); Tue, 16 Aug 2022 15:19:07 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236644AbiHPTTE (ORCPT ); Tue, 16 Aug 2022 15:19:04 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E4B35A3CC; Tue, 16 Aug 2022 12:18:59 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id D2B455FD0A; Tue, 16 Aug 2022 22:18:56 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1660677536; bh=kNxXhkdr74OhUzWIPaRNsxTjWoPYvj2BCzIs18HaIVo=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=oOhLhAzpunZrgl0lSBeQWQlBFqtLT3ErhWptxDa8qGYuYxFwb7GdxjhK+44j+ZFDN v5Al9MmMzo/1zntXe8TMPnXOFaEo4RfMPmLWfvGguqiQjF90VArZ5rJpKWI0bz/+0x s0VtOow1USamuflKjsUew5ZdrKlUcZ4kWaCccg1GcvRt+NRtYVpS5bMYZJca+Nx5cC WFQzP+8kn22h9rY94phIvdmQhrt1iiJpA70De0PjU8ytaUIxir5KGB18trzsfwDi1l yXUH8DCRRHYky3qq8KODm6O7MA/S3tU1OPQoSJtaoDO240SEfZzIUQowPh7Oyj/L6y fEGRRa3gjI4vg== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mail.sberdevices.ru (Postfix) with ESMTP; Tue, 16 Aug 2022 22:18:56 +0300 (MSK) From: Dmitry Rokosov To: "akpm@linux-foundation.org" , "jic23@kernel.org" , "robh+dt@kernel.org" , "andriy.shevchenko@linux.intel.com" , "andy.shevchenko@gmail.com" , "christophe.jaillet@wanadoo.fr" , "stano.jakubek@gmail.com" , "shawnguo@kernel.org" , "stephan@gerhold.net" , "daniel.lezcano@linaro.org" , "wsa@kernel.org" , "lars@metafoo.de" , "Michael.Hennerich@analog.com" , "jbhayana@google.com" , "lucas.demarchi@intel.com" , "jani.nikula@intel.com" , "linus.walleij@linaro.org" CC: "linux-iio@vger.kernel.org" , kernel , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , Dmitry Rokosov Subject: [PATCH v6 1/4] lib/string_helpers: Add str_read_write() helper Thread-Topic: [PATCH v6 1/4] lib/string_helpers: Add str_read_write() helper Thread-Index: AQHYsaUAdZHJnw656k6pbt0EDuDqsQ== Date: Tue, 16 Aug 2022 19:18:43 +0000 Message-ID: <20220816191842.14020-2-ddrokosov@sberdevices.ru> References: <20220816191842.14020-1-ddrokosov@sberdevices.ru> In-Reply-To: <20220816191842.14020-1-ddrokosov@sberdevices.ru> Accept-Language: ru-RU, en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.16.1.12] Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-KSMG-Rule-ID: 4 X-KSMG-Message-Action: clean X-KSMG-AntiSpam-Status: not scanned, disabled by settings X-KSMG-AntiSpam-Interceptor-Info: not scanned X-KSMG-AntiPhishing: not scanned, disabled by settings X-KSMG-AntiVirus: Kaspersky Secure Mail Gateway, version 1.1.2.30, bases: 2022/08/16 16:01:00 #20126973 X-KSMG-AntiVirus-Status: Clean, skipped X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 From: Andy Shevchenko Add str_read_write() helper to return 'read' or 'write' string literal. Signed-off-by: Andy Shevchenko Signed-off-by: Dmitry Rokosov --- include/linux/string_helpers.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/linux/string_helpers.h b/include/linux/string_helpers.= h index 4d72258d42fd..9e22cd78f3b8 100644 --- a/include/linux/string_helpers.h +++ b/include/linux/string_helpers.h @@ -126,4 +126,9 @@ static inline const char *str_enabled_disabled(bool v) return v ? "enabled" : "disabled"; } =20 +static inline const char *str_read_write(bool v) +{ + return v ? "read" : "write"; +} + #endif --=20 2.36.0