Received: by 10.223.185.116 with SMTP id b49csp4999454wrg; Wed, 7 Mar 2018 04:52:27 -0800 (PST) X-Google-Smtp-Source: AG47ELt55HxWtetyG1aHbrtvn2a4KmhbwTy8BNuuE2NcoDLX/dQylp3bIaUn+O9sjvw34pB8XDow X-Received: by 10.99.181.94 with SMTP id u30mr18147909pgo.205.1520427147779; Wed, 07 Mar 2018 04:52:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520427147; cv=none; d=google.com; s=arc-20160816; b=ukgNg9p2vzDjUh8zfRXuWWgp9karYVw5epf5uM3R7JHiphWVnnZ4reS47Z2PS5xDbv njJzIa30UwU+kF16gZQ5lsSks7tZIzb6Yg8dAcUy33hTJIN041GShuVHmSgWEPnDF+2O kbJKgFwlnsHqLCTfWkcLRQ2VcomqPUN1YIbDyTEyBxBR3jbPgv2LDgKyn6iRIXUxAyH4 DFQuilwElWjxMKLv2NLF+WuM9jYGVy2gCAOmtDMbT85//YfO+jgc6Lvha97vwIMbxz4t lvplQUdhajNQvoy/DfXl4e+FQ97Q8ZWEvXcS9wlypJAfVtYPBjuJrAkDTkETgFRTO27E gEGg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :organization:references:in-reply-to:date:cc:to:from:subject :message-id:arc-authentication-results; bh=LYcAl6QUqXHlKL81HLSHIoYyDLCdGKWBnU1M3AKC67E=; b=sXiKW7yzmbmfAGP1Gqpsdqu4vGI0Zk+LRadcWpM5m2+5Ivc8ps4VmR9VKBmUTuVSE2 N44NCyZZDru8OudZKZVRPEmhkKzn8x5CSRKIXQdvGrdkXg5LEFyyXWvdN71ESojP/TXX J5QU1KSMq+IYCpq0b22CX892ET3VflmQZMbX6k6XGqy6Rd9x8kRj0ytq5tGtQJzv1jEX wfEY9Lckqdio7OjnE+Jl965aB9p5JIFRNRfoBe+bWmQBW3K5VgP2h+ZLSwucl4oC+U2E uwVYzQBmwG09YB2hD/5wkq6iYa6xIMwPNU5K7JsvqmOmf2rqROhtZzxpsoXLgH34q0Rp UCNw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j7-v6si9267765plk.627.2018.03.07.04.52.13; Wed, 07 Mar 2018 04:52:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754357AbeCGMtm (ORCPT + 99 others); Wed, 7 Mar 2018 07:49:42 -0500 Received: from mga02.intel.com ([134.134.136.20]:26123 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753953AbeCGMti (ORCPT ); Wed, 7 Mar 2018 07:49:38 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 07 Mar 2018 04:49:37 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.47,435,1515484800"; d="scan'208";a="36192650" Received: from smile.fi.intel.com (HELO smile) ([10.237.72.86]) by fmsmga001.fm.intel.com with ESMTP; 07 Mar 2018 04:49:35 -0800 Message-ID: <1520426974.10722.449.camel@linux.intel.com> Subject: Re: [PATCH v6] mmc: Export host capabilities to debugfs. From: Andy Shevchenko To: Harish Jenny K N , Avri Altman , "ulf.hansson@linaro.org" , "linus.walleij@linaro.org" , "adrian.hunter@intel.com" , "shawn.lin@rock-chips.com" Cc: "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Vladimir_Zapolskiy@mentor.com" Date: Wed, 07 Mar 2018 14:49:34 +0200 In-Reply-To: References: <1520401051-11135-1-git-send-email-harish_kandiga@mentor.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.26.5-1 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2018-03-07 at 12:34 +0530, Harish Jenny K N wrote: > > > > > > > > > +static int mmc_caps_show(struct seq_file *s, void *unused) { > > > + struct mmc_host *host = s->private; > > > + u32 caps = host->caps; > > > + > > > > > > + seq_puts(s, "\nMMC Host capabilities are:\n"); First of all, avoid leading '\n' in the messages. > > > > > > + seq_puts(s, > > > "=============================================\n"); > > > + seq_printf(s, "Can the host do 4 bit transfers :\t%s\n", > > > + ((caps & MMC_CAP_4_BIT_DATA) ? "Yes" : "No")); > > > > Maybe use a more compact form, and just call a macro with the > > applicable (stringified) bit? > > Something like this ? > > #define YN(bit) ((caps & bit) ? "Yes" : "No") > and then call > seq_printf(s, "Can the host do 4 bit transfers :\t%s\n", > YN(MMC_CAP_4_BIT_DATA)); > I would rather say something like this: static const char * const mmc_host_capabilities[] = { "4-bit transfers allowed", "...", ... }; ... for_each_set_bit(i, caps) seq_printf("%s\n", mmc_host_capabilities[i]); ... -- Andy Shevchenko Intel Finland Oy