From patchwork Tue Aug 8 08:10:25 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Michal Simek X-Patchwork-Id: 9886803 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 2F97260384 for ; Tue, 8 Aug 2017 08:11:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 1BB67287C7 for ; Tue, 8 Aug 2017 08:11:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0E080283F2; Tue, 8 Aug 2017 08:11:00 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_NONE autolearn=unavailable version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 67FED283F2 for ; Tue, 8 Aug 2017 08:10:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:Message-Id:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To: References:List-Owner; bh=KMusJo+JYBmgejUcP91Z2XpLccGzj7dAZAuo0JY9t7M=; b=svg 3YubhtEq3Xq/NzDFeMUAdueozmicNHFbMeewd4skjOhjgYemhT62tdcpfuKOWt5uboZHI5oPPbxOZ OddEM8i5nCPw9PZshUKNEraZtJJzi3IpZ6n+XN0bUuNnNQ3p/iH/zz6OCR/4NX3avqXsjBRbcol61 akX4F/C3Ysui636H2eF94Sic7Bvjh6/3wQ31OlI4C5kJ5V+4GJ6nnkyJNO0+KXY1P3Gt/5bKyr8tP htV46i5k4YVwPuRjmWYo9Vkw5twZ6eJtGt2D0Pxvm13V18SROV1lbAB/gU0cy3Pi5IUHTliubZMZD f6DA3HOYcZj4dt5fQvf5I662wkvHQRQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dezbO-0002uC-BH; Tue, 08 Aug 2017 08:10:58 +0000 Received: from mail-wr0-x243.google.com ([2a00:1450:400c:c0c::243]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dezbK-0002qg-ES for linux-arm-kernel@lists.infradead.org; Tue, 08 Aug 2017 08:10:56 +0000 Received: by mail-wr0-x243.google.com with SMTP id y43so1918543wrd.0 for ; Tue, 08 Aug 2017 01:10:32 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monstr-eu.20150623.gappssmtp.com; s=20150623; h=sender:from:to:cc:subject:date:message-id; bh=NbfkDjdncVd5KFqaq9MKkxEGa0+BtA30oYDhBOGFjFA=; b=MNCpkRs3b0RBA8cUbjCcskb0mRGCfK+M08CAKo3DxLuPpyMeP7bqYykMS0UfXL57FR 7pTS6vfnBC7x81CsA1nNoFdZbLA2J50UpJWE8M17F9A51mChXmhakd0R9Ac36ZESCHe1 8xMJ8usta8uQqbGQFMJlsn+Zih+D3D57l1PYB9Q6QYYW59/u946bkj7FW2Kwg+RTp9kv KGGGTqmd+pINHAmmHQWXNhSHidsciJoPvLdfVx6g7T45So5qlw1vRWQ5w4w5iZVjgiSg L4tziC+PPntljBAQUCeIABA0awBBWMqeSgz/FEfvJVJbNvojD1GqgaUKM4yYFZzYz1Ij 8EGA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id; bh=NbfkDjdncVd5KFqaq9MKkxEGa0+BtA30oYDhBOGFjFA=; b=cNeEikP+GvO4tGorEvPsSGrO3s7k82jnrZ9pj3LM8CqSOeUkiFqsHdRWfXu88x+/5K 2EHtKQEqvk7JLLHZnVjdb/IwgVqtJ/vjqSmrn3luTjtOuaCrgiKziR0N2+llsQaWocmD uwaSTAm6/mguZ0Qx864OesTb2yxV9PesY+Vn5bDGI4d0/2ulD7vUAniZh0Dcd+VaXZb+ z4ZlEakIWEYvO26KDKurXe5Ppx0Hk4IEuWRdS69tl02a42ImY1HRHvaCc0XDjvyT0AyG 2Yf8z8dT+La+rzce0zsgWGdJfcuy3kQKSsIRkGL9PIHPtngPE/4PGSw+aLAi1mY47MeE n7dQ== X-Gm-Message-State: AHYfb5gw2mVp/G0Wgi5HqXml1gj39IGZ9HWRe3Zw7n447c1jszI/6o6K 4VIxdNWyEu39DsHe X-Received: by 10.223.153.179 with SMTP id y48mr2207828wrb.168.1502179831334; Tue, 08 Aug 2017 01:10:31 -0700 (PDT) Received: from localhost (nat-35.starnet.cz. [178.255.168.35]) by smtp.gmail.com with ESMTPSA id g84sm577061wmf.30.2017.08.08.01.10.30 (version=TLS1_2 cipher=AES128-SHA bits=128/128); Tue, 08 Aug 2017 01:10:30 -0700 (PDT) From: Michal Simek To: linux-kernel@vger.kernel.org, monstr@monstr.eu Subject: [PATCH 1/2] video: fbdev: Fix multiple style issues in xilinxfb Date: Tue, 8 Aug 2017 10:10:25 +0200 Message-Id: X-Mailer: git-send-email 1.9.1 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170808_011054_826148_8E4B7EAC X-CRM114-Status: GOOD ( 18.56 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-arm-kernel@lists.infradead.org, linux-fbdev@vger.kernel.org, =?UTF-8?q?S=C3=B6ren=20Brinkmann?= , Hyun Kwon , Bartlomiej Zolnierkiewicz MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Hyun Kwon All reported by from checkpatch ./scripts/checkpatch.pl --max-line-length 120 -strict -f drivers/video/fbdev/xilinxfb.c WARNING: Block comments should align the * on each line WARNING: Block comments use a trailing */ on a separate line WARNING: Block comments use * on subsequent lines WARNING: please, no space before tabs WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: braces {} are not necessary for single statement blocks WARNING: Missing a blank line after declarations WARNING: struct of_device_id should normally be const CHECK: Please don't use multiple blank lines CHECK: Blank lines aren't necessary after an open brace '{' CHECK: Alignment should match open parenthesis CHECK: 'Endianess' may be misspelled - perhaps 'Endianness'? CHECK: spaces preferred around that '*' (ctx:VxV) ERROR: that open brace { should be on the previous line Signed-off-by: Hyun Kwon Signed-off-by: Michal Simek --- drivers/video/fbdev/xilinxfb.c | 56 +++++++++++++++++++++--------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/drivers/video/fbdev/xilinxfb.c b/drivers/video/fbdev/xilinxfb.c index 17dc119c7a98..0d828e46d704 100644 --- a/drivers/video/fbdev/xilinxfb.c +++ b/drivers/video/fbdev/xilinxfb.c @@ -41,7 +41,6 @@ #define DRIVER_NAME "xilinxfb" - /* * Xilinx calls it "TFT LCD Controller" though it can also be used for * the VGA port on the Xilinx ML40x board. This is a hardware display @@ -92,8 +91,9 @@ struct xilinxfb_platform_data { u32 xvirt, yvirt; /* resolution of memory buffer */ /* Physical address of framebuffer memory; If non-zero, driver - * will use provided memory address instead of allocating one from - * the consistent pool. */ + * will use provided memory address instead of allocating one from + * the consistent pool. + */ u32 fb_phys; }; @@ -128,18 +128,18 @@ struct xilinxfb_platform_data { .activate = FB_ACTIVATE_NOW }; - #define BUS_ACCESS_FLAG 0x1 /* 1 = BUS, 0 = DCR */ #define LITTLE_ENDIAN_ACCESS 0x2 /* LITTLE ENDIAN IO functions */ struct xilinxfb_drvdata { - struct fb_info info; /* FB driver info record */ phys_addr_t regs_phys; /* phys. address of the control - registers */ + * registers + */ void __iomem *regs; /* virt. address of the control - registers */ + * registers + */ #ifdef CONFIG_PPC_DCR dcr_host_t dcr_host; unsigned int dcr_len; @@ -148,7 +148,7 @@ struct xilinxfb_drvdata { dma_addr_t fb_phys; /* phys. address of the frame buffer */ int fb_alloced; /* Flag, was the fb memory alloced? */ - u8 flags; /* features of the driver */ + u8 flags; /* features of the driver */ u32 reg_ctrl_default; @@ -165,7 +165,7 @@ struct xilinxfb_drvdata { * which bus its connected and call the appropriate write API. */ static void xilinx_fb_out32(struct xilinxfb_drvdata *drvdata, u32 offset, - u32 val) + u32 val) { if (drvdata->flags & BUS_ACCESS_FLAG) { if (drvdata->flags & LITTLE_ENDIAN_ACCESS) @@ -195,8 +195,8 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset) } static int -xilinx_fb_setcolreg(unsigned regno, unsigned red, unsigned green, unsigned blue, - unsigned transp, struct fb_info *fbi) +xilinx_fb_setcolreg(unsigned int regno, unsigned int red, unsigned int green, + unsigned int blue, unsigned int transp, struct fb_info *fbi) { u32 *palette = fbi->pseudo_palette; @@ -205,9 +205,11 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset) if (fbi->var.grayscale) { /* Convert color to grayscale. - * grayscale = 0.30*R + 0.59*G + 0.11*B */ - red = green = blue = - (red * 77 + green * 151 + blue * 28 + 127) >> 8; + * grayscale = 0.30*R + 0.59*G + 0.11*B + */ + blue = (red * 77 + green * 151 + blue * 28 + 127) >> 8; + green = blue; + red = green; } /* fbi->fix.visual is always FB_VISUAL_TRUECOLOR */ @@ -241,13 +243,11 @@ static u32 xilinx_fb_in32(struct xilinxfb_drvdata *drvdata, u32 offset) xilinx_fb_out32(drvdata, REG_CTRL, 0); default: break; - } return 0; /* success */ } -static struct fb_ops xilinxfb_ops = -{ +static struct fb_ops xilinxfb_ops = { .owner = THIS_MODULE, .fb_setcolreg = xilinx_fb_setcolreg, .fb_blank = xilinx_fb_blank, @@ -286,7 +286,8 @@ static int xilinxfb_assign(struct platform_device *pdev, } else { drvdata->fb_alloced = 1; drvdata->fb_virt = dma_alloc_coherent(dev, PAGE_ALIGN(fbsize), - &drvdata->fb_phys, GFP_KERNEL); + &drvdata->fb_phys, + GFP_KERNEL); } if (!drvdata->fb_virt) { @@ -300,7 +301,7 @@ static int xilinxfb_assign(struct platform_device *pdev, /* Tell the hardware where the frame buffer is */ xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); rc = xilinx_fb_in32(drvdata, REG_FB_ADDR); - /* Endianess detection */ + /* Endianness detection */ if (rc != drvdata->fb_phys) { drvdata->flags |= LITTLE_ENDIAN_ACCESS; xilinx_fb_out32(drvdata, REG_FB_ADDR, drvdata->fb_phys); @@ -310,8 +311,7 @@ static int xilinxfb_assign(struct platform_device *pdev, drvdata->reg_ctrl_default = REG_CTRL_ENABLE; if (pdata->rotate_screen) drvdata->reg_ctrl_default |= REG_CTRL_ROTATE; - xilinx_fb_out32(drvdata, REG_CTRL, - drvdata->reg_ctrl_default); + xilinx_fb_out32(drvdata, REG_CTRL, drvdata->reg_ctrl_default); /* Fill struct fb_info */ drvdata->info.device = dev; @@ -364,7 +364,7 @@ static int xilinxfb_assign(struct platform_device *pdev, err_cmap: if (drvdata->fb_alloced) dma_free_coherent(dev, PAGE_ALIGN(fbsize), drvdata->fb_virt, - drvdata->fb_phys); + drvdata->fb_phys); else iounmap(drvdata->fb_virt); @@ -435,12 +435,12 @@ static int xilinxfb_of_probe(struct platform_device *pdev) * Fill the resource structure if its direct BUS interface * otherwise fill the dcr_host structure. */ - if (tft_access) { + if (tft_access) drvdata->flags |= BUS_ACCESS_FLAG; - } #ifdef CONFIG_PPC_DCR else { int start; + start = dcr_resource_start(pdev->dev.of_node, 0); drvdata->dcr_len = dcr_resource_len(pdev->dev.of_node, 0); drvdata->dcr_host = dcr_map(pdev->dev.of_node, start, drvdata->dcr_len); @@ -452,19 +452,19 @@ static int xilinxfb_of_probe(struct platform_device *pdev) #endif prop = of_get_property(pdev->dev.of_node, "phys-size", &size); - if ((prop) && (size >= sizeof(u32)*2)) { + if ((prop) && (size >= sizeof(u32) * 2)) { pdata.screen_width_mm = prop[0]; pdata.screen_height_mm = prop[1]; } prop = of_get_property(pdev->dev.of_node, "resolution", &size); - if ((prop) && (size >= sizeof(u32)*2)) { + if ((prop) && (size >= sizeof(u32) * 2)) { pdata.xres = prop[0]; pdata.yres = prop[1]; } prop = of_get_property(pdev->dev.of_node, "virtual-resolution", &size); - if ((prop) && (size >= sizeof(u32)*2)) { + if ((prop) && (size >= sizeof(u32) * 2)) { pdata.xvirt = prop[0]; pdata.yvirt = prop[1]; } @@ -482,7 +482,7 @@ static int xilinxfb_of_remove(struct platform_device *op) } /* Match table for of_platform binding */ -static struct of_device_id xilinxfb_of_match[] = { +static const struct of_device_id xilinxfb_of_match[] = { { .compatible = "xlnx,xps-tft-1.00.a", }, { .compatible = "xlnx,xps-tft-2.00.a", }, { .compatible = "xlnx,xps-tft-2.01.a", },