From patchwork Wed Sep 17 19:00:14 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Fabian Frederick X-Patchwork-Id: 4926211 Return-Path: X-Original-To: patchwork-linux-fbdev@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork1.web.kernel.org (Postfix) with ESMTP id BE2F89F2EC for ; Wed, 17 Sep 2014 19:02:32 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E76FE2011E for ; Wed, 17 Sep 2014 19:03:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id B2BA9200DC for ; Wed, 17 Sep 2014 19:03:43 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756805AbaIQTD3 (ORCPT ); Wed, 17 Sep 2014 15:03:29 -0400 Received: from mailrelay005.isp.belgacom.be ([195.238.6.171]:17035 "EHLO mailrelay005.isp.belgacom.be" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755802AbaIQTAu (ORCPT ); Wed, 17 Sep 2014 15:00:50 -0400 X-Belgacom-Dynamic: yes X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: AtgNAL/ZGVRXQCIg/2dsb2JhbABhgw22FQUBcAGbFwGBFhcBeYQEAQUnLyMQUTkeGYhCAb9nGIYJiW4HFoQ1BZ0MjDKJFoIbgUU7L4JKAQEB Received: from 32.34-64-87.adsl-dyn.isp.belgacom.be (HELO linux-zvq9.site) ([87.64.34.32]) by relay.skynet.be with ESMTP; 17 Sep 2014 21:00:48 +0200 From: Fabian Frederick 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 Subject: [PATCH 1/6] video: fbdev: stifb.c: use container_of to resolve stifb_info from fb_info Date: Wed, 17 Sep 2014 21:00:14 +0200 Message-Id: <1410980419-5326-2-git-send-email-fabf@skynet.be> X-Mailer: git-send-email 2.1.0 In-Reply-To: <1410980419-5326-1-git-send-email-fabf@skynet.be> References: <1410980419-5326-1-git-send-email-fabf@skynet.be> Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {