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: <YN7DrIxI2QSDhoy4@infradead.org>
Date:   Fri, 2 Jul 2021 08:43:40 +0100
From:   Christoph Hellwig <hch@...radead.org>
To:     Christian L?hle <CLoehle@...erstone.com>
Cc:     "linux-mmc@...r.kernel.org" <linux-mmc@...r.kernel.org>,
        "ulf.hansson@...aro.org" <ulf.hansson@...aro.org>,
        "linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
        Avri Altman <Avri.Altman@....com>
Subject: Re: [PATCH] mmc: block: Differentiate busy and non-TRAN state

> +	/*
> +	 * Cards will never return to TRAN after completing
> +	 * identification commands or MMC_SEND_STATUS if they are not selected.
> +	 */
> +	return !(cmd->opcode == MMC_GO_IDLE_STATE
> +			|| cmd->opcode == MMC_SEND_OP_COND
> +			|| cmd->opcode == MMC_ALL_SEND_CID
> +			|| cmd->opcode == MMC_SET_RELATIVE_ADDR
> +			|| cmd->opcode == MMC_SET_DSR
> +			|| cmd->opcode == MMC_SLEEP_AWAKE
> +			|| cmd->opcode == MMC_SELECT_CARD
> +			|| cmd->opcode == MMC_SEND_CSD
> +			|| cmd->opcode == MMC_SEND_CID
> +			|| cmd->opcode == MMC_SEND_STATUS
> +			|| cmd->opcode == MMC_GO_INACTIVE_STATE
> +			|| cmd->opcode == MMC_APP_CMD);

This is not the normal kernel style, which puts operators at the end
of the line.  And while a little more verbose I think a switch statement
would be a lot more readable here:

	switch (cmd->opcode) {
	case MMC_GO_IDLE_STATE:
	case MMC_SEND_OP_COND:
	case MMC_ALL_SEND_CID:
	case MMC_SET_RELATIVE_ADDR:
	case MMC_SET_DSR:
	case MMC_SLEEP_AWAKE:
	case MMC_SELECT_CARD:
	case MMC_SEND_CSD:
	case MMC_SEND_CID:
	case MMC_SEND_STATUS:
	case MMC_GO_INACTIVE_STATE:
	case MMC_APP_CMD:
		return false;
	default:
		return true;
	}

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ