mbox series

[0/4] libfc,fcoe: cleanup fc_rport_priv usage

Message ID 20190605073942.125577-1-hare@suse.de (mailing list archive)
Headers show
Series libfc,fcoe: cleanup fc_rport_priv usage | expand

Message

Hannes Reinecke June 5, 2019, 7:39 a.m. UTC
Hi all,

the fcoe vn2vn code is using the 'fc_rport_priv' structure as argument to its
internal function, but is really expecting a struct fcoe_rport to immediately
follow this one. This is not only confusing but also an error for new compilers.
So clean up the usage by embedding fc_rport_priv into fcoe_rport, and use the
fcoe_rport structure wherever possible.
This patchset also contains some minor cleanups to the libfc code, fixing
up whitespaces and dropping an unused callback.

As usual, comments and reviews are welcome.

Hannes Reinecke (4):
  libfc: kill lld_event_callback
  libfc: Whitespqce cleanup in libfc.h
  fcoe: avoid memset across pointer boundaries
  fcoe: pass in fcoe_rport structure instead of fc_rport_priv

 drivers/scsi/fcoe/fcoe_ctlr.c | 140 ++++++++++++++++++++----------------------
 drivers/scsi/libfc/fc_rport.c |  18 +++---
 include/scsi/libfc.h          |  55 ++++++++---------
 include/scsi/libfcoe.h        |   1 +
 4 files changed, 104 insertions(+), 110 deletions(-)

Comments

Linus Torvalds June 5, 2019, 4:55 p.m. UTC | #1
On Wed, Jun 5, 2019 at 12:39 AM Hannes Reinecke <hare@suse.de> wrote:
>
> the fcoe vn2vn code is using the 'fc_rport_priv' structure as argument to its
> internal function, but is really expecting a struct fcoe_rport to immediately
> follow this one. This is not only confusing but also an error for new compilers.
> So clean up the usage by embedding fc_rport_priv into fcoe_rport, and use the
> fcoe_rport structure wherever possible.

Thanks, this looks much better than what I tried to do mechanically
that turned into a complete mess.

But that's just from scanning the patches, obviously no deep review
(much less testing).

                        Linus