From mboxrd@z Thu Jan 1 00:00:00 1970 From: Fabian Frederick Date: Wed, 17 Sep 2014 19:00:14 +0000 Subject: [PATCH 1/6] video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info Message-Id: <1410980419-5326-2-git-send-email-fabf@skynet.be> List-Id: References: <1410980419-5326-1-git-send-email-fabf@skynet.be> In-Reply-To: <1410980419-5326-1-git-send-email-fabf@skynet.be> MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: linux-kernel@vger.kernel.org Cc: daniel.vetter@intel.com, Fabian Frederick , "James E.J. Bottomley" , Helge Deller , Jean-Christophe Plagniol-Villard , Tomi Valkeinen , linux-parisc@vger.kernel.org, linux-fbdev@vger.kernel.org Use container_of instead of casting first structure member. Signed-off-by: Fabian Frederick --- 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