Received: by 2002:a05:6a11:4021:0:0:0:0 with SMTP id ky33csp4102117pxb; Mon, 27 Sep 2021 09:25:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwrkSoN7lCQHIkOl21pCrkDK5KW3m904vjqPJCvq7gP5R/nPMSOEJLUgjzFQbhtBgxUSxPh X-Received: by 2002:a17:907:8811:: with SMTP id ro17mr1045493ejc.104.1632759933614; Mon, 27 Sep 2021 09:25:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1632759933; cv=none; d=google.com; s=arc-20160816; b=CoL2YvQVd+psZN9f+KS1kcZ+VspaJSUGYZxyIVahEyyF5QivF0xEkQ3ww7+dT+w2SN uuUDFFV62C39fxLxjDeS556NiUA+KQgP8DOnjf/RjxDLjFQFjqJNydYcOyqEFFFoC+Lu NX47zsoDZI5mSRKe5v+Xe/D9/pDg9fpEQeKY99i+8F/X4z3uZthsoPHTuk4KPLtI8wAb Z4Ud85yfliSlYZA7RdQaNF2hEYrBO1xIWSM3HE16Cmhcx5XhP4nKIJo9g+hIDAnNGHdu Rz0dN9lBA0NZACklJJbLdzOGphJ5TCAvk4LiNEFsZmXe0iCbw/LPX15YH8uXw9NY3cZk Bzig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:subject:cc:to:from:date; bh=z8INS/1QUoUZeXzNXczptR0Vo6p2Spmnvaggg5nck1Q=; b=Yk4irQpVRFpxQuI+Er0jPRnwqyEyQiH3B3hykRbClEpY7Yoh6yaSKpBBI4wfDJAzJ7 sa2zBPXpf9jNwpmvjOTnJw8glw/5kVRY2+9GZ5kJYAwhT/rcDEPqqwPfEfGTjoSUrH3G r0TnyykBfae2NoJQQwhxcwGYcKo8y1f9BjN2v1tebdCsacuKFyq2PRxGaWHmnas+WR/j rMmdjo9gUEkwGnBcRpk1gxB1y7P3vRUOB8vo6dk6EV+n1oFG9oORPqR0xRDPmYWaHJma QXrkckWHBcom+kzd+s2WXtKCjcM1yqVDCh0P0ft78duX7taOghn7hR43EktbPM2oGIJa 0RIg== ARC-Authentication-Results: i=1; mx.google.com; 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 jr12si19515920ejb.335.2021.09.27.09.25.07; Mon, 27 Sep 2021 09:25:33 -0700 (PDT) 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; 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 S235416AbhI0QXR (ORCPT + 99 others); Mon, 27 Sep 2021 12:23:17 -0400 Received: from mail.kernel.org ([198.145.29.99]:40558 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235338AbhI0QXQ (ORCPT ); Mon, 27 Sep 2021 12:23:16 -0400 Received: from oasis.local.home (unknown [209.210.2.165]) (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 93E676108E; Mon, 27 Sep 2021 16:21:38 +0000 (UTC) Date: Mon, 27 Sep 2021 12:21:38 -0400 From: Steven Rostedt To: Chris Down Cc: Arnd Bergmann , Petr Mladek , Sergey Senozhatsky , Andy Shevchenko , Jessica Yu , Arnd Bergmann , John Ogness , Nathan Chancellor , Nick Desaulniers , YueHaibing , linux-kernel@vger.kernel.org, llvm@lists.linux.dev Subject: Re: [PATCH] printk: avoid -Wsometimes-uninitialized warning Message-ID: <20210927122138.56cb1d8e@oasis.local.home> In-Reply-To: References: <20210927125007.1581919-1-arnd@kernel.org> X-Mailer: Claws Mail 3.18.0 (GTK+ 2.24.33; x86_64-pc-linux-gnu) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, 27 Sep 2021 14:19:18 +0100 Chris Down wrote: > Having IS_ENABLED and then an #ifdef seems to hurt code readability to me. I agree. Would this be a better solution? -- Steve diff --git a/kernel/printk/index.c b/kernel/printk/index.c index d3709408debe..ce3a0c8c5770 100644 --- a/kernel/printk/index.c +++ b/kernel/printk/index.c @@ -26,10 +26,10 @@ static struct pi_entry *pi_get_entry(const struct module *mod, loff_t pos) if (mod) { entries = mod->printk_index_start; nr_entries = mod->printk_index_size; - } + } else #endif + { - if (!mod) { /* vmlinux, comes from linker symbols */ entries = __start_printk_index; nr_entries = __stop_printk_index - __start_printk_index;