All of lore.kernel.org
 help / color / mirror / Atom feed
From: jim.cromie@gmail.com (Jim Cromie)
To: lm-sensors@vger.kernel.org
Subject: [lm-sensors] [patch] hwmon: w83781d - check return code of
Date: Fri, 22 Sep 2006 04:31:16 +0000	[thread overview]
Message-ID: <45136714.3010504@gmail.com> (raw)
In-Reply-To: <44F70D89.30409@gmail.com>


Add 2 attr-file groups (for base and model-specific attrs respectively),
create the base group with single call to sysfs_create_group,
check the return code on individual calls to device_create_file for each
of the model-specific attr-files.

Signed-off-by:  Jim Cromie <jim.cromie at gmail.com>

---

This is compile-tested only, needs validation on hardware, or
very thorough inspection.

diffstat hwmon-unchecked-return-status-fixes-w83781d.patch
 w83781d.c |  292 
++++++++++++++++++++++++++++++++------------------------------
 1 files changed, 155 insertions(+), 137 deletions(-)

> Can you please get rid of all these macros while you're here? I didn't
> like them much before, but now it's even worse as they are never
> functions not constants but random code exerpts, which is quite
> misleading and could cause a lot of confusion later. This would also
> let you return the error values properly.
>
>   

theyre gone. (the file_<foo> macros)

There are several distasteful macro-function-decl-expansions still there :

show_in_reg(in);
show_in_reg(in_min);
show_in_reg(in_max);

store_in_reg(MIN, min);
store_in_reg(MAX, max);

and also a compound one:  This one in particular is crying for a 
2D-callback implementation.
Ill do it (its my axe, Ill grind it some more ;-), IFF you find a tester 
for it.
Anyway, thats not for 19.

#define sysfs_in_offsets(offset) \
sysfs_in_offset(offset); \
sysfs_in_reg_offset(min, offset); \
sysfs_in_reg_offset(max, offset);

sysfs_in_offsets(0);
sysfs_in_offsets(1);
sysfs_in_offsets(2);
sysfs_in_offsets(3);
sysfs_in_offsets(4);
sysfs_in_offsets(5);
sysfs_in_offsets(6);
sysfs_in_offsets(7);
sysfs_in_offsets(8);



These all addressed :
> No blank line here please.
>
>   
> Nor here.
>
>   
> And no comma here.
>   
>
> Mark and I went for _group_opt and _attributes_opt suffixes. It's of
> course arbitrary, but maybe you can do the same for consistency?
>   

> This should be inside the if (data) conditional - subclients have no
> sysfs files.
>
>   
>
> Care to respin a patch? I'd like to have all these fixes in -mm soon.
>
> Thanks,
>   

-------------- next part --------------
A non-text attachment was scrubbed...
Name: hwmon-unchecked-return-status-fixes-w83781d.patch
Type: text/x-patch
Size: 15978 bytes
Desc: not available
Url : http://lists.lm-sensors.org/pipermail/lm-sensors/attachments/20060921/4f41ee3c/attachment-0001.bin 

  parent reply	other threads:[~2006-09-22  4:31 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-31 16:25 [lm-sensors] [patch] hwmon: w83781d - check return code of Jim Cromie
2006-09-21  8:54 ` Jean Delvare
2006-09-22  4:31 ` Jim Cromie [this message]
2006-09-22  7:50 ` Jean Delvare
2006-09-22 22:25 ` Jim Cromie
2006-09-23  8:15 ` Jean Delvare

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=45136714.3010504@gmail.com \
    --to=jim.cromie@gmail.com \
    --cc=lm-sensors@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.