lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Wed, 1 Sep 2010 14:08:32 +0900
From:	"Masayuki Ohtake" <masa-korg@....okisemi.com>
To:	"Joe Perches" <joe@...ches.com>
Cc:	"Jean Delvare \(PC drivers, core\)" <khali@...ux-fr.org>,
	"Ben Dooks \(embedded platforms\)" <ben-linux@...ff.org>,
	"Crane Cai" <crane.cai@....com>,
	"Samuel Ortiz" <sameo@...ux.intel.com>,
	"Linus Walleij" <linus.walleij@...ricsson.com>,
	"Ralf Baechle" <ralf@...ux-mips.org>,
	"srinidhi kasagar" <srinidhi.kasagar@...ricsson.com>,
	<linux-i2c@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
	"Wang Yong Y\"" <yong.y.wang@...el.com>,
	"Wang Qi\"" <qi.wang@...el.com>,
	"Andrew\"" <andrew.chih.howe.khor@...el.com>,
	<arjan@...ux.intel.com>,
	"Tomoya MORINAGA" <morinaga526@....okisemi.com>,
	"Arnd Bergmann" <arnd@...db.de>
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_I2C driver to 2.6.35

Hi Joe,

I have a question.
Current our I2C driver  has the following 2 patterns dev_err().

(1) dev_err(adap->pch_adapter.dev.parent, "...");

(2) dev_err(&pdev->dev, "...");


> #define pch_err(adap, fmt, arg...) \
> dev_err(adap->pch_adapter.dev.parent, fmt, ##arg)

In case of using the above code, pattern (1) can apply, but (2) can't.

As to (2),
Should we use as dev_err or define another macro?

Thanks, Ohtake(OKISemi)

----- Original Message ----- 
From: "Joe Perches" <joe@...ches.com>
To: "Masayuki Ohtak" <masa-korg@....okisemi.com>
Cc: "Jean Delvare (PC drivers, core)" <khali@...ux-fr.org>; "Ben Dooks (embedded platforms)" <ben-linux@...ff.org>;
"Crane Cai" <crane.cai@....com>; "Samuel Ortiz" <sameo@...ux.intel.com>; "Linus Walleij" <linus.walleij@...ricsson.com>;
"Ralf Baechle" <ralf@...ux-mips.org>; "srinidhi kasagar" <srinidhi.kasagar@...ricsson.com>; <linux-i2c@...r.kernel.org>;
<linux-kernel@...r.kernel.org>; "Wang Yong Y"" <yong.y.wang@...el.com>; "Wang Qi"" <qi.wang@...el.com>; "Andrew""
<andrew.chih.howe.khor@...el.com>; <arjan@...ux.intel.com>; "Tomoya MORINAGA" <morinaga526@....okisemi.com>; "Arnd
Bergmann" <arnd@...db.de>
Sent: Wednesday, September 01, 2010 11:43 AM
Subject: Re: [MeeGo-Dev][PATCH] Topcliff: Update PCH_I2C driver to 2.6.35


> On Wed, 2010-09-01 at 11:26 +0900, Masayuki Ohtak wrote:
> > I2C driver of Topcliff PCH
> > +++ b/drivers/i2c/busses/i2c-pch.c
> []
> > +static void pch_init(struct i2c_algo_pch_data *adap)
> []
> > + if (pch_i2c_speed == FAST_MODE_CLK) {
> > + reg_value |= FAST_MODE_EN;
> > + dev_dbg(adap->pch_adapter.dev.parent, "Fast mode enabled\n");
> > + }
>
> Just a suggestion below, ignore it at your pleasure...
>
> These dev_<level> calls might be easier to read if you had
> some #defines like:
>
> #define pch_dbg(adap, fmt, arg...) \
> dev_dbg(adap->pch_adapter.dev.parent, fmt, ##arg)
> #define pch_err(adap, fmt, arg...) \
> dev_err(adap->pch_adapter.dev.parent, fmt, ##arg)
> #define pch_info(adap, fmt, arg...) \
> dev_info(adap->pch_adapter.dev.parent, fmt, ##arg)
>
> then the last dev_dbg becomes:
>
> pch_dbg(adap, "Fast mode enabled\n");
>
> Many modules use similar wrapper #defines.
>
> > + dev_dbg(adap->pch_adapter.dev.parent,
> > + "%s: I2CCTL=%x pch_i2cbc=%x pch_i2ctmr=%x Enable interrupts\n",
> > + __func__, ioread32(p + PCH_I2CCTL),
> > + pch_i2cbc, pch_i2ctmr);
>
> pch_dbg(adap, etc...)
>
> etc.
>
> cheers, Joe
>


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists