Received: by 10.223.185.116 with SMTP id b49csp4721102wrg; Tue, 6 Mar 2018 23:06:32 -0800 (PST) X-Google-Smtp-Source: AG47ELtf0HUEd0g4EHzXii81k+DUO4YL0rtr8gj5/ynIN32UZem/tC6fgpWdNrTI8yadzHpzw+5u X-Received: by 10.167.128.80 with SMTP id y16mr21407613pfm.91.1520406392722; Tue, 06 Mar 2018 23:06:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520406392; cv=none; d=google.com; s=arc-20160816; b=vJPpVJF2LPdB/mwEcEAAcEd7N+SJNfpRTnwy6QDKTD3jFN2kCaEk4kQCwX4DPeyU1C PoocP8dYjC/D13X0oXLn44S1NsBwwEwNi2E53r2ubovdW7PA/WqebxOG6PVDUbkKeorW BOo5lONv7QzbUI5NkAEYtjWabc78N807oGbIsJjIoCmCHOukaW4xn+N8ZvQ4tKDoQg6K FwQ+Y0sZLbLIfHjFGAXTK3lKcmD8eNJLHbRz3jTU8VTWfdCE02fClwpIGdlbLY7bxhrV NU1ZoifvZ50n8AHIjfQ/tkoqqYMCf9JzLuzZ2VpEDmDhE19kVwp31BvJeXvf9WviQrBX NcYQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:arc-authentication-results; bh=OPMey1QnBEgSpN/s8wFUd49CVdMxSZYqNSzi7Ja00zo=; b=pFL8K4rbq4lDeSkBBmQiWz4Qsmg/qdS4OnGLVPP8OnyN0CHnADaNAkXnLZtnMC0jNK 2S4Bfl8qh8n9bBsP7qETOYKjg/ax1XLRgRt5qcbu3Ff6O6Qu1/mVHYgVnD8V90pnWCLZ euhmrcP3HnmGwUp/g95koa6b9olHvIB1oR7u0yfXLaif/EdRWejWGdmrt6ZSyHRHHxmm p8Rm2JAgRqkaCTjaa8fAJJeRTcTGwFyQzU3628m/MWnN5OnCrzq4UMhhO+qZHahsQM2a XJ3TsWYYX0FQ35gNdA42PDW8cCGEUVYojlGW+5Gy5RYWUawxsfEkmGUUnRMrxHMDegDL 6sKw== 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 q13si11105420pgs.277.2018.03.06.23.05.39; Tue, 06 Mar 2018 23:06:32 -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 S1751156AbeCGHEe (ORCPT + 99 others); Wed, 7 Mar 2018 02:04:34 -0500 Received: from relay1.mentorg.com ([192.94.38.131]:57127 "EHLO relay1.mentorg.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750994AbeCGHEc (ORCPT ); Wed, 7 Mar 2018 02:04:32 -0500 Received: from nat-ies.mentorg.com ([192.94.31.2] helo=SVR-IES-MBX-04.mgc.mentorg.com) by relay1.mentorg.com with esmtps (TLSv1.2:ECDHE-RSA-AES256-SHA384:256) id 1etT7m-0003Jj-CN from Harish_Kandiga@mentor.com ; Tue, 06 Mar 2018 23:04:30 -0800 Received: from [10.0.2.15] (137.202.0.87) by SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) with Microsoft SMTP Server (TLS) id 15.0.1320.4; Wed, 7 Mar 2018 07:04:25 +0000 Subject: Re: [PATCH v6] mmc: Export host capabilities to debugfs. To: Avri Altman , "ulf.hansson@linaro.org" , "linus.walleij@linaro.org" , "adrian.hunter@intel.com" , "shawn.lin@rock-chips.com" , "andriy.shevchenko@linux.intel.com" CC: "linux-mmc@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "Vladimir_Zapolskiy@mentor.com" References: <1520401051-11135-1-git-send-email-harish_kandiga@mentor.com> From: Harish Jenny K N Message-ID: Date: Wed, 7 Mar 2018 12:34:07 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.6.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit Content-Language: en-US X-Originating-IP: [137.202.0.87] X-ClientProxiedBy: svr-ies-mbx-02.mgc.mentorg.com (139.181.222.2) To SVR-IES-MBX-04.mgc.mentorg.com (139.181.222.4) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wednesday 07 March 2018 12:10 PM, Avri Altman wrote: > >> -----Original Message----- >> From: Harish Jenny K N [mailto:harish_kandiga@mentor.com] >> Sent: Wednesday, March 07, 2018 7:38 AM >> To: ulf.hansson@linaro.org; linus.walleij@linaro.org; >> adrian.hunter@intel.com; shawn.lin@rock-chips.com; Avri Altman >> ; andriy.shevchenko@linux.intel.com >> Cc: linux-mmc@vger.kernel.org; linux-kernel@vger.kernel.org; >> harish_kandiga@mentor.com; Vladimir_Zapolskiy@mentor.com >> Subject: [PATCH v6] mmc: Export host capabilities to debugfs. >> >> This patch exports the host capabilities to debugfs >> >> This idea of sharing host capabilities over debugfs came up from Abbas Raza >> Earlier discussions: >> https://lkml.org/lkml/2018/3/5/357 >> https://www.spinics.net/lists/linux-mmc/msg48219.html >> >> Signed-off-by: Harish Jenny K N >> --- >> >> >> +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"); >> + 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)); Thanks, Harish Jenny K N