From: Fabian Frederick <fabf@skynet.be>
To: linux-kernel@vger.kernel.org
Cc: daniel.vetter@intel.com, Fabian Frederick <fabf@skynet.be>,
"James E.J. Bottomley" <jejb@parisc-linux.org>,
Helge Deller <deller@gmx.de>,
Jean-Christophe Plagniol-Villard <plagnioj@jcrosoft.com>,
Tomi Valkeinen <tomi.valkeinen@ti.com>,
linux-parisc@vger.kernel.org, linux-fbdev@vger.kernel.org
Subject: [PATCH 1/6] video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info
Date: Wed, 17 Sep 2014 19:00:14 +0000 [thread overview]
Message-ID: <1410980419-5326-2-git-send-email-fabf@skynet.be> (raw)
In-Reply-To: <1410980419-5326-1-git-send-email-fabf@skynet.be>
Use container_of instead of casting first structure member.
Signed-off-by: Fabian Frederick <fabf@skynet.be>
---
PARISC cross-compiled but untested.
drivers/video/fbdev/stifb.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/video/fbdev/stifb.c b/drivers/video/fbdev/stifb.c
index cfe8a2f..86621fa 100644
--- a/drivers/video/fbdev/stifb.c
+++ b/drivers/video/fbdev/stifb.c
@@ -918,7 +918,7 @@ static int
stifb_setcolreg(u_int regno, u_int red, u_int green,
u_int blue, u_int transp, struct fb_info *info)
{
- struct stifb_info *fb = (struct stifb_info *) info;
+ struct stifb_info *fb = container_of(info, struct stifb_info, info);
u32 color;
if (regno >= NR_PALETTE)
@@ -978,7 +978,7 @@ stifb_setcolreg(u_int regno, u_int red, u_int green,
static int
stifb_blank(int blank_mode, struct fb_info *info)
{
- struct stifb_info *fb = (struct stifb_info *) info;
+ struct stifb_info *fb = container_of(info, struct stifb_info, info);
int enable = (blank_mode = 0) ? ENABLE : DISABLE;
switch (fb->id) {
--
2.1.0
next prev parent reply other threads:[~2014-09-17 19:00 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-09-17 19:00 [PATCH 0/6] video: fbdev: use container_of where possible Fabian Frederick
2014-09-17 19:00 ` Fabian Frederick [this message]
2014-09-30 10:08 ` [PATCH 1/6] video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info Tomi Valkeinen
2014-09-17 19:00 ` [PATCH 2/6] video: fbdev: sa1100fb.c: use container_of to resolve sa1100fb_info " Fabian Frederick
2014-09-17 19:00 ` [PATCH 3/6] video: fbdev: controlfb.c: use container_of to resolve fb_info_control " Fabian Frederick
2014-09-17 19:00 ` [PATCH 4/6] video: fbdev: cyber2000fb.c: use container_of to resolve cfb_info " Fabian Frederick
2014-09-17 19:00 ` [PATCH 5/6] video: fbdev: pxafb.c: use container_of to resolve pxafb_info/layer " Fabian Frederick
2014-09-17 19:00 ` [PATCH 6/6] video: fbdev: valkyriefb.c: use container_of to resolve fb_info_valkyrie " Fabian Frederick
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=1410980419-5326-2-git-send-email-fabf@skynet.be \
--to=fabf@skynet.be \
--cc=daniel.vetter@intel.com \
--cc=deller@gmx.de \
--cc=jejb@parisc-linux.org \
--cc=linux-fbdev@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=plagnioj@jcrosoft.com \
--cc=tomi.valkeinen@ti.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;
as well as URLs for NNTP newsgroup(s).