From patchwork Mon Aug 22 17:49:23 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dmitry Rokosov X-Patchwork-Id: 12950993 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 97AA7C28D13 for ; Mon, 22 Aug 2022 17:50:34 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236127AbiHVRud (ORCPT ); Mon, 22 Aug 2022 13:50:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40756 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236941AbiHVRu3 (ORCPT ); Mon, 22 Aug 2022 13:50:29 -0400 Received: from mail.sberdevices.ru (mail.sberdevices.ru [45.89.227.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AB2AF3AB0F; Mon, 22 Aug 2022 10:50:24 -0700 (PDT) Received: from s-lin-edge02.sberdevices.ru (localhost [127.0.0.1]) by mail.sberdevices.ru (Postfix) with ESMTP id CCAFA5FD05; Mon, 22 Aug 2022 20:50:21 +0300 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sberdevices.ru; s=mail; t=1661190621; bh=kNxXhkdr74OhUzWIPaRNsxTjWoPYvj2BCzIs18HaIVo=; h=From:To:Subject:Date:Message-ID:Content-Type:MIME-Version; b=pv3GaHZWRyqvHkNzqlrMYE3LLky/2MHiU/8NkDMRkUl+bbyJ9KMjSXlMXPlfr8jHG YwGWGsFkpI4Y4Uh6fppmmDb6uGVZcCRu9LJ/d9iCxbSs1BySDnGagvgtwMXQhzJJ31 CdwQfOfOLE85IAVVFjK65tI2cRM5zs4qAwqvDkR89J/H2yswkq/Z1fNvhulHR3pB6s PZWYZWpj4rE3KY6jBgwgJzMe0CC/lQhRo9r9Ur+yNbGo7XATwC/m4W9fxxbkKjIK57 rq0va21+oxRhMPb9sIS2I9UzVAHpBr2mS3koE+zb3j4HWz/QCOb4hNapDJfWELUGux 5lVlGzeRgVStg== Received: from S-MS-EXCH02.sberdevices.ru (S-MS-EXCH02.sberdevices.ru [172.16.1.5]) by mail.sberdevices.ru (Postfix) with ESMTP; Mon, 22 Aug 2022 20:50:21 +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 v7 1/4] lib/string_helpers: Add str_read_write() helper Thread-Topic: [PATCH v7 1/4] lib/string_helpers: Add str_read_write() helper Thread-Index: AQHYtk+D9XpDTIOHIU+ilaS68VvtsQ== Date: Mon, 22 Aug 2022 17:49:23 +0000 Message-ID: <20220822175011.2886-2-ddrokosov@sberdevices.ru> References: <20220822175011.2886-1-ddrokosov@sberdevices.ru> In-Reply-To: <20220822175011.2886-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] 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/22 15:25:00 #20153291 X-KSMG-AntiVirus-Status: Clean, skipped Precedence: bulk List-ID: X-Mailing-List: linux-iio@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"; } +static inline const char *str_read_write(bool v) +{ + return v ? "read" : "write"; +} + #endif