Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp7185536imu; Tue, 22 Jan 2019 01:40:48 -0800 (PST) X-Google-Smtp-Source: ALg8bN4OQBMOEUXSXZ3ZvVdxYsuyPoetLgFuNOSdk88Oqt+YFQL9vYqKvGnXJsuhZuTS69kQsozl X-Received: by 2002:a17:902:680f:: with SMTP id h15mr33018490plk.40.1548150048194; Tue, 22 Jan 2019 01:40:48 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548150048; cv=none; d=google.com; s=arc-20160816; b=oEav2A+afGSYNdQjWC4kSA1ithVEHIn/vDhnU2EFjrxWuPVVEwlQtbY41THnkK34wE BQVZcgNsz9/rpLBJYhljGQ9QUhHrcrBBdfgmrcGG+rDgF4sYbxLv4eWd+R+eA5G/RrCB V53RuXwg/RE65jRITXt8W/FAWm9Af6lNtcX/LdGLKJRPpVWUb4m2FLRhb7gbfX2T1GAi 8KkVOFRAQvDdjm1cyZGBw1s/S2M/h6cuNo9lplyPQouMLpBWRBuDJ+4zlCHdwUDSt2Mo cUxFzGNPWxHOYqZGEKvexH1CBe5EAWZtWqo63jzmusw91g89yVdtdSxCHg6qbd7XtmhV BIqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date:dkim-signature; bh=v/JuN4zcQdKiKmDq345EPEGe4wtZ8GQCvxMRje8S4tI=; b=fpwBmwoAOzSeGzMVFUV6P1OzTocEsJF4/2SDLPDtyfh9SOHn9EqqhNvq2nscnxQx4+ /+wZPfZqaO3ImoamzyBPlMSEyXkOwAekMIcoDDDGmSbBiWuB7pkhhxoGJL7z2AO8/52v ndDvbvCO0XdtCn5hb3UJTXOEYfZ7UiMberMf3l5tZZiw7KdbQWcgEmLlmYGMGzhivh1v xX4v3YcaFnjAfuL3Zonrh51gPZZw6guwY2ccXmITGW1OHYUeoWYi7j1OiHLIlSOXFkSp KGZ9n1wCHQ/yriTB4g0sLU08vUcZGBnQVnW0MY0kzCpGPzQzu858m461Dh+LRbPcWeIW /StQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HSFLPz6T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id m7si15255553pgi.547.2019.01.22.01.40.32; Tue, 22 Jan 2019 01:40:48 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=HSFLPz6T; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727967AbfAVJhg (ORCPT + 99 others); Tue, 22 Jan 2019 04:37:36 -0500 Received: from mail.kernel.org ([198.145.29.99]:57828 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727026AbfAVJhf (ORCPT ); Tue, 22 Jan 2019 04:37:35 -0500 Received: from localhost (5356596B.cm-6-7b.dynamic.ziggo.nl [83.86.89.107]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D15F218D0; Tue, 22 Jan 2019 09:37:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1548149854; bh=GUpWqifi+ww1FYhpfmzC6BDAzq5GQ2f5hA18yaMz1LQ=; h=Date:From:To:Cc:Subject:References:In-Reply-To:From; b=HSFLPz6TSCJu0Sbbxg7+0U+bjL2XKVdDcI8wNn6kEXOH/mJyAKZiC8j0rBHD904Fi 3/EZsdRba/iJU0tya97KAZd9P5kWIyyaK6lzAOirXiup9yzXvXpIyPM+o1tN2qSYj1 RvI4+kTZRm3f/Kyf9VyLC+qM5+JQD51qRFqntAF4= Date: Tue, 22 Jan 2019 10:37:32 +0100 From: Greg KH To: Peng Hao Cc: arnd@arndb.de, andy.shevchenko@gmail.com, linux-kernel@vger.kernel.org Subject: Re: [PATCH 2/6] misc/pvpanic: Add pvpanic driver framework Message-ID: <20190122093732.GA29657@kroah.com> References: <1548098711-52497-1-git-send-email-peng.hao2@zte.com.cn> <1548098711-52497-2-git-send-email-peng.hao2@zte.com.cn> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1548098711-52497-2-git-send-email-peng.hao2@zte.com.cn> User-Agent: Mutt/1.11.2 (2019-01-07) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Jan 22, 2019 at 03:25:07AM +0800, Peng Hao wrote: > Add pvpanic driver framework. > You need a lot more description of what you did here than this, as I can not understand from this text, what the patch does, or more importantly, why it is doing this, at all. > Signed-off-by: Peng Hao > --- > drivers/misc/pvpanic/pvpanic.c | 171 ++++++++++------------------------------- > 1 file changed, 39 insertions(+), 132 deletions(-) > > diff --git a/drivers/misc/pvpanic/pvpanic.c b/drivers/misc/pvpanic/pvpanic.c > index 595ac06..6380540 100644 > --- a/drivers/misc/pvpanic/pvpanic.c > +++ b/drivers/misc/pvpanic/pvpanic.c > @@ -8,15 +8,20 @@ > > #define pr_fmt(fmt) KBUILD_MODNAME ": " fmt > > -#include > +#include > #include > #include > -#include > -#include > #include > #include > > -static void __iomem *base; > +static struct { > + struct platform_device *pdev; > + void __iomem *base; > + bool is_ioport; > +} pvpanic_data = { > + .pdev = NULL, > + .is_ioport = false, You do not need to initialize variables to 0 specifically like this. > +}; > > #define PVPANIC_PANICKED (1 << 0) > > @@ -27,7 +32,7 @@ > static void > pvpanic_send_event(unsigned int event) > { > - iowrite8(event, base); > + iowrite8(event, pvpanic_data.base); Why did you convert a single global variable into a single global structure? Why not, if you really need to pass this value around, do that at the same time as you will end up touching these same functions again, right? thanks, greg k-h