From patchwork Mon Nov 6 18:14:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: SF Markus Elfring X-Patchwork-Id: 10044021 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 222DD603FF for ; Mon, 6 Nov 2017 18:14:54 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 176A629E00 for ; Mon, 6 Nov 2017 18:14:54 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 0A98529E2E; Mon, 6 Nov 2017 18:14:54 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=unavailable version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B825229E00 for ; Mon, 6 Nov 2017 18:14:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932870AbdKFSOm (ORCPT ); Mon, 6 Nov 2017 13:14:42 -0500 Received: from mout.web.de ([212.227.17.12]:49490 "EHLO mout.web.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753867AbdKFSOi (ORCPT ); Mon, 6 Nov 2017 13:14:38 -0500 Received: from [192.168.1.3] ([78.48.227.228]) by smtp.web.de (mrweb103 [213.165.67.124]) with ESMTPSA (Nemesis) id 0Lba35-1ewd462boB-00lC7B; Mon, 06 Nov 2017 19:14:26 +0100 Subject: [PATCH v2] video: atmel_lcdfb: Use unique error messages in atmel_lcdfb_of_init() To: linux-fbdev@vger.kernel.org, dri-devel@lists.freedesktop.org, Bartlomiej Zolnierkiewicz , Nicolas Ferre Cc: LKML , kernel-janitors@vger.kernel.org References: <2db677d2-ad4e-1f79-344b-dfa38ce948c9@users.sourceforge.net> <5477205e-2067-de4f-8736-71a2c9dc1653@microchip.com> <8d297cae-5dd1-d345-8d9d-9bf3ec32d4f8@users.sourceforge.net> <2d650d87-034c-d05b-b3aa-f689f25ab184@microchip.com> From: SF Markus Elfring Message-ID: Date: Mon, 6 Nov 2017 19:14:22 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 MIME-Version: 1.0 In-Reply-To: <2d650d87-034c-d05b-b3aa-f689f25ab184@microchip.com> Content-Language: en-GB X-Provags-ID: V03:K0:PaTHnIm+IsdYEt0pbSTRPE6LOqE+AudM/ou+TEBjNx6SnV3/kQy E5ofp39Pfc+TVCLlU7sMMTtukONxhe2KcdUT81cKsAw0WYGltZ3qGSuNaIf6pQXY/Tza9ty Ujo4u5XTrEKibj7WVOjcStxcXDdl97b/8fc9gTgKOU1Q2RPEbOe0+7/mr+Gzo+6qOR+2HHV B9hIlrlYareRrvVKWr1oA== X-UI-Out-Filterresults: notjunk:1; V01:K0:u2WGr7t43yM=:uG4bt0JVGq4SLv6zMo0yQN WXZppwYxKvph18Yv27HdIrKJYsaOQ6XA0pPED6dZpCREHCg51jUJkjDfepislAtKaGF6CZgYi 5xdZaCK64J0rmRN5e7URXjzpRStw2CMfUDyHDwTM1YMJfUhco3Q/RT0ADVCjW4/OL7w7R4PXN QIY4dqzx6VEtPRh941A12D2lrkWVHiBDQQRktngz6JIeG1XYtidgIKA0GmVhZYNf+PB+RjuAh 8QgHnq0cVn4MaD5CnDclkulQ4IugjBP0rty4rnuWWjufn1WKlleF0hnleOj5I+bEBFnyyaAxj WKoi9eaX86ohc3PjUnYrx7wbs4J6kKhHiJbE0D3PsPIEch0sAfJPNbtBLf0ErTnUo8Apzox1A Lu+YJwTc8+uTdoveGoBhyBSn62DU7SFR4xHnAV7t6zO2LLY8/yAWMj2hg+Kt6ANhs/PMcicXi eRh8MGQySLO0JpXjtZFqCWWmHD028ZB/4yGwIrpcOn/PAyA0d66eXFALkGfObMOZmoslvWolz tYKaH1Bum7SuEmGZ+MeCydI7N4FXPja/xrT+nF9JldiiEF6rQZUNVrMVCo0ejTPi2p5xCEXpY TCZqzWgd3gPpSSemoSmN3IB5BHZL8huHw3kIcoH9wFd/09VGB/1aRW16SgkYnvp/mlaHXO4S0 aWsEudzx+5yC3KNbF2CWnlw+UDLr3lc8Mxe0xbyytEGdrMzlxscxRtVG9AE3KY8KshstkdZKl ShKz+Uf9En9LrhSB+KRXWe1/8LSSIBWgIV76AyWMWrjhDTrSoOYgJh2qyRZULePf5nIc7/F9r KqOztLr/4H/GZEJvImrR42I9euXorNqDiT1BRDi4B2ZikAEx7s= Sender: linux-fbdev-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-fbdev@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Markus Elfring Date: Mon, 6 Nov 2017 19:00:58 +0100 A duplicate error message was used so far in this function implementation. Thus use a consistent message format instead together with property names where constant merging can be applied by the compiler in four cases. This issue was detected by using the Coccinelle software. This software update supersedes the suggestion "video: atmel_lcdfb: Use common error handling code in atmel_lcdfb_of_init()" from 2017-11-05. https://patchwork.kernel.org/patch/10042131/ Fixes: b985172b328abc6de495a87ab998b267c5a09c16 ("video: atmel_lcdfb: add device tree suport") Signed-off-by: Markus Elfring --- drivers/video/fbdev/atmel_lcdfb.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/drivers/video/fbdev/atmel_lcdfb.c b/drivers/video/fbdev/atmel_lcdfb.c index e06358da4b99..44146aec3596 100644 --- a/drivers/video/fbdev/atmel_lcdfb.c +++ b/drivers/video/fbdev/atmel_lcdfb.c @@ -1021,6 +1021,8 @@ static void atmel_lcdfb_power_control_gpio(struct atmel_lcdfb_pdata *pdata, int gpio_set_value(og->gpio, on); } +static char const property_failure[] = "failed to get property %s\n"; + static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) { struct fb_info *info = sinfo->info; @@ -1048,25 +1050,25 @@ static int atmel_lcdfb_of_init(struct atmel_lcdfb_info *sinfo) ret = of_property_read_u32(display_np, "bits-per-pixel", &var->bits_per_pixel); if (ret < 0) { - dev_err(dev, "failed to get property bits-per-pixel\n"); + dev_err(dev, property_failure, "bits-per-pixel"); goto put_display_node; } ret = of_property_read_u32(display_np, "atmel,guard-time", &pdata->guard_time); if (ret < 0) { - dev_err(dev, "failed to get property atmel,guard-time\n"); + dev_err(dev, property_failure, "atmel,guard-time"); goto put_display_node; } ret = of_property_read_u32(display_np, "atmel,lcdcon2", &pdata->default_lcdcon2); if (ret < 0) { - dev_err(dev, "failed to get property atmel,lcdcon2\n"); + dev_err(dev, property_failure, "atmel,lcdcon2"); goto put_display_node; } ret = of_property_read_u32(display_np, "atmel,dmacon", &pdata->default_dmacon); if (ret < 0) { - dev_err(dev, "failed to get property bits-per-pixel\n"); + dev_err(dev, property_failure, "atmel,dmacon"); goto put_display_node; }