Received: by 2002:a05:7412:da14:b0:e2:908c:2ebd with SMTP id fe20csp537954rdb; Fri, 6 Oct 2023 10:31:53 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHcSE4VEFnUaO1madH+yr00XtZY7lTwrCTyzozaqj5NabriLggHLLTVBNcZRCEAUsJlIBfw X-Received: by 2002:a17:902:c411:b0:1c3:e2eb:f79d with SMTP id k17-20020a170902c41100b001c3e2ebf79dmr8415035plk.8.1696613512828; Fri, 06 Oct 2023 10:31:52 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1696613512; cv=none; d=google.com; s=arc-20160816; b=AUg5RFDY9jlslTEzOx4xejQWCyZKHaMDUpqdxpUAtaOBvOHMP93m3W2g4+LdxfgOrP Nox5sopMX+b8a20h+odkNIvtGT4IiveW3F5IfA9174dPfcPwujmkeHryCGnl1zGQgcQO UmcmOl/71V0Zd6m+x22nEklcbkixzc+ti0WGY5jbsq87dPzgTbQGQ1a6i8miWPFMAf3Z YODs7f+UHah227Ns0VIntvgQwE22Na1TQywFN3nt8jj14eDQgnK/0jeAmSnvcYQ067Gf janJ5KIz6LxvIMpsyaGD7wLUrual2vi+6UWmBZlr50vrpcrqeTfv9xOFoS7t+z2hljm1 9Gvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=iG6jz8d0tjMJY5+b2+xvdz578Wn8vNP7gIzR4DpceEs=; fh=mLwpXbRC66JNOEw8jncRnJ6BTHfhXYIQRe4j+M4FwDE=; b=IuaA3brFigJ9Dh2SNnx66MmbrIjaS29kwYD35T97fo8dJixLTmRDS6eoLMbT3PqjnJ LS0GOQlUj9e77tF0mycYYBaT6ttRx7vLUwTYb00xfwf8DdrWMmbovbOAzJqGOarBAdN8 6e4F541nAV9yYW8HK00mT/IKdJghsX2q1+7hf8oj2/bC6Aj+iPVS38vqEKz2a25zDA4y DveTrmX5Lc+K4biQ9OMXEgxPi3djUzdmruq3MQefiQhNOSf/2d2rk/OB/HU21W3nFNbp nAKx90qPXy41QS8J/fex5/z2UNI/gFhSfyc6GoXclnLzBonV5hdNnzXN7CFvzLvii3HC aVMg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mkxFS4Fq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from fry.vger.email (fry.vger.email. [2620:137:e000::3:8]) by mx.google.com with ESMTPS id o13-20020a170902d4cd00b001c4329b77bfsi4426961plg.123.2023.10.06.10.31.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 06 Oct 2023 10:31:52 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) client-ip=2620:137:e000::3:8; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=mkxFS4Fq; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::3:8 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by fry.vger.email (Postfix) with ESMTP id 15EF3809B6C6; Fri, 6 Oct 2023 10:31:47 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at fry.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233058AbjJFRbW (ORCPT + 99 others); Fri, 6 Oct 2023 13:31:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233066AbjJFRbU (ORCPT ); Fri, 6 Oct 2023 13:31:20 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E760BF0; Fri, 6 Oct 2023 10:31:17 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1696613478; x=1728149478; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=9GeUK2SGN9OGtW6dMn16QDj8PfFEO9Do3zKwnp3cbpk=; b=mkxFS4FqaFU/mwRrCohof7MBRrHc7ITK0/tTmp0YeT9Nf+vlkTXNg4kj GBM5xZNGtExr4G5lsNvVRj83oY+Bb8SM3nNxKztAlCp8Hra5ghRmh9/RU no9SM0Yy3uzEqwqSbyjI3A317KIG9LUD8cxKgQWKTzJqrNBL1w9ISBKT1 4Obk32z2CSjUniNXrcjYmXrAdvmz4u9jpvuwa2MUFMLuOuAoqowfjg3Qn Ubssm3VqOeXap7ZiBljlzZlAxv+6pXJPNUvw4VaY3wmH9zs9QlrGAT6qo yquK2Rb9hh1XkLOmrdXxH8Zm1NhCk71hcASq6jVukAV0ltpXLvP81KkxS w==; X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="387676794" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="387676794" Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 10:31:14 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10855"; a="745937391" X-IronPort-AV: E=Sophos;i="6.03,204,1694761200"; d="scan'208";a="745937391" Received: from powerlab.fi.intel.com ([10.237.71.25]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 06 Oct 2023 10:31:11 -0700 From: Michal Wilczynski To: linux-acpi@vger.kernel.org, linux-kernel@vger.kernel.org, nvdimm@lists.linux.dev Cc: rafael.j.wysocki@intel.com, andriy.shevchenko@intel.com, lenb@kernel.org, dan.j.williams@intel.com, vishal.l.verma@intel.com, ira.weiny@intel.com, Michal Wilczynski , Andy Shevchenko Subject: [PATCH v2 2/6] ACPI: AC: Use string_choices API instead of ternary operator Date: Fri, 6 Oct 2023 20:30:51 +0300 Message-ID: <20231006173055.2938160-3-michal.wilczynski@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20231006173055.2938160-1-michal.wilczynski@intel.com> References: <20231006173055.2938160-1-michal.wilczynski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=2.7 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_SBL_CSS,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on fry.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (fry.vger.email [0.0.0.0]); Fri, 06 Oct 2023 10:31:47 -0700 (PDT) X-Spam-Level: ** Use modern string_choices API instead of manually determining the output using ternary operator. Suggested-by: Andy Shevchenko Reviewed-by: Andy Shevchenko Signed-off-by: Michal Wilczynski --- drivers/acpi/ac.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/acpi/ac.c b/drivers/acpi/ac.c index 83d45c681121..f809f6889b4a 100644 --- a/drivers/acpi/ac.c +++ b/drivers/acpi/ac.c @@ -17,6 +17,7 @@ #include #include #include +#include #include #include @@ -243,8 +244,8 @@ static int acpi_ac_add(struct acpi_device *device) goto err_release_ac; } - pr_info("%s [%s] (%s)\n", acpi_device_name(device), - acpi_device_bid(device), ac->state ? "on-line" : "off-line"); + pr_info("%s [%s] (%s-line)\n", acpi_device_name(device), + acpi_device_bid(device), str_on_off(ac->state)); ac->battery_nb.notifier_call = acpi_ac_battery_notify; register_acpi_notifier(&ac->battery_nb); -- 2.41.0