mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Guenter Roeck <guenter.roeck@ericsson.com>
To: Joe Perches <joe@perches.com>
Cc: Jean Delvare <khali@linux-fr.org>,
	Andrew Morton <akpm@linux-foundation.org>,
	Randy Dunlap <rdunlap@xenotime.net>,
	Hans de Goede <hdegoede@redhat.com>,
	Mark Brown <broonie@opensource.wolfsonmicro.com>,
	Samuel Ortiz <sameo@linux.intel.com>,
	"David S. Miller" <davem@davemloft.net>,
	Paul Goyette <paul@whooppee.com>,
	"lm-sensors@lm-sensors.org" <lm-sensors@lm-sensors.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"linux-i2c@vger.kernel.org" <linux-i2c@vger.kernel.org>
Subject: Re: [PATCH v2] hwmon: Add support for JEDEC JC 42.4 compliant temperature sensors
Date: Sun, 11 Jul 2010 09:16:58 -0700	[thread overview]
Message-ID: <20100711161658.GA23927@ericsson.com> (raw)
In-Reply-To: <1278862266.1501.59.camel@Joe-Laptop.home>

On Sun, Jul 11, 2010 at 11:31:06AM -0400, Joe Perches wrote:
> On Sun, 2010-07-11 at 07:53 -0700, Guenter Roeck wrote:
> > diff --git a/drivers/hwmon/jc42.c b/drivers/hwmon/jc42.c
> > new file mode 100644
> > index 0000000..685057d
> > --- /dev/null
> > +++ b/drivers/hwmon/jc42.c
> []
> > +struct jc42_chips {
> > +	u16 manid;
> > +	u16 devid;
> > +	u16 devid_mask;
> > +};
> > +
> > +static struct jc42_chips jc42_chips[] = {
> > +	{ ADT_MANID, ADT7408_DEVID, ADT7408_DEVID_MASK },
> > +	{ IDT_MANID, TS3000B3_DEVID, TS3000B3_DEVID_MASK },
> > +	{ MAX_MANID, MAX6604_DEVID, MAX6604_DEVID_MASK },
> > +	{ MCP_MANID, MCP98242_DEVID, MCP98242_DEVID_MASK },
> > +	{ MCP_MANID, MCP98243_DEVID, MCP98243_DEVID_MASK },
> > +	{ MCP_MANID, MCP9843_DEVID, MCP9843_DEVID_MASK },
> > +	{ NXP_MANID, SE97_DEVID, SE97_DEVID_MASK },
> > +	{ ONS_MANID, CAT6095_DEVID, CAT6095_DEVID_MASK },
> > +	{ NXP_MANID, SE98_DEVID, SE98_DEVID_MASK },
> > +	{ STM_MANID, STTS424_DEVID, STTS424_DEVID_MASK },
> > +	{ STM_MANID, STTS424E_DEVID, STTS424E_DEVID_MASK },
> > +};
> []
> > +	for (i = 0; i < ARRAY_SIZE(jc42_chips); i++) {
> > +		if (manid == jc42_chips[i].manid
> > +		    && (devid & jc42_chips[i].devid_mask) ==
> > +					    jc42_chips[i].devid) {
> > +			strlcpy(info->type, "jc42", I2C_NAME_SIZE);
> > +			return 0;
> > +		}
> > +	}
> 
> Decidedly trivial:
> 
> Kernel style seems to prefer having logical tests at
> end of line rather than start of line.
> 
Ok. Would be nice to have checkpatch.pl complain about it, though,
if it is a to-be-enforced rule.

> Maybe this bit would be more readable with a temporary:
> 
> 	for (i = 0; i < ARRAY_SIZE(jc42_chips); i++) {
> 		struct jc42_chips *chip = &jc42_chips[i];
> 		if (manid == chip->manid &&
> 		    (devid & chip->devid_mask) == chip->devid) {
> 			strlcpy(info->type, "jc42", I2C_NAME_SIZE);
> 			return 0;
> 		}
> 	}
> 
Agreed. I'll change that.

Thanks,
Guenter

  reply	other threads:[~2010-07-11 16:18 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-07-11 14:53 Guenter Roeck
2010-07-11 15:31 ` Joe Perches
2010-07-11 16:16   ` Guenter Roeck [this message]
2010-07-11 16:21     ` Jean Delvare
2010-07-11 18:57       ` [PATCH] scripts/checkpatch.pl: Add strict test of logical test continuations at beginning of line Joe Perches
2010-07-11 19:34         ` Jean Delvare
2010-07-11 19:52           ` Joe Perches
2010-07-11 21:15             ` Guenter Roeck
2010-07-12 22:49 ` [PATCH v2] hwmon: Add support for JEDEC JC 42.4 compliant temperature sensors Andrew Morton
2010-07-12 23:07   ` Guenter Roeck

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=20100711161658.GA23927@ericsson.com \
    --to=guenter.roeck@ericsson.com \
    --cc=akpm@linux-foundation.org \
    --cc=broonie@opensource.wolfsonmicro.com \
    --cc=davem@davemloft.net \
    --cc=hdegoede@redhat.com \
    --cc=joe@perches.com \
    --cc=khali@linux-fr.org \
    --cc=linux-i2c@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=lm-sensors@lm-sensors.org \
    --cc=paul@whooppee.com \
    --cc=rdunlap@xenotime.net \
    --cc=sameo@linux.intel.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

Powered by JetHome