From patchwork Thu Dec 7 17:56:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Th=C3=A9o_Lebrun?= X-Patchwork-Id: 175316 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a59:bcd1:0:b0:403:3b70:6f57 with SMTP id r17csp4960257vqy; Thu, 7 Dec 2023 09:57:02 -0800 (PST) X-Google-Smtp-Source: AGHT+IGYeB7SWcljrVmYrYDQmja0d3f31XptryP7/FVtgBULiIrvw9Q5B13yjQ7HzGOSvgR2msVh X-Received: by 2002:a05:6a20:a1a6:b0:18c:4105:9aa8 with SMTP id r38-20020a056a20a1a600b0018c41059aa8mr2338024pzk.51.1701971822454; Thu, 07 Dec 2023 09:57:02 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1701971822; cv=none; d=google.com; s=arc-20160816; b=w0HRMY3opMHw1TQi3uz7dnt6F6uUJ7DA26X0/XU9bwa9BT/lVLsoepvz3hqqO2C+bv h9vEm+nKLp7nyMR0LZHtMI7jLsH+AeYlZ8sHcPAFBcuj/LuyzX7LtrT5xlx4ZNpHnM+B ex7Fw+UOvPnYE3N30x8jNPMm+I/u8SO2WZo1NRz9EF/7hg6czh0s8huCmthkWszUN2Dv KeLkhoGLSii5ZaomF7GWSC1ZeNu8dXi2qWkq67X1onFQ2vPM6M04PLl1oc6oeBTgP8aG f4FL3IA6b4+niXIZFlFDL8lr+XX1ub5R67CeJsSyNYMwGukABUcSbjQTC8/rSCy9GzSH 38ug== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:in-reply-to:references:message-id :content-transfer-encoding:mime-version:subject:date:from :dkim-signature; bh=EKaWxXFnkFdNP4OwlA33WSSIB/Rv3B+W2fl3gWTPZ5A=; fh=AHZzcI0NKFNU1WuuS/FWF2LprSMGsTAGL8gmMiTfjNU=; b=RZ1HjKUIEwF26PIthOtH5kJmGgs67HBIJE9zS0KN00fMzfqeWwEJQ9Z0GtH8jsHgf1 E7YEhlur18/Vg0jpn+DFyZpqt2gBy6EHABlnu4zqeNIJmP4fNbje876qfh7h5W8pwOFg ZydsFTmPNGkz+yTKyt439tl6ft5aaHbk2Npxad4sTb6X9wkgK0vbdHT929vRdUCM8eDX neKaRNeAa42m3CKxPJs2NRv9170lJhmBOIvSKywS0XMx7FuJLE2uEwlrpgR4/wQe3id2 95GbOb0//3V7hUG0YwFrN0QgNF0AfD7qv2/64OKjMfc6S0ZNLuUAIo/RamoDrNvMex0K mdXw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=crW83ABl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from howler.vger.email (howler.vger.email. [23.128.96.34]) by mx.google.com with ESMTPS id v7-20020a655687000000b005c6ac5b5fcfsi57342pgs.736.2023.12.07.09.57.02 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Dec 2023 09:57:02 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) client-ip=23.128.96.34; Authentication-Results: mx.google.com; dkim=pass header.i=@bootlin.com header.s=gm1 header.b=crW83ABl; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.34 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=bootlin.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by howler.vger.email (Postfix) with ESMTP id B5D708369F75; Thu, 7 Dec 2023 09:56:58 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at howler.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1443615AbjLGR4o (ORCPT + 99 others); Thu, 7 Dec 2023 12:56:44 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1443588AbjLGR43 (ORCPT ); Thu, 7 Dec 2023 12:56:29 -0500 Received: from relay4-d.mail.gandi.net (relay4-d.mail.gandi.net [217.70.183.196]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E2927170C; Thu, 7 Dec 2023 09:56:34 -0800 (PST) Received: by mail.gandi.net (Postfix) with ESMTPSA id 24D60E000A; Thu, 7 Dec 2023 17:56:32 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1701971793; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=EKaWxXFnkFdNP4OwlA33WSSIB/Rv3B+W2fl3gWTPZ5A=; b=crW83ABl0f6g1T10RMg5J9yHykIal3UgNmDFhlUnJjsKyuvTL5bZhiTZ8KcwhbwF1W0ls1 LbpKRStZqDYCyGKEIL8jJhGc9hovZcBGTActNJvvj3hUhTEKgDTCohDlAlJW8l5V0kEbPJ zTWyrz4GzshIdduUDInX5NjYqxmfGazA07TEUns86Q/SUoP8wjH2cTSyP30EhASr70zZT3 mtELkdvknyP9r3Tz2RQyowW2hlHjw+sVH6s7GFV85DBnYlYEihWOJ/0bXaugpUyEqToYPD IYGCUrFeCA3w/urqgszca30w04tSl4yz5ElIobGLSZXRxn9JBOvh9OrRwd5Hhw== From: =?utf-8?q?Th=C3=A9o_Lebrun?= Date: Thu, 07 Dec 2023 18:56:11 +0100 Subject: [PATCH v6 6/8] tty: serial: amba-pl011: fix miscellaneous checkpatch warnings MIME-Version: 1.0 Message-Id: <20231207-mbly-uart-v6-6-e384afa5e78c@bootlin.com> References: <20231207-mbly-uart-v6-0-e384afa5e78c@bootlin.com> In-Reply-To: <20231207-mbly-uart-v6-0-e384afa5e78c@bootlin.com> To: Russell King , Greg Kroah-Hartman , Jiri Slaby Cc: linux-kernel@vger.kernel.org, linux-serial@vger.kernel.org, Linus Walleij , =?utf-8?q?Gr=C3=A9gory_Clement?= , Alexandre Belloni , Thomas Petazzoni , Vladimir Kondratiev , Tawfik Bayouk , =?utf-8?q?Ilpo_J=C3=A4rvinen?= , =?utf-8?q?T?= =?utf-8?q?h=C3=A9o_Lebrun?= X-Mailer: b4 0.12.4 X-GND-Sasl: theo.lebrun@bootlin.com X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on howler.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (howler.vger.email [0.0.0.0]); Thu, 07 Dec 2023 09:56:58 -0800 (PST) X-getmail-retrieved-from-mailbox: INBOX X-GMAIL-THRID: 1784646805323455630 X-GMAIL-MSGID: 1784646805323455630 Fix the following messages from checkpatch: $ ./scripts/checkpatch.pl --strict --file \ drivers/tty/serial/amba-pl011.c ERROR: do not initialise statics to false WARNING: Possible unnecessary 'out of memory' message WARNING: Prefer 'unsigned int' to bare use of 'unsigned' WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ... then dev_info(dev, ... then pr_info(... to CHECK: Prefer using the BIT macro Reviewed-by: Linus Walleij Signed-off-by: Théo Lebrun --- drivers/tty/serial/amba-pl011.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/drivers/tty/serial/amba-pl011.c b/drivers/tty/serial/amba-pl011.c index 3c657bac2359..d141af8f8a5f 100644 --- a/drivers/tty/serial/amba-pl011.c +++ b/drivers/tty/serial/amba-pl011.c @@ -51,7 +51,7 @@ #define AMBA_ISR_PASS_LIMIT 256 #define UART_DR_ERROR (UART011_DR_OE | UART011_DR_BE | UART011_DR_PE | UART011_DR_FE) -#define UART_DUMMY_DR_RX (1 << 16) +#define UART_DUMMY_DR_RX BIT(16) enum { REG_DR, @@ -1109,7 +1109,6 @@ static void pl011_dma_startup(struct uart_amba_port *uap) uap->dmatx.buf = kmalloc(PL011_DMA_BUFFER_SIZE, GFP_KERNEL | __GFP_DMA); if (!uap->dmatx.buf) { - dev_err(uap->port.dev, "no memory for DMA TX buffer\n"); uap->port.fifosize = uap->fifosize; return; } @@ -2528,7 +2527,7 @@ static void qdf2400_e44_putc(struct uart_port *port, unsigned char c) cpu_relax(); } -static void qdf2400_e44_early_write(struct console *con, const char *s, unsigned n) +static void qdf2400_e44_early_write(struct console *con, const char *s, unsigned int n) { struct earlycon_device *dev = con->data; @@ -2547,7 +2546,7 @@ static void pl011_putc(struct uart_port *port, unsigned char c) cpu_relax(); } -static void pl011_early_write(struct console *con, const char *s, unsigned n) +static void pl011_early_write(struct console *con, const char *s, unsigned int n) { struct earlycon_device *dev = con->data; @@ -2653,8 +2652,8 @@ static struct uart_driver amba_reg = { static int pl011_probe_dt_alias(int index, struct device *dev) { struct device_node *np; - static bool seen_dev_with_alias = false; - static bool seen_dev_without_alias = false; + static bool seen_dev_with_alias; + static bool seen_dev_without_alias; int ret = index; if (!IS_ENABLED(CONFIG_OF)) @@ -2996,7 +2995,7 @@ static struct amba_driver pl011_driver = { static int __init pl011_init(void) { - printk(KERN_INFO "Serial: AMBA PL011 UART driver\n"); + pr_info("Serial: AMBA PL011 UART driver\n"); if (platform_driver_register(&arm_sbsa_uart_platform_driver)) pr_warn("could not register SBSA UART platform driver\n");