Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp23781pxu; Tue, 24 Nov 2020 17:18:28 -0800 (PST) X-Google-Smtp-Source: ABdhPJywVIcI5W8fUd2TjDW0w5cmBx4QTxG8iWEaMRHcMItyt11ufDm9cMdZ3BJPafK7Vf7HmIcy X-Received: by 2002:a17:907:6ef:: with SMTP id yh15mr1051157ejb.506.1606267108482; Tue, 24 Nov 2020 17:18:28 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1606267108; cv=none; d=google.com; s=arc-20160816; b=WtYtL7LqcIlbBGnMz3TjhxG03xUWTrFby8tpvkSpH/ov+swxoGF9P2etWK+dj9VHqE LWuXi1zzYak+E0pTzZTp+uyvu83flOKd10Bm/aj/u/bidzoOV67QsNSfz+KXbWJaL6vF gU1N4Hqb8f4gvaqH3/4dcIBQRxw6MG3ni76LfuzqMVrM6XrIOKTj+ylAOOHL/3nmr0JS iO1fylys4HGbnW+P0ln7IrsZ7TLNXy3TEc79qzZHPnCwYbeas5pzUofmhMePi5y7s0Xd NLdSfL6pVgz4fP7+5v1N6htnObv0lbjp+QURdi6lMXGoRlo3diKJcN5uF3S02tYvJYU9 TnOQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:content-language :in-reply-to:mime-version:user-agent:date:message-id:from:references :cc:to:subject:dkim-signature; bh=qBzajxsOiw+apoE+OWjIlkXKzOH/jxlZ5BaJ29pSoJU=; b=pPj7XEziqWTWn5yHG8rtwuSXM5VIjZlJfaKpSkqLm/IzVRiWD8Pq6KocwSb02+EQAe auWCTAPwfnzTtYYsmeEEq8P0glAqgMZNiwXJXhnhawrL/d63BkGgMkMhC34J5PFEP/sF 7J8oBXYiZpUJKZ8uVJ+YXFdGrNfmw0hKG0t/3yGJbsl0J6fnxRzNpU7TgetNLsKg3U+R Aun+c0y0q2se70aKT3XcK7kXJeg+0Xd/8sV2IkPCC16AbOcUaFB9dJkAu8ryf3bjGvSu TcEhBvmr8OUH4R11vvNZ0jfoI0XUh2u2g83DrfOyNBuwqDcdkvabqvrfbrW+fsdamGus QFxw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@castello.eng.br header.s=default header.b=pzeK2ou7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id hb37si395723ejc.174.2020.11.24.17.18.06; Tue, 24 Nov 2020 17:18:28 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=fail header.i=@castello.eng.br header.s=default header.b=pzeK2ou7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728186AbgKYBPd (ORCPT + 99 others); Tue, 24 Nov 2020 20:15:33 -0500 Received: from gateway21.websitewelcome.com ([192.185.46.109]:44235 "EHLO gateway21.websitewelcome.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725320AbgKYBPc (ORCPT ); Tue, 24 Nov 2020 20:15:32 -0500 X-Greylist: delayed 1260 seconds by postgrey-1.27 at vger.kernel.org; Tue, 24 Nov 2020 20:15:31 EST Received: from cm16.websitewelcome.com (cm16.websitewelcome.com [100.42.49.19]) by gateway21.websitewelcome.com (Postfix) with ESMTP id A718C400C4BE0 for ; Tue, 24 Nov 2020 18:54:31 -0600 (CST) Received: from br164.hostgator.com.br ([192.185.176.180]) by cmsmtp with SMTP id hj4pkbLCufAtahj4pkSs83; Tue, 24 Nov 2020 18:54:31 -0600 X-Authority-Reason: nr=8 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=castello.eng.br; s=default; h=Content-Transfer-Encoding:Content-Type: In-Reply-To:MIME-Version:Date:Message-ID:From:References:Cc:To:Subject:Sender :Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=qBzajxsOiw+apoE+OWjIlkXKzOH/jxlZ5BaJ29pSoJU=; b=pzeK2ou7MYNp4+XCeflXDQ9mdE x11bMv4erI7ohJK8zpGpv3Y4QQk0Xrj46Vhhm+vFSNuzuo7lRNYAFi16dJLiyr3IRg+4rjitGnj8g Na4Y3boMEQOk8Azk4voFhsYVYf1WUV0Idzpueusp3fNqnxqfVGuSU8flNlZeketb0nXhwkcCfLZ7k LDN0M7a5UKnUFYKqOa+hNCc4JwbXXa2b8VonuS6KiS1noSXbnU5UlEVBfAPxBMsqESy1gSWsZa3Xd u8aTQhpMmmoZZ2t423ICsVjHWCLJ+6T7h3X/e1jy3lwM8Ydfu9eaDEySsyJFcy6ZY5T3cahDjyMjC Xz3nZ/7A==; Received: from 179-197-124-241.ultrabandalargafibra.com.br ([179.197.124.241]:58888 helo=[192.168.1.69]) by br164.hostgator.com.br with esmtpsa (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.93) (envelope-from ) id 1khj4p-002EPI-9C; Tue, 24 Nov 2020 21:54:31 -0300 Subject: Re: [PATCH 4/6] drivers: hv: vmbus: Fix checkpatch SPLIT_STRING To: Michael Kelley Cc: "sashal@kernel.org" , Tianyu Lan , Dexuan Cui , Sunil Muthuswamy , "linux-hyperv@vger.kernel.org" , "linux-kernel@vger.kernel.org" , KY Srinivasan , Haiyang Zhang , "wei.liu@kernel.org" , Stephen Hemminger References: <20201115195734.8338-1-matheus@castello.eng.br> <20201115195734.8338-5-matheus@castello.eng.br> From: Matheus Castello Message-ID: Date: Tue, 24 Nov 2020 21:54:29 -0300 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:78.0) Gecko/20100101 Thunderbird/78.4.3 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: pt-BR Content-Transfer-Encoding: 7bit X-AntiAbuse: This header was added to track abuse, please include it with any abuse report X-AntiAbuse: Primary Hostname - br164.hostgator.com.br X-AntiAbuse: Original Domain - vger.kernel.org X-AntiAbuse: Originator/Caller UID/GID - [47 12] / [47 12] X-AntiAbuse: Sender Address Domain - castello.eng.br X-BWhitelist: no X-Source-IP: 179.197.124.241 X-Source-L: No X-Exim-ID: 1khj4p-002EPI-9C X-Source: X-Source-Args: X-Source-Dir: X-Source-Sender: 179-197-124-241.ultrabandalargafibra.com.br ([192.168.1.69]) [179.197.124.241]:58888 X-Source-Auth: matheus@castello.eng.br X-Email-Count: 22 X-Source-Cap: Y2FzdGUyNDg7Y2FzdGUyNDg7YnIxNjQuaG9zdGdhdG9yLmNvbS5icg== X-Local-Domain: yes Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi Michael, Em 11/15/2020 7:25 PM, Michael Kelley escreveu: > From: Matheus Castello Sent: Sunday, November 15, 2020 11:58 AM >> >> Checkpatch emits WARNING: quoted string split across lines. >> To keep the code clean and with the 80 column length indentation the >> check and registration code for kmsg_dump_register has been transferred >> to a new function hv_kmsg_dump_register. >> >> Signed-off-by: Matheus Castello >> --- >> drivers/hv/vmbus_drv.c | 34 +++++++++++++++++++--------------- >> 1 file changed, 19 insertions(+), 15 deletions(-) >> >> diff --git a/drivers/hv/vmbus_drv.c b/drivers/hv/vmbus_drv.c >> index 61d28c743263..09d8236a51cf 100644 >> --- a/drivers/hv/vmbus_drv.c >> +++ b/drivers/hv/vmbus_drv.c >> @@ -1387,6 +1387,23 @@ static struct kmsg_dumper hv_kmsg_dumper = { >> .dump = hv_kmsg_dump, >> }; >> >> +static void hv_kmsg_dump_register(void) >> +{ >> + int ret; >> + >> + hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page(); >> + if (hv_panic_page) { >> + ret = kmsg_dump_register(&hv_kmsg_dumper); >> + if (ret) { >> + pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret); >> + hv_free_hyperv_page((unsigned long)hv_panic_page); >> + hv_panic_page = NULL; >> + } >> + } else { >> + pr_err("Hyper-V: panic message page memory allocation failed"); >> + } >> +} >> + > > The above would be marginally better if organized as follows so that the > main execution path isn't in an "if" clause. Also reduces indentation. > > hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page(); > if (!hv_panic_page) { > pr_err("Hyper-V: panic message page memory allocation failed"); > return; > } > ret = kmsg_dump_register(&hv_kmsg_dumper); > if (ret) { > pr_err("Hyper-V: kmsg dump register error 0x%x\n", ret); > hv_free_hyperv_page((unsigned long)hv_panic_page); > hv_panic_page = NULL; > } > > Thanks for the review, great I will use it on the v2. >> static struct ctl_table_header *hv_ctl_table_hdr; >> >> /* >> @@ -1477,21 +1494,8 @@ static int vmbus_bus_init(void) >> * capability is supported by the hypervisor. >> */ >> hv_get_crash_ctl(hyperv_crash_ctl); >> - if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) { >> - hv_panic_page = (void *)hv_alloc_hyperv_zeroed_page(); >> - if (hv_panic_page) { >> - ret = kmsg_dump_register(&hv_kmsg_dumper); >> - if (ret) { >> - pr_err("Hyper-V: kmsg dump register " >> - "error 0x%x\n", ret); >> - hv_free_hyperv_page( >> - (unsigned long)hv_panic_page); >> - hv_panic_page = NULL; >> - } >> - } else >> - pr_err("Hyper-V: panic message page memory " >> - "allocation failed"); >> - } >> + if (hyperv_crash_ctl & HV_CRASH_CTL_CRASH_NOTIFY_MSG) >> + hv_kmsg_dump_register(); >> >> register_die_notifier(&hyperv_die_block); >> } >> -- >> 2.28.0 >