Received: by 2002:a05:7412:2a8c:b0:e2:908c:2ebd with SMTP id u12csp1481407rdh; Mon, 25 Sep 2023 14:18:51 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFTwG1xyNRpBfK/CS7MRRowBHIOGRU8p9eK1cd9i/v4P0L0e9dNHDk98vZnZIuUzI/V5OYR X-Received: by 2002:a05:6a20:4299:b0:15d:a69e:2503 with SMTP id o25-20020a056a20429900b0015da69e2503mr11374985pzj.5.1695676731366; Mon, 25 Sep 2023 14:18:51 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1695676731; cv=none; d=google.com; s=arc-20160816; b=H5xUBOfYK1E9iINkld8X62IvA1bTh07lKiJPwy/biUUcyDHHIf8GkH+HWabwixFolE pY+U0yqp056bjipvNm3UR9WigoCHNEye13jfkWkHCaRvsUDqDmuDLSsBF9e0XI4cgUi8 WxnvsWKV0IxkU+3ULQ8qMX/fyCTz4JGU0ZejRb3je8BN946/Z0UT+lFEUhuHZjAl8Gwg Mx4B5mh3/sLh8jeiNp7D+tc3W7HxI0xnxvq9wR/HfDqbDjvoArs7Axn33Xt8Dx6rRlUU BXEM4mkttgqouhSt394Oke5f3PS/32CzB5C7Iw35z9bFD/A7ccrpdoDbVpoaEc49Kz6y HYBg== 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=s79tMVm9jZUuMN91b4SIwfAye42SUlMDh/B3R+rdTDM=; fh=vc6OB1SkNHxEb7N5xKl3CmJvvzrlr0dfWHktb27oMBo=; b=tnhe3wCwfpFpN/7FYx5RX0IUkvIug7QQmbBv1ptu+AXZ49lQwvSGJISqBz+FuEni+P HNQPwi09FrcKWQBuJSwG8m2B5QDEjlUNyA/uqzaYRla29Y5/93ZTWJPELTXsH5IPOwo0 ClAa6yOXH9HJDnm8Guj0HfFWTRVD6SDiOV3SlYfUZ56vF+nk0cWNru6ysrvEMiYXQodq VDILi/lx0IaR5bniO4jNhdkNlEtGgynIVaulbDIRXCfXxek3YcpSZ2MqofsNFFsFBwkB Hm1XEKaREq5eL/ANX0k0Bv+hNKHPNNiq6PuYTl9FzmmrSM6lVXTRSEBTM99WlYTy/YZE l77Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UgJil9Cm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (morse.vger.email. [23.128.96.31]) by mx.google.com with ESMTPS id kq7-20020a170903284700b001bdd1f48f91si10447293plb.564.2023.09.25.14.18.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 25 Sep 2023 14:18:51 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 as permitted sender) client-ip=23.128.96.31; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=UgJil9Cm; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.31 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 morse.vger.email (Postfix) with ESMTP id 30CA980440F7; Mon, 25 Sep 2023 07:49:56 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at morse.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232416AbjIYOtm (ORCPT + 99 others); Mon, 25 Sep 2023 10:49:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43352 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232408AbjIYOtd (ORCPT ); Mon, 25 Sep 2023 10:49:33 -0400 Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E70410A; Mon, 25 Sep 2023 07:49:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1695653367; x=1727189367; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xZAL9mmtzBPLoZZSRbfxi5bVlGrr6Q3oM+Pk6Zg20eI=; b=UgJil9CmSO2JpnhC5hj8HoAKXqtY+uWCRB+TgpJEKj/8CeufrVA6xI3u Al7aVokcbCw74VvC4puHBy9PD46od19ZxjWxzNnlQuRHDvWVRYvTVWSAH INLHX/yzVYicwO8k1H41Ju7EQftBIdTxXOno90ozmHQXsCCBcYAXDtwI6 mu0BGBcAXme1aKv3MJiPW1q3kELLTM8VAutGgqhtxQypnnVi031Cm9Uq+ hwhpbrrJNUsg/6uPuU32LUjVIrO1nfYVm3/3E7Pp+X+MMwiiSuyrzJh2L 8M8gRwhHe+2Dk67gSF22YKAf8lx/EV2TeiThY5JEgKq5pat3q/H55/sad Q==; X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="378548032" X-IronPort-AV: E=Sophos;i="6.03,175,1694761200"; d="scan'208";a="378548032" Received: from fmsmga006.fm.intel.com ([10.253.24.20]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 07:49:27 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10843"; a="995409476" X-IronPort-AV: E=Sophos;i="6.03,175,1694761200"; d="scan'208";a="995409476" Received: from powerlab.fi.intel.com ([10.237.71.25]) by fmsmga006-auth.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Sep 2023 07:49:24 -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, rui.zhang@intel.com, Michal Wilczynski , Andy Shevchenko Subject: [PATCH v1 4/9] ACPI: AC: Use string_choices API instead of ternary operator Date: Mon, 25 Sep 2023 17:48:37 +0300 Message-ID: <20230925144842.586829-5-michal.wilczynski@intel.com> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230925144842.586829-1-michal.wilczynski@intel.com> References: <20230925144842.586829-1-michal.wilczynski@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on morse.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 (morse.vger.email [0.0.0.0]); Mon, 25 Sep 2023 07:49:56 -0700 (PDT) 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 dd04809a787c..fd8b392c19f4 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