From: hch@lst.de (Christoph Hellwig)
Subject: [PATCHv2 4/5] block/sed: Embed function data into the function sequence
Date: Sat, 18 Feb 2017 17:22:03 +0100 [thread overview]
Message-ID: <20170218162203.GC17922@lst.de> (raw)
In-Reply-To: <d6d1c65a-4422-97d7-8ee8-fef46159b143@eng.utah.edu>
On Sat, Feb 18, 2017@08:52:19AM -0700, Scott Bauer wrote:
> >> +static int set_mbr_done(struct opal_dev *dev, void *data)
> >> {
> >> - u8 mbr_done_tf = *(u8 *)dev->func_data[dev->state];
> >> + u8 mbr_done_tf = *(u8 *)data;
> >
> > No need for casts when going from void * to any pointer type. There are
> > a couple more instance below where the cast should be removed as well.
>
> In this case he's actually casting & dereferencing the pointer, so it should be fine in this scenario?
Oh, right. As-is we'll obviously need the casts. But what we could
do instead is the following:
u8 *mbr_done_tf = data;
..
add_token_u8(&err, dev, *mbr_done_tf); /* Done T or F */
or alternatively just pass the whole struct opal_mbr_data pointer
as the private data.
next prev parent reply other threads:[~2017-02-18 16:22 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-02-18 0:00 [PATCHv2 0/5] OPAL patche'd cont'd Jon Derrick
2017-02-18 0:00 ` [PATCHv2 1/5] block/sed: Use ssize_t on atom parsers to return errors Jon Derrick
2017-02-18 0:00 ` [PATCHv2 2/5] block/sed: Add helper to qualify response tokens Jon Derrick
2017-02-18 0:00 ` [PATCHv2 3/5] block/sed: Check received header lengths Jon Derrick
2017-02-18 0:00 ` [PATCHv2 4/5] block/sed: Embed function data into the function sequence Jon Derrick
2017-02-18 8:36 ` Christoph Hellwig
2017-02-18 15:52 ` Scott Bauer
2017-02-18 16:22 ` Christoph Hellwig [this message]
2017-02-18 0:00 ` [PATCHv2 5/5] block/sed: Eliminate state variable Jon Derrick
2017-02-18 8:36 ` Christoph Hellwig
2017-02-18 8:24 ` [PATCHv2 0/5] OPAL patche'd cont'd Christoph Hellwig
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170218162203.GC17922@lst.de \
--to=hch@lst.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox