Received: by 2002:a05:6a10:1a4d:0:0:0:0 with SMTP id nk13csp6361639pxb; Tue, 15 Feb 2022 00:15:04 -0800 (PST) X-Google-Smtp-Source: ABdhPJxGYaMZmVa7z0iC+XWbDIi0RunNlPsLgFnQzQrf7+rzAdQjibBO2fCz+evQH61+GAM/GIJn X-Received: by 2002:a05:6402:1288:: with SMTP id w8mr2787885edv.134.1644912903802; Tue, 15 Feb 2022 00:15:03 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1644912903; cv=none; d=google.com; s=arc-20160816; b=d9DoOHgypyhFRxiRSNMbm+2luBCpfmJQOj3Z8/ugtpatItG33xLMLinuKxwufjAPM5 DaNHsVpwz/bxQZh/G7Tiw01tctRpmUyR2EYnJ/w3s3DaUMuCOfxE5lqXpf8pPOu17iAl O/PpjK/0XiwHcjL4gZQF5tdry/VCvz9vimuhYOeab8XuP1xY5HOWkZmcLJf/Rm/RblY3 EQCsRt0ePEU5aLOASMb405BA2guzx+q5mLAL5nGNHnu2+r1azjIHnszPONqDEHJpluzp AWWovFCUk87Tee6YnCsKIRXcpi/zyCmjZd6DcXnPmjzBv8hpDzZ6n4l75MM//rUdno7p Eqow== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=bluBykRIiSTJNZD8TCQxil1bSJJGDYpHiwCAoIqV6+o=; b=bpT9pVsB2GTUQaK1vghDcfRp6DaH8lvKSmPjBzlEJ9PV8hCjH5E1+G2ISHgDpW9YSs BGEumUuM3s5hxvQN4mrCcOu9Ao3IcrHcqZ4iMVA4bX03IctTha457d95D7EY8NnA+cTM eK7nHG3SPNnvIEKvhm/y6wV2AM5LXbcFnCXBOmCHkP0RtZv+R5wBQ/jIIZHr7ZFrjXZa Crrw49gpbavSY9cNyoCdJCSb4TmdCG+lQqAQXlfv0DoIJJyIifKz90u4JASBghKO1wi7 5607VAANyHcGgsx6QDrIH9dG6BIPPvqagTloWC0rot0kn1DsvFkpVb3LTltFrReF/GQE cHmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KDTTrdDd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hg6si7766726ejc.448.2022.02.15.00.14.41; Tue, 15 Feb 2022 00:15:03 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=KDTTrdDd; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233771AbiBODQN (ORCPT + 99 others); Mon, 14 Feb 2022 22:16:13 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:36932 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229545AbiBODQM (ORCPT ); Mon, 14 Feb 2022 22:16:12 -0500 Received: from mail-pf1-x42d.google.com (mail-pf1-x42d.google.com [IPv6:2607:f8b0:4864:20::42d]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 213F1ADFC0 for ; Mon, 14 Feb 2022 19:16:04 -0800 (PST) Received: by mail-pf1-x42d.google.com with SMTP id m22so13369393pfk.6 for ; Mon, 14 Feb 2022 19:16:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=bluBykRIiSTJNZD8TCQxil1bSJJGDYpHiwCAoIqV6+o=; b=KDTTrdDdUcvcCww9lKT48jqrXhbJgcRjCyzYnRiXDO+NaxBjNpuVNzHpaBAZ80Mt6p ubcdptWRlYjTgDO3zv86HQEJdh0sB33/BM4JjV/2UTDtDeucdH9ruSszLvkgiMGHoLAd ymQji2DiiP+mi/jU6XM9MRodeUVq2icLLGkfs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=bluBykRIiSTJNZD8TCQxil1bSJJGDYpHiwCAoIqV6+o=; b=27tg7Q6ElcAL+4qJeNVGpefh+KxlXH+S+xFrfCmxLuJThpIiJw2WZAzhcYDvaeYeg9 shMNQlgl/CpJfucWi5f1f8qnoGk4szkn1S+TDmzGSsqZJaFOJcWSkaxr57ZcWtHDvqn5 xMKkPkdkNszej4oZBiqSkYSHhKMgsSDuq3XQUclRRQbM3s1ZtEwBruIN9ghgiNYuGJ2k cZ8JPDPTA9nVWCs5TSAbmm7z9/H1oGNe3tokB3ZjR+W2n+Wcn/BSWc3PF6Sh1QNLPaLL 1tEs0uTgtMexxn371gdTXAsk8Eq7ni2Habbi9boHNH3zcm75DAjqi5dyAud4HqiVC5vQ uaRA== X-Gm-Message-State: AOAM533BcEPk9wVv7r9iKIOCE+YXousNZdYrltJVGaypqgHtu6bVvrEz GrOZYsHgaW37kIIU6qaAw6PGQg== X-Received: by 2002:a63:1655:: with SMTP id 21mr1825737pgw.498.1644894963702; Mon, 14 Feb 2022 19:16:03 -0800 (PST) Received: from google.com ([2401:fa00:8f:203:3a3d:6c6e:58a7:8903]) by smtp.gmail.com with ESMTPSA id o7sm569164pfw.114.2022.02.14.19.16.01 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Feb 2022 19:16:03 -0800 (PST) Date: Tue, 15 Feb 2022 12:15:58 +0900 From: Sergey Senozhatsky To: Andre Kalb Cc: pmladek@suse.com, john.ogness@linutronix.de, linux-kernel@vger.kernel.org, rostedt@goodmis.org, senozhatsky@chromium.org Subject: Re: [PATCH v2] printk: Set console_set_on_cmdline=1 when __add_preferred_console() is called with user_specified == true Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.2 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_NONE, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On (22/02/14 14:21), Andre Kalb wrote: > +static void set_user_specified(struct console_cmdline *c, bool user_specified) > +{ > + if (!user_specified) > + return; > + > + c->user_specified = true; > + console_set_on_cmdline = 1; > +} In original code we always set c->user_specified. Is it guaranteed that ->user_specified is properly initialized to 0? Maybe can do something like: static void set_user_specified(struct console_cmdline *c, bool user_specified) { c->user_specified = user_specified; if (!user_specified) return; console_set_on_cmdline = 1; }