public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Greg KH <greg@kroah.com>
To: Akira Shimahara <akira215corp@gmail.com>
Cc: zbr@ioremap.net, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v4 1/9] w1_therm: creating w1_therm.h
Date: Tue, 5 May 2020 16:48:11 +0200	[thread overview]
Message-ID: <20200505144811.GD838641@kroah.com> (raw)
In-Reply-To: <20200429225915.198956-1-akira215corp@gmail.com>

On Thu, Apr 30, 2020 at 12:59:15AM +0200, Akira Shimahara wrote:
> Creating w1_therm.h header to organize code. Organize the w1_therm.c file
> to gather hardware functions, device specific functions, interface
> functions and sysfs functions.
> 
> Signed-off-by: Akira Shimahara <akira215corp@gmail.com>
> ---
>  drivers/w1/slaves/w1_therm.c | 302 +++++++++++++++--------------------
>  drivers/w1/slaves/w1_therm.h | 138 ++++++++++++++++
>  2 files changed, 269 insertions(+), 171 deletions(-)
>  create mode 100644 drivers/w1/slaves/w1_therm.h

Wait, why is a .h file needed for just a single .c file?


<snip>

>  static ssize_t read_therm(struct device *device,


> +/** read_therm()
> + * @param sl pointer to the slave to read
> + * @param info pointer to a structure to store the read results
> + * @return 0 if success, -kernel error code otherwise
> + */
> +static ssize_t read_therm(struct device *device,
> +			struct w1_slave *sl, struct therm_info *info);
> +

Why is this function needed to be declared in this .h file?

Why is any of this needed?  For some reason I thought you needed a .h
file to make things simpler for other .c files, but if all of this is
static, it's not needed at all, right?

thanks,

greg k-h

  reply	other threads:[~2020-05-05 14:48 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-04-29 22:59 [PATCH v4 1/9] w1_therm: creating w1_therm.h Akira Shimahara
2020-05-05 14:48 ` Greg KH [this message]
2020-05-05 21:04   ` Akira shimahara
2020-05-06  6:51     ` Greg KH
2020-05-06 10:43       ` Akira shimahara

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=20200505144811.GD838641@kroah.com \
    --to=greg@kroah.com \
    --cc=akira215corp@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=zbr@ioremap.net \
    /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