From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 447AA293C57 for ; Thu, 10 Jul 2025 22:01:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752184894; cv=none; b=OFuKIYqElZm4/HNokhxf5NyRz7LuHZrWmS3t4yppoZsKQ5uauyKXME2P0QyvzwqLV9bjDUW/5hXIPdcM3TM7hB9iVCTqAMHGezG7Ks162SaZeQThBT6rZTs51kmQj1zvTFq2vtXK8KuPoZsrseLpbifxuE0pZTY0utp+t2YY450= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1752184894; c=relaxed/simple; bh=6MdF5i/RpZPtk45CWd9nolEmBp5s/RmeoUjMV5XhZwI=; h=Date:From:To:Cc:Subject:Message-Id:In-Reply-To:References: Mime-Version:Content-Type; b=UVi1uoBVOgMvhLy2zH/ShTYqMZCKI04rOM5ey9YuHO9Bpc4wihHt1badi7GhsVbRe/FMuFgRRajee81wNilg6yXdFQcqtAOV9aIDZw6x7XIR1CAqQmycVMW40b9LvXy0rg3/Rdus9rZqNarMbFVE59AdbtPcOAZRnUnIs320u3s= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b=OICT/CVX; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linux-foundation.org header.i=@linux-foundation.org header.b="OICT/CVX" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0B76BC4CEE3; Thu, 10 Jul 2025 22:01:34 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linux-foundation.org; s=korg; t=1752184894; bh=6MdF5i/RpZPtk45CWd9nolEmBp5s/RmeoUjMV5XhZwI=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=OICT/CVXnbAYMC8+MvstH7ZXTfriVfQy+4pGsAzGSG/7v5COziVUEralpPz2ZfW6x yFtqmLgl8i59krSPPvw4nlIwrCMSj0LXWIm3jNO8UvAgSqUPb0XL7cxS0XMWKAY5j3 j3y2kdYsBvSsWOhiooxBQrcq8eaXSAwdWfDNGoPo= Date: Thu, 10 Jul 2025 15:01:33 -0700 From: Andrew Morton To: Andy Shevchenko Cc: Feng Tang , linux-kernel@vger.kernel.org Subject: Re: [PATCH v1 1/1] panic: Fix compilation error (`make W=1`) Message-Id: <20250710150133.680679cf8a0f6b2f0bf3369f@linux-foundation.org> In-Reply-To: <20250710094816.771656-1-andriy.shevchenko@linux.intel.com> References: <20250710094816.771656-1-andriy.shevchenko@linux.intel.com> X-Mailer: Sylpheed 3.8.0beta1 (GTK+ 2.24.33; x86_64-pc-linux-gnu) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit On Thu, 10 Jul 2025 12:48:16 +0300 Andy Shevchenko wrote: > Compiler is not happy about the recently added code: > > lib/sys_info.c:52:19: error: variable 'sys_info_avail' is not needed and will not be emitted [-Werror,-Wunneeded-internal-declaration] > 52 | static const char sys_info_avail[] = "tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks"; > | ^~~~~~~~~~~~~~ > > Fix it in the same way how, for example, lib/vsprintf.c does in the similar > cases, i.e. by using string literal directly as sizeof() parameter. > > ... > > --- a/lib/sys_info.c > +++ b/lib/sys_info.c > @@ -49,13 +49,11 @@ unsigned long sys_info_parse_param(char *str) > > #ifdef CONFIG_SYSCTL > > -static const char sys_info_avail[] = "tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks"; > - > int sysctl_sys_info_handler(const struct ctl_table *ro_table, int write, > void *buffer, size_t *lenp, > loff_t *ppos) > { > - char names[sizeof(sys_info_avail) + 1]; > + char names[sizeof("tasks,mem,timers,locks,ftrace,all_bt,blocked_tasks") + 1]; > struct ctl_table table; > unsigned long *si_bits_global; > Yes, that's neater than the fix we currently have. I'll grab, thanks.