lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <af726c5a-edd4-94f9-7789-4527e9aff93d@mentor.com>
Date:   Wed, 7 Mar 2018 12:34:07 +0530
From:   Harish Jenny K N <harish_kandiga@...tor.com>
To:     Avri Altman <Avri.Altman@....com>,
        "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "linus.walleij@...aro.org" <linus.walleij@...aro.org>,
        "adrian.hunter@...el.com" <adrian.hunter@...el.com>,
        "shawn.lin@...k-chips.com" <shawn.lin@...k-chips.com>,
        "andriy.shevchenko@...ux.intel.com" 
        <andriy.shevchenko@...ux.intel.com>
CC:     "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        "Vladimir_Zapolskiy@...tor.com" <Vladimir_Zapolskiy@...tor.com>
Subject: Re: [PATCH v6] mmc: Export host capabilities to debugfs.



On Wednesday 07 March 2018 12:10 PM, Avri Altman wrote:
>
>> -----Original Message-----
>> From: Harish Jenny K N [mailto:harish_kandiga@...tor.com]
>> Sent: Wednesday, March 07, 2018 7:38 AM
>> To: ulf.hansson@...aro.org; linus.walleij@...aro.org;
>> adrian.hunter@...el.com; shawn.lin@...k-chips.com; Avri Altman
>> <Avri.Altman@....com>; andriy.shevchenko@...ux.intel.com
>> Cc: linux-mmc@...r.kernel.org; linux-kernel@...r.kernel.org;
>> harish_kandiga@...tor.com; Vladimir_Zapolskiy@...tor.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
>> <Abbas_Raza@...tor.com> 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 <harish_kandiga@...tor.com>
>> ---
>>
>>
>> +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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ