Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932788AbbFJJo7 (ORCPT ); Wed, 10 Jun 2015 05:44:59 -0400 Received: from mga09.intel.com ([134.134.136.24]:12084 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751318AbbFJJox (ORCPT ); Wed, 10 Jun 2015 05:44:53 -0400 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.13,586,1427785200"; d="scan'208";a="740692382" Message-ID: <1433929488.26331.117.camel@linux.intel.com> Subject: Re: [PATCH v11 4/5] x86/earlyprintk: setup earlyprintk as early as possible From: Andy Shevchenko To: Alexander Kuleshov Cc: Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , LKML , Greg Kroah-Hartman , Borislav Petkov , Mark Rustad , Yinghai Lu Date: Wed, 10 Jun 2015 12:44:48 +0300 In-Reply-To: References: <1433848247-3550-1-git-send-email-kuleshovmail@gmail.com> <1433848301-5296-1-git-send-email-kuleshovmail@gmail.com> <1433869251.26331.114.camel@linux.intel.com> Organization: Intel Finland Oy Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.12.9-1+b1 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1274 Lines: 45 On Wed, 2015-06-10 at 00:00 +0600, Alexander Kuleshov wrote: > 2015-06-09 23:00 GMT+06:00 Andy Shevchenko : > > > > I'm still not convincing by this code to be in that form and here. What > > about to refactor setup_early_printk() to helper which will do parse > > parameters to a let say structure where one of the flag will be > > struct early_printk_param { > > … > > const char *arg; > > bool serial; > > } > > > > Your function will be something like this > > > > struct early_printk_param epp; > > > > parse_early_printk_param(&epp); > > > > if (!epp->serial) > > return /* whatever error code */; > > > > return setup_early_printk(epp.arg); > > > > Hello Andy, > > But what is difference between parsing to string and > passing it and parsing to structure and pass its field? You do parsing twice (still original code and your piece here), and honestly I don't like your approach in this form. > > Thank you. -- Andy Shevchenko Intel Finland Oy -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/