lkml.org 
[lkml]   [2020]   [May]   [5]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH v4 1/9] w1_therm: creating w1_therm.h
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

\
 
 \ /
  Last update: 2020-05-05 16:48    [W:0.040 / U:0.052 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site