Re: [PATCHv2] scsi: use 'scsi_device_from_queue()' for scsi_dh

2017-02-18 Thread Mike Snitzer
On Fri, Feb 17, 2017 at 3:27 AM, Christoph Hellwig wrote: > > On Fri, Feb 17, 2017 at 09:06:14AM +0100, Hannes Reinecke wrote: > > We could, but why? > > ATM we're only having SCSI devices able to use device handler; adding > > another layer of indirection doesn't solve anything

Re: [PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-18 Thread Christoph Hellwig
On Sat, Feb 18, 2017 at 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

Re: [PATCH] block/sed-opal: Introduce free_opal_dev to free the structure and clean up state

2017-02-18 Thread Christoph Hellwig
On Fri, Feb 17, 2017 at 10:25:13AM -0700, Scott Bauer wrote: > Before we free the opal structure we need to clean up any saved > locking ranges that the user had told us to unlock from a suspend. > Also fixup a list_for_each to list_for_each_safe in the save path. > > Signed-off-by: Scott Bauer

Re: [PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-18 Thread Scott Bauer
On 02/18/2017 01:36 AM, Christoph Hellwig wrote: > Hi Jon, > > I think this is a great cleanup! > > A few nitpicky comments below: > >> -typedef int (*opal_step)(struct opal_dev *dev); >> +typedef struct opal_step { >> +int (*fn)(struct opal_dev *dev, void *data); >> +void *data; >>

Re: [PATCHv2 5/5] block/sed: Eliminate state variable

2017-02-18 Thread Christoph Hellwig
Looks fine: Reviewed-by: Christoph Hellwig But I would just fold it into the previous patch.

Re: [PATCHv2 4/5] block/sed: Embed function data into the function sequence

2017-02-18 Thread Christoph Hellwig
Hi Jon, I think this is a great cleanup! A few nitpicky comments below: > -typedef int (*opal_step)(struct opal_dev *dev); > +typedef struct opal_step { > + int (*fn)(struct opal_dev *dev, void *data); > + void *data; > +} opal_step; no typedefs for structure types, please. > +

Re: [PATCHv2 0/5] OPAL patche'd cont'd

2017-02-18 Thread Christoph Hellwig
On Fri, Feb 17, 2017 at 05:00:24PM -0700, Jon Derrick wrote: > v1->v2: > Moved misplaced code from 5/5 to 4/5 > > The first three in the series have been reviewed already but I wanted to > squash them with the next two since they haven't been pulled yet. Next time please carry the reviewed-by