lkml.org 
[lkml]   [2019]   [Feb]   [27]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRE: [PATCH 1/5] ocxl: Rename struct link to ocxl_link
Date
> -----Original Message-----
> From: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
> Sent: Wednesday, 27 February 2019 6:55 PM
> To: Alastair D'Silva <alastair@d-silva.org>; 'Alastair D'Silva'
> <alastair@au1.ibm.com>
> Cc: 'Greg Kurz' <groug@kaod.org>; 'Frederic Barrat'
> <fbarrat@linux.ibm.com>; 'Arnd Bergmann' <arnd@arndb.de>; 'Greg Kroah-
> Hartman' <gregkh@linuxfoundation.org>; linuxppc-dev@lists.ozlabs.org;
> linux-kernel@vger.kernel.org
> Subject: Re: [PATCH 1/5] ocxl: Rename struct link to ocxl_link
>
> On 27/2/19 6:34 pm, Alastair D'Silva wrote:>>> diff --git
> a/drivers/misc/ocxl/file.c b/drivers/misc/ocxl/file.c index
> >>> e6a607488f8a..16eb8a60d5c7 100644
> >>> --- a/drivers/misc/ocxl/file.c
> >>> +++ b/drivers/misc/ocxl/file.c
> >>> @@ -152,7 +152,7 @@ static long afu_ioctl_enable_p9_wait(struct
> >>> ocxl_context *ctx,
> >>>
> >>> if (status == ATTACHED) {
> >>> int rc;
> >>> - struct link *link = ctx->afu->fn->link;
> >>> + void *link = ctx->afu->fn->link;
> >>
> >> This doesn't look like a rename...
> >
> > That corrects the type to what the member (and prototype for
> ocxl_link_update_pe) declare it as.
> >
> > The struct link there is bogus, it shouldn't even compile (since the intended
> struct link is defined in a different compilation unit), but instead picks up a
> different definition of 'struct link' from elsewhere.
> >
>
> Given there's only a handful of struct links defined across the entire kernel,
> I'm going to guess that the definition it's picking up is in fact the ocxl one.
>

Unlikely, since that's never in a header. It wasn't caught since it was assigned to/from a void*.

> I think the better solution here is to move struct ocxl_link into
> ocxl_internal.h, change ocxl_fn::link to be struct ocxl_link * rather than void
> *, and update the function signature for ocxl_link_update_pe() as well.

Not move it, but we could have an opaque declaration there.

--
Alastair D'Silva mob: 0423 762 819
skype: alastair_dsilva msn: alastair@d-silva.org
blog: http://alastair.d-silva.org Twitter: @EvilDeece

\
 
 \ /
  Last update: 2019-02-27 09:05    [W:0.054 / U:11.152 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site