diff mbox series

mmc: document 'Reliable Write' bit in uapi header

Message ID 20181203142644.3038-1-wsa+renesas@sang-engineering.com (mailing list archive)
State Superseded
Delegated to: Geert Uytterhoeven
Headers show
Series mmc: document 'Reliable Write' bit in uapi header | expand

Commit Message

Wolfram Sang Dec. 3, 2018, 2:26 p.m. UTC
If we use it this way, people should know about it.

Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
---

Still not super happy about shifting into the sign bit, but yeah...
don't break userspace, I guess.

 include/uapi/linux/mmc/ioctl.h | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

Comments

Geert Uytterhoeven Dec. 3, 2018, 3 p.m. UTC | #1
Hi Wolfram,

On Mon, Dec 3, 2018 at 3:27 PM Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> If we use it this way, people should know about it.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>

Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

> ---
>
> Still not super happy about shifting into the sign bit, but yeah...
> don't break userspace, I guess.

Indeed.

>  include/uapi/linux/mmc/ioctl.h | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
> index 45f369dc0a42..ae659333e73f 100644
> --- a/include/uapi/linux/mmc/ioctl.h
> +++ b/include/uapi/linux/mmc/ioctl.h
> @@ -5,7 +5,10 @@
>  #include <linux/types.h>
>
>  struct mmc_ioc_cmd {
> -       /* Implies direction of data.  true = write, false = read */
> +       /*
> +        * Implies direction of data.  true = write, false = read.

nonzero = write, zero = read?

> +        * Bit 31 selects 'Reliable Write' for RPMB.

Perhaps having a #define for this would be nice?
Can also be used by the driver, instead of 1 << 31, which some static
analyzers may complain about.

> +        */
>         int write_flag;
>
>         /* Application-specific command.  true = precede with CMD55 */

Gr{oetje,eeting}s,

                        Geert
Wolfram Sang Dec. 3, 2018, 4:15 p.m. UTC | #2
> > Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> 
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>

Thanks, Geert!

> > -       /* Implies direction of data.  true = write, false = read */
> > +       /*
> > +        * Implies direction of data.  true = write, false = read.
> 
> nonzero = write, zero = read?

Yes, even better. Will update.

> > +        * Bit 31 selects 'Reliable Write' for RPMB.
> 
> Perhaps having a #define for this would be nice?
> Can also be used by the driver, instead of 1 << 31, which some static
> analyzers may complain about.

Maybe. Should be an incremental patch then, I'd say.
diff mbox series

Patch

diff --git a/include/uapi/linux/mmc/ioctl.h b/include/uapi/linux/mmc/ioctl.h
index 45f369dc0a42..ae659333e73f 100644
--- a/include/uapi/linux/mmc/ioctl.h
+++ b/include/uapi/linux/mmc/ioctl.h
@@ -5,7 +5,10 @@ 
 #include <linux/types.h>
 
 struct mmc_ioc_cmd {
-	/* Implies direction of data.  true = write, false = read */
+	/*
+	 * Implies direction of data.  true = write, false = read.
+	 * Bit 31 selects 'Reliable Write' for RPMB.
+	 */
 	int write_flag;
 
 	/* Application-specific command.  true = precede with CMD55 */