aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/w1
diff options
context:
space:
mode:
authorBen Werbowyj <ben.werbowyj@gmail.com>2016-07-22 00:33:35 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2016-08-31 07:56:04 -0400
commit368451ea748ce44cd4b879808735976eb2fded77 (patch)
tree3380b0c6539a4152037807bac96a87c67dd4eb94 /drivers/w1
parentaaf16f7d98fedb24099361492821fcdc77036eab (diff)
drivers: w1: style corrections-pointers-blanklines-comparisons
Correct pointer notations to include whitespace between variable type and "*" character. Inserted blank line after variable declatations at two locations. Rearranged comparison within an if statment to have the constant on the right-hand side. Signed-off-by: Ben Werbowyj <ben.werbowyj@gmail.com> Acked-by: Evgeniy Polyakov <zbr@ioremap.net> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/w1')
-rw-r--r--drivers/w1/slaves/w1_therm.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/w1/slaves/w1_therm.c b/drivers/w1/slaves/w1_therm.c
index 83a5036b990b..82611f197b0a 100644
--- a/drivers/w1/slaves/w1_therm.c
+++ b/drivers/w1/slaves/w1_therm.c
@@ -66,7 +66,7 @@ struct w1_therm_family_data {
66 66
67/* return the address of the refcnt in the family data */ 67/* return the address of the refcnt in the family data */
68#define THERM_REFCNT(family_data) \ 68#define THERM_REFCNT(family_data) \
69 (&((struct w1_therm_family_data*)family_data)->refcnt) 69 (&((struct w1_therm_family_data *)family_data)->refcnt)
70 70
71static int w1_therm_add_slave(struct w1_slave *sl) 71static int w1_therm_add_slave(struct w1_slave *sl)
72{ 72{
@@ -81,6 +81,7 @@ static int w1_therm_add_slave(struct w1_slave *sl)
81static void w1_therm_remove_slave(struct w1_slave *sl) 81static void w1_therm_remove_slave(struct w1_slave *sl)
82{ 82{
83 int refcnt = atomic_sub_return(1, THERM_REFCNT(sl->family_data)); 83 int refcnt = atomic_sub_return(1, THERM_REFCNT(sl->family_data));
84
84 while (refcnt) { 85 while (refcnt) {
85 msleep(1000); 86 msleep(1000);
86 refcnt = atomic_read(THERM_REFCNT(sl->family_data)); 87 refcnt = atomic_read(THERM_REFCNT(sl->family_data));
@@ -366,6 +367,7 @@ post_unlock:
366static inline int w1_DS18B20_convert_temp(u8 rom[9]) 367static inline int w1_DS18B20_convert_temp(u8 rom[9])
367{ 368{
368 s16 t = le16_to_cpup((__le16 *)rom); 369 s16 t = le16_to_cpup((__le16 *)rom);
370
369 return t*1000/16; 371 return t*1000/16;
370} 372}
371 373
@@ -415,7 +417,7 @@ static ssize_t w1_slave_store(struct device *device,
415 for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) { 417 for (i = 0; i < ARRAY_SIZE(w1_therm_families); ++i) {
416 if (w1_therm_families[i].f->fid == sl->family->fid) { 418 if (w1_therm_families[i].f->fid == sl->family->fid) {
417 /* zero value indicates to write current configuration to eeprom */ 419 /* zero value indicates to write current configuration to eeprom */
418 if (0 == val) 420 if (val == 0)
419 ret = w1_therm_families[i].eeprom(device); 421 ret = w1_therm_families[i].eeprom(device);
420 else 422 else
421 ret = w1_therm_families[i].precision(device, val); 423 ret = w1_therm_families[i].precision(device, val);