From patchwork Wed Feb 3 21:56:39 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= X-Patchwork-Id: 12065513 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.7 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9F630C433E6 for ; Wed, 3 Feb 2021 21:57:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 52D0B64D90 for ; Wed, 3 Feb 2021 21:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232437AbhBCV5g (ORCPT ); Wed, 3 Feb 2021 16:57:36 -0500 Received: from mail-40131.protonmail.ch ([185.70.40.131]:36949 "EHLO mail-40131.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232506AbhBCV52 (ORCPT ); Wed, 3 Feb 2021 16:57:28 -0500 Date: Wed, 03 Feb 2021 21:56:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail; t=1612389405; bh=KYuM2LWlGBHP3Fdn8PrtE8hJkOBjwRdF7fC1KJvyfIY=; h=Date:To:From:Reply-To:Subject:From; b=l5S04E4l7Uw6L5u8KRgfcnMqlbIqCdob1lok+jPZ2WEzUmlv15ERGTlT+6M65Yf4i OOKWHeSNUDGH2qK5MlSEKIrMncHimwAp8DqWbP7uG29xCCCwwDwttICemc/pf2inVt OOrtN+qaoviaqA0IcyVI0wPkdFooJP5IdS7erRI4= To: platform-driver-x86@vger.kernel.org, Hans de Goede , Mark Gross , Ike Panhc , Andy Shevchenko From: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Reply-To: =?utf-8?q?Barnab=C3=A1s_P=C5=91cze?= Subject: [PATCH v3 22/29] platform/x86: ideapad-laptop: change 'cfg' debugfs file format Message-ID: <20210203215403.290792-23-pobrn@protonmail.com> MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: platform-driver-x86@vger.kernel.org Minor formatting changes. Use seq_puts() where possible. Signed-off-by: Barnabás Pőcze diff --git a/drivers/platform/x86/ideapad-laptop.c b/drivers/platform/x86/ideapad-laptop.c index 34e93ac83d8e..0a5ca91cfe9e 100644 --- a/drivers/platform/x86/ideapad-laptop.c +++ b/drivers/platform/x86/ideapad-laptop.c @@ -322,37 +322,40 @@ static int debugfs_cfg_show(struct seq_file *s, void *data) { struct ideapad_private *priv = s->private; - seq_printf(s, "cfg: 0x%.8lX\n\nCapability: ", - priv->cfg); + seq_printf(s, "_CFG: %#010lx\n\n", priv->cfg); + + seq_puts(s, "Capabilities:"); if (test_bit(CFG_CAP_BT_BIT, &priv->cfg)) - seq_printf(s, "Bluetooth "); + seq_puts(s, " bluetooth"); if (test_bit(CFG_CAP_3G_BIT, &priv->cfg)) - seq_printf(s, "3G "); + seq_puts(s, " 3G"); if (test_bit(CFG_CAP_WIFI_BIT, &priv->cfg)) - seq_printf(s, "Wireless "); + seq_puts(s, " wifi"); if (test_bit(CFG_CAP_CAM_BIT, &priv->cfg)) - seq_printf(s, "Camera "); + seq_puts(s, " camera"); if (test_bit(CFG_CAP_TOUCHPAD_BIT, &priv->cfg)) - seq_printf(s, "Touchpad "); - seq_printf(s, "\nGraphic: "); - switch ((priv->cfg)&0x700) { + seq_puts(s, " touchpad"); + seq_puts(s, "\n"); + + seq_puts(s, "Graphics: "); + switch (priv->cfg & 0x700) { case 0x100: - seq_printf(s, "Intel"); + seq_puts(s, "Intel"); break; case 0x200: - seq_printf(s, "ATI"); + seq_puts(s, "ATI"); break; case 0x300: - seq_printf(s, "Nvidia"); + seq_puts(s, "Nvidia"); break; case 0x400: - seq_printf(s, "Intel and ATI"); + seq_puts(s, "Intel and ATI"); break; case 0x500: - seq_printf(s, "Intel and Nvidia"); + seq_puts(s, "Intel and Nvidia"); break; } - seq_printf(s, "\n"); + seq_puts(s, "\n"); return 0; }