From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mail-oo1-f42.google.com (mail-oo1-f42.google.com [209.85.161.42]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id A3C9043F4D7 for ; Wed, 15 Jul 2026 10:22:40 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=209.85.161.42 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784110961; cv=none; b=RkK8yep1yHUbXsgJ8cldecwZQdSUNTcj4N4uDReT0lKt3bxI5lHU8WdXvY9NScy5YpXSbx9M0DSFC/WaPgFSCsOHtsuLgf7bUBs0ZgkjYE4tHoZ2M3QVQIdxk1/wlaKljNmlyLr59V56jjXMe+aqdDXZZkKKr8rdFi5xJc5r8U8= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1784110961; c=relaxed/simple; bh=RYsCY38hXfetDYpNXSv6HtboJtdEpHbINpvt31eP/o4=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=dZlhr6iBIROklGX1tINCvd5Pl3I1ToqIHkJxYhAGSp4leD6V8qJkFzdkPC30cEnluA4V0sqHo5DwAtyr67vWOBNbHM/1OaX55Fv41jMSe6seU8Dh4GOGW/kxhFFJL576n/qgk9scBAmUvbP7yD9orzRjinw12kcxfKB5KYDikNQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com; spf=pass smtp.mailfrom=gmail.com; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b=jvbmfKRz; arc=none smtp.client-ip=209.85.161.42 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=gmail.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="jvbmfKRz" Received: by mail-oo1-f42.google.com with SMTP id 006d021491bc7-6a3d915616fso185286eaf.2 for ; Wed, 15 Jul 2026 03:22:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1784110959; x=1784715759; darn=vger.kernel.org; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:from:to:cc:subject :date:message-id:reply-to:content-type; bh=YFRVUyNnsvCbhkxmCbV4fjw8KVL0SYAGHoyknd5Huqo=; b=jvbmfKRzTGWm1MKyu7Wx8HYRGdBSslbn5kTUIlQXcBHcj7ibTDuPGO54ZxYYkyZ0b7 /5DCotcBS+Z7hR4aLWV3d5wC321abbdqFKLsGvrVUYfp8zUOr3x1ckUVySuoWsgPc38B B7OjGORir+p7Bhuc+bnLkPYczsmezV+aviXlXqLLDnnXEOZCDzfvzrbaZ93TQE02BdCU zcywqJbV7XzreB+THMylVC0EhKIRMfgbt7KGHoYGg5u2nz8D+FS6w/i/uQhvOidWAl2G 5ZXz7gH7POXqO/3cJj6XDvqRXsH8ryU33Tvdi+lqwanCxPItgJgs2g16XqFzG3eqO3K7 3wTw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1784110959; x=1784715759; h=in-reply-to:content-disposition:content-type:mime-version :references:message-id:subject:cc:to:from:date:x-gm-gg :x-gm-message-state:from:to:cc:subject:date:message-id:reply-to :content-type; bh=YFRVUyNnsvCbhkxmCbV4fjw8KVL0SYAGHoyknd5Huqo=; b=SUj/tpai8CeEhdbmVvEcfyXXonOkwtvfEdqfDGHJczikH6kwdt9CaDUX8MkRX6dovD NGVKLZAQ4yczlC9sI/MqQndGYnEJ95z/v1NmZ52EJVnFhBzUlbM8oZVJwyHbb/88/xKQ 5F0qcjnYnfqXnqq9D60az5uXc5Gs2HngUF04K926lqQ78WsY1N9XBdSgnY/vFagf/kIU w+LG0LGkg3ic9+kstZ4XJSpEBk3bIGtECMkkpI00FXICVmQH/U8BKJs/24XhJ4GaiFZA YKr9UicSEA/jlXEMlwCHd0K1v/3EWsffkr6Q3Wku/ucSmkGvL9xgbNuIG1Tn7WAzR6zv 5SrQ== X-Forwarded-Encrypted: i=1; AHgh+RqNpxkK3hpCvXkO2qTYKPHTrGPynHuO8jBdf2kLScwDKAo3GqB8Q/Jz2ex5WUxSxKNnV10kXHfPT5ql8lk=@vger.kernel.org X-Gm-Message-State: AOJu0YyRI5tgDYvMshxKa5uzNQmSCTkEKz9m57J9PKUq014DyFsHM98Z 6Uc09SVMwyifUuxGey1eqp1wJnBZTXmO4VkSiHRBBXqqvFQdGevvMUGK X-Gm-Gg: AfdE7cm7TtMm3/6xQT9PTTYyqdaD0eZphS1UTYmQuCZr29hNwNr+77uUKliWXvURd6a SXuPVYWw5GfB4ro+5h43SSeOsidSMPABIPnRCzVsAKh0ifsuj8D8l4KBm7IMjDQqtiZ2c8DDSoh 1lEmK3QYDU2G6tWEaL8kg/m6kyRlgsrysTqryAVtzya74+Wmlx8nut6K+ldoWsjstoJq1j/Acoz VL5tu+v3XEUuH4mI1Y/yfs3rXaD3IEAKl9YNodIl7FR8jixDdsrBhYY2C5MIjOPwMikre7DXG7u z2zLb4NVAPHe8I3I1jCzDZQNIYlJb3HlLl3aI3lC0nZO4e2I0/z1CteJA1y3/7hdI5SKcUdD5LZ /ssurljJrn5UuHYpSwrp9WG89uJIg0tlQMaYjC+JvjLfcM6MIgisurs3GVgoknY0aPVdYEgJkxt yIw3e7 X-Received: by 2002:a05:6820:1350:b0:6a1:8606:44c2 with SMTP id 006d021491bc7-6a3da05ba34mr1315522eaf.54.1784110959511; Wed, 15 Jul 2026 03:22:39 -0700 (PDT) Received: from localhost ([74.80.182.90]) by smtp.gmail.com with ESMTPSA id 586e51a60fabf-4561f2680d8sm2782008fac.14.2026.07.15.03.22.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 15 Jul 2026 03:22:38 -0700 (PDT) Date: Wed, 15 Jul 2026 13:22:32 +0300 From: Dan Carpenter To: Andy Shevchenko Cc: Colin Ian King , Duje =?utf-8?Q?Mihanovi=C4=87?= , Jonathan Cameron , David Lechner , Nuno =?iso-8859-1?Q?S=E1?= , Andy Shevchenko , linux-iio@vger.kernel.org, kernel-janitors@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH][next] iio: adc: make read-only const array config static Message-ID: References: <20260714165012.184651-1-colin.i.king@gmail.com> 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-Disposition: inline In-Reply-To: On Tue, Jul 14, 2026 at 08:08:10PM +0300, Andy Shevchenko wrote: > On Tue, Jul 14, 2026 at 05:50:12PM +0100, Colin Ian King wrote: > > Don't populate the read-only const array config on the stack at run > > time, instead make it static. > > Reviewed-by: Andy Shevchenko > > ... > > In all patches like this it's always a bikeshedding possible of moving static > data outside of a function. I have no strong opinion in these cases (when the > data solely used by a single function), but in general it might give different > readability experience (it's harder to notice static data in the local function > definition block). So I leave this exercise to the maintainers of the respective > pieces of the code. > It's an interesting point... At one point Smatch didn't track static variables and it used to generate occasional false positives. And it's like you say, those little "static" qualifiers are hard to spot in a wall of declaration text. I've never considered moving the declarations out of the function scope but it might be a good idea? But in this case since this data is const, the static vs not-static doesn't affect flow analysis or readability. regards, dan carpenter