From: Finn Thain <fthain@linux-m68k.org>
To: Geert Uytterhoeven <geert@linux-m68k.org>
Cc: Stephen Rothwell <sfr@canb.auug.org.au>,
Muchun Song <songmuchun@bytedance.com>,
Christian Brauner <christian.brauner@ubuntu.com>,
Andrew Morton <akpm@linux-foundation.org>,
linux-m68k@lists.linux-m68k.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH -next] nubus: Rename pde_data var to fix conflict with external function
Date: Fri, 26 Nov 2021 08:50:00 +1100 (AEDT) [thread overview]
Message-ID: <9af12089-95d-dbf0-4e78-abe763ee333c@linux-m68k.org> (raw)
In-Reply-To: <20211125083808.82560-1-geert@linux-m68k.org>
[-- Attachment #1: Type: text/plain, Size: 3815 bytes --]
On Thu, 25 Nov 2021, Geert Uytterhoeven wrote:
> In file included from drivers/nubus/proc.c:24:
> drivers/nubus/proc.c: In function ‘nubus_proc_rsrc_show’:
> ./include/linux/proc_fs.h:123:21: error: called object ‘pde_data’ is not a function or function pointer
> 123 | #define PDE_DATA(i) pde_data(i)
> | ^~~~~~~~
> drivers/nubus/proc.c:112:13: note: in expansion of macro ‘PDE_DATA’
> 112 | pde_data = PDE_DATA(inode);
> | ^~~~~~~~
> drivers/nubus/proc.c:110:30: note: declared here
> 110 | struct nubus_proc_pde_data *pde_data;
> | ^~~~~~~~
>
> Fix this by renaming the local variable to "pde". Do this everywhere
> for consistency.
>
> Reported-by: noreply@ellerman.id.au
> Fixes: e7e935db128e724f ("fs: proc: store PDE()->data into inode->i_private")
> Signed-off-by: Geert Uytterhoeven <geert@linux-m68k.org>
Acked-by: Finn Thain <fthain@linux-m68k.org>
> ---
> Not fixed by commit 5de6353a96bec91d ("proc: remove PDE_DATA()
> completely"), which just removes the macro indirection.
> ---
> drivers/nubus/proc.c | 36 ++++++++++++++++++------------------
> 1 file changed, 18 insertions(+), 18 deletions(-)
>
> diff --git a/drivers/nubus/proc.c b/drivers/nubus/proc.c
> index 22fb11da519bfc43..aff1c5d257cd8183 100644
> --- a/drivers/nubus/proc.c
> +++ b/drivers/nubus/proc.c
> @@ -93,30 +93,30 @@ struct nubus_proc_pde_data {
> static struct nubus_proc_pde_data *
> nubus_proc_alloc_pde_data(unsigned char *ptr, unsigned int size)
> {
> - struct nubus_proc_pde_data *pde_data;
> + struct nubus_proc_pde_data *pde;
>
> - pde_data = kmalloc(sizeof(*pde_data), GFP_KERNEL);
> - if (!pde_data)
> + pde = kmalloc(sizeof(*pde), GFP_KERNEL);
> + if (!pde)
> return NULL;
>
> - pde_data->res_ptr = ptr;
> - pde_data->res_size = size;
> - return pde_data;
> + pde->res_ptr = ptr;
> + pde->res_size = size;
> + return pde;
> }
>
> static int nubus_proc_rsrc_show(struct seq_file *m, void *v)
> {
> struct inode *inode = m->private;
> - struct nubus_proc_pde_data *pde_data;
> + struct nubus_proc_pde_data *pde;
>
> - pde_data = pde_data(inode);
> - if (!pde_data)
> + pde = pde_data(inode);
> + if (!pde)
> return 0;
>
> - if (pde_data->res_size > m->size)
> + if (pde->res_size > m->size)
> return -EFBIG;
>
> - if (pde_data->res_size) {
> + if (pde->res_size) {
> int lanes = (int)proc_get_parent_data(inode);
> struct nubus_dirent ent;
>
> @@ -124,11 +124,11 @@ static int nubus_proc_rsrc_show(struct seq_file *m, void *v)
> return 0;
>
> ent.mask = lanes;
> - ent.base = pde_data->res_ptr;
> + ent.base = pde->res_ptr;
> ent.data = 0;
> - nubus_seq_write_rsrc_mem(m, &ent, pde_data->res_size);
> + nubus_seq_write_rsrc_mem(m, &ent, pde->res_size);
> } else {
> - unsigned int data = (unsigned int)pde_data->res_ptr;
> + unsigned int data = (unsigned int)pde->res_ptr;
>
> seq_putc(m, data >> 16);
> seq_putc(m, data >> 8);
> @@ -142,18 +142,18 @@ void nubus_proc_add_rsrc_mem(struct proc_dir_entry *procdir,
> unsigned int size)
> {
> char name[9];
> - struct nubus_proc_pde_data *pde_data;
> + struct nubus_proc_pde_data *pde;
>
> if (!procdir)
> return;
>
> snprintf(name, sizeof(name), "%x", ent->type);
> if (size)
> - pde_data = nubus_proc_alloc_pde_data(nubus_dirptr(ent), size);
> + pde = nubus_proc_alloc_pde_data(nubus_dirptr(ent), size);
> else
> - pde_data = NULL;
> + pde = NULL;
> proc_create_single_data(name, S_IFREG | 0444, procdir,
> - nubus_proc_rsrc_show, pde_data);
> + nubus_proc_rsrc_show, pde);
> }
>
> void nubus_proc_add_rsrc(struct proc_dir_entry *procdir,
>
next prev parent reply other threads:[~2021-11-25 21:52 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-25 8:38 [PATCH -next] nubus: Rename pde_data var to fix conflict with external function Geert Uytterhoeven
2021-11-25 10:40 ` Muchun Song
2021-11-25 21:50 ` Finn Thain [this message]
2021-11-25 22:41 ` Stephen Rothwell
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=9af12089-95d-dbf0-4e78-abe763ee333c@linux-m68k.org \
--to=fthain@linux-m68k.org \
--cc=akpm@linux-foundation.org \
--cc=christian.brauner@ubuntu.com \
--cc=geert@linux-m68k.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-m68k@lists.linux-m68k.org \
--cc=sfr@canb.auug.org.au \
--cc=songmuchun@bytedance.com \
/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