From: Arnaud POULIQUEN <arnaud.pouliquen@foss.st.com>
To: Mathieu Poirier <mathieu.poirier@linaro.org>
Cc: Bjorn Andersson <bjorn.andersson@linaro.org>,
Ohad Ben-Cohen <ohad@wizery.com>,
<linux-remoteproc@vger.kernel.org>,
<linux-kernel@vger.kernel.org>,
<linux-stm32@st-md-mailman.stormreply.com>
Subject: Re: [PATCH] rpmsg: char: Remove useless includes
Date: Tue, 4 May 2021 09:16:10 +0200 [thread overview]
Message-ID: <b2f6b9ca-9dc2-920b-941d-175779bc1034@foss.st.com> (raw)
In-Reply-To: <20210503174238.GD1699665@xps15>
Hello Mathieu,
On 5/3/21 7:42 PM, Mathieu Poirier wrote:
> On Thu, Apr 29, 2021 at 10:06:39AM +0200, Arnaud Pouliquen wrote:
>> Remove includes that are not requested to build the module.
>>
>> Signed-off-by: Arnaud Pouliquen <arnaud.pouliquen@foss.st.com>
>> ---
>> applied without issue on Bjorn next branch (dc0e14fa833b)
>> ---
>> drivers/rpmsg/rpmsg_char.c | 9 ---------
>> 1 file changed, 9 deletions(-)
>>
>> diff --git a/drivers/rpmsg/rpmsg_char.c b/drivers/rpmsg/rpmsg_char.c
>> index 2bebc9b2d163..e4e54f515af6 100644
>> --- a/drivers/rpmsg/rpmsg_char.c
>> +++ b/drivers/rpmsg/rpmsg_char.c
>> @@ -10,19 +10,10 @@
>> * was based on TI & Google OMX rpmsg driver.
>> */
>> #include <linux/cdev.h>
>> -#include <linux/device.h>
>
> This is where the declaration for struct device is along with other goodies like
> get/put_device().
>
>> -#include <linux/fs.h>
>
> That is where struct file is declared.
>
>> -#include <linux/idr.h>
>
> This is where you get ida_simple_get() and ida_simple_remove() from.
>
>> #include <linux/kernel.h>
>> #include <linux/module.h>
>> -#include <linux/poll.h>
>
> This is where struct poll_table and poll_wait() comes from.
>
>> #include <linux/rpmsg.h>
>> #include <linux/skbuff.h>
>> -#include <linux/slab.h>
>
> This gives you kzalloc() and kfree().
>
>> -#include <linux/uaccess.h>
>
> This gives you copy_from_user().
>
>> -#include <uapi/linux/rpmsg.h>
>
> This gives you RPMSG_CREATE_EPT_IOCTL and RPMSG_DESTROY_EPT_IOCTL.
>
>> -
>> -#include "rpmsg_internal.h"
>
> That one I agree with.
I started by this one and then I got carried away tested the other include...
You are right, I just don't follow her the first rule of the "submit checklist"
"If you use a facility then #include the file that defines/declares that
facility. Don’t depend on other header files pulling in ones that you use."
That said I just have a doubt for uapi/linux/rpmsg.h that will be include
by rpmsg.h[2], as these includes are part of the rpmsg framework API, should we
keep both, considering the rule as strict?
[1] https://www.kernel.org/doc/html/latest/process/submit-checklist.html
[2]
https://patchwork.kernel.org/project/linux-remoteproc/patch/20210311140413.31725-3-arnaud.pouliquen@foss.st.com/
Thanks,
Arnaud
>
> Thanks,
> Mathieu
>
>>
>> #define RPMSG_DEV_MAX (MINORMASK + 1)
>>
>> --
>> 2.17.1
>>
next prev parent reply other threads:[~2021-05-04 7:16 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-04-29 8:06 Arnaud Pouliquen
2021-05-03 17:42 ` Mathieu Poirier
2021-05-04 7:16 ` Arnaud POULIQUEN [this message]
2021-05-04 17:05 ` Mathieu Poirier
2021-05-04 18:20 ` Arnaud POULIQUEN
2021-05-05 17:08 ` Mathieu Poirier
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=b2f6b9ca-9dc2-920b-941d-175779bc1034@foss.st.com \
--to=arnaud.pouliquen@foss.st.com \
--cc=bjorn.andersson@linaro.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-remoteproc@vger.kernel.org \
--cc=linux-stm32@st-md-mailman.stormreply.com \
--cc=mathieu.poirier@linaro.org \
--cc=ohad@wizery.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
all inboxes | Powered by JetHome®