From patchwork Tue May 26 21:02:18 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571363 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12356913 for ; Tue, 26 May 2020 21:03:12 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id EF1EB208C3 for ; Tue, 26 May 2020 21:03:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VxLVlL2u" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389124AbgEZVCu (ORCPT ); Tue, 26 May 2020 17:02:50 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391600AbgEZVCu (ORCPT ); Tue, 26 May 2020 17:02:50 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 87FE8C03E96D; Tue, 26 May 2020 14:02:48 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id e4so3830474ljn.4; Tue, 26 May 2020 14:02:48 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=bpnokN0i6iCHNbK3Hq2vncfPsrhaFuH0/YJmD+o8wI4=; b=VxLVlL2uJgD4tEuJ8HJ+1wJG6gimbOIOkNBoSiNo56Zxq6cx5bVNYR3llSszhnkNzR GWC8MtdB/XsZYCrrOxgFMNWnwJhoa/zeDbYM6BTdBD2huTi9BMsANoA5oETumPKoVidv xN10EHuwJ7jjzU8ZbF9+eSkx9HlhHDt9FhueIoda+ZK4BkFBA4Nz/WmGTBDSTXYuy9qE GPrEFJqHm4GRT6xpVdoVeQgvDKLoV92ziZi3dqc3MPvtYSlhWDuk2+3JID+ChavP/9CC rCtxBKLM4kNLLsrkgVhmd8YFGN2/3G0SLLSZd1h8tTLn1T487iztCSQ1ePnygCiGlQQ4 G0PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=bpnokN0i6iCHNbK3Hq2vncfPsrhaFuH0/YJmD+o8wI4=; b=Kf7vYYVI47S565o63NrUSbrklAIq7nXiftzWsaGIT78/x36NqAcRbD8a6tfvB6AVPJ MHLMXQ8VxhynausZ5+ID2W3aVRZL8kVcNpwK9zZ31R7WC+tcXfGI7NzXhDfBcSJAq3ZJ P5pmYZZpFCZsKjLBFiQ7/mMRdgK8wcjmbLoBzT5xAczHdIdNdieYRkprrvfEqNN0e3Cl WmVHvZbrsTqx2cwrv4szmHkS88r05uv3QhMhx8YoF98kCdboK1/DvJePgARxmze4Mcs9 yTdA6GfW6dQSnGcK+w/SNt8yVhyAMwAgGtRRcrI+vCE2R6t9Evx7zWh5YUhRMt1UlEDL kAhQ== X-Gm-Message-State: AOAM531m7GApuqqR68Ho9O7kT95Apst7vnyrzBvHzntGSGfijWsSm6c0 lauEklcyylHsgW2UfdwGcLs= X-Google-Smtp-Source: ABdhPJzaQJBzXvQP3qF409CnTmdMdRKLGVplXwhvZ1kkB03s4LC2Tn+VxTcyf3Kv+ChjZ+wnSeUTxQ== X-Received: by 2002:a2e:8e36:: with SMTP id r22mr1440534ljk.186.1590526967087; Tue, 26 May 2020 14:02:47 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.46 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:46 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 1/6] iio: adc: max11100: Constify struct iio_chan_spec Date: Tue, 26 May 2020 23:02:18 +0200 Message-Id: <20200526210223.1672-2-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org max11100_channels is not modified and can therefore be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 3776 1168 0 4944 1350 drivers/iio/adc/max11100.o After: text data bss dec hex filename 3968 976 0 4944 1350 drivers/iio/adc/max11100.o Signed-off-by: Rikard Falkeborn --- drivers/iio/adc/max11100.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/adc/max11100.c b/drivers/iio/adc/max11100.c index 3440539cfdba..b121ca78f851 100644 --- a/drivers/iio/adc/max11100.c +++ b/drivers/iio/adc/max11100.c @@ -37,7 +37,7 @@ struct max11100_state { u8 buffer[3] ____cacheline_aligned; }; -static struct iio_chan_spec max11100_channels[] = { +static const struct iio_chan_spec max11100_channels[] = { { /* [0] */ .type = IIO_VOLTAGE, .info_mask_separate = BIT(IIO_CHAN_INFO_RAW) | From patchwork Tue May 26 21:02:19 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571361 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 16787913 for ; Tue, 26 May 2020 21:03:11 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F3EA6208C3 for ; Tue, 26 May 2020 21:03:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ai74PIuF" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391618AbgEZVCv (ORCPT ); Tue, 26 May 2020 17:02:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51656 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391593AbgEZVCu (ORCPT ); Tue, 26 May 2020 17:02:50 -0400 Received: from mail-lf1-x143.google.com (mail-lf1-x143.google.com [IPv6:2a00:1450:4864:20::143]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8ED32C061A0F; Tue, 26 May 2020 14:02:49 -0700 (PDT) Received: by mail-lf1-x143.google.com with SMTP id h188so13184309lfd.7; Tue, 26 May 2020 14:02:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=zHKHbTyN3ylvMC+aGrTtOuZ55SQGmQ/6ZcuOSRWhTEY=; b=ai74PIuFnMWqP1O0lNzIM6WBtZw27atnzkynbEe+q0ax/kZTBQiO0Ish62iqwNK2Bj E1LOskzUCBk7cU4ksNqe82y0JYly3zBnk6Oz5Z9+mMFAQ6eONOdAVupMpiNFWVwGPa+o xa1/sXLEoKj+sK3rCr5qcTUVRbOOzKLG3VD9J2ept1c4b9bF+fAzLc8Drn3tnZfxLNf4 i+kMfYRQzWjx6aTuBejX1KYMOV/DVEv0XrHHyDQVqsIv/8VTwtJm6ulutot6Jy5Pucrh zrc4zYteFD/49ig0M1rho+iY8b53Sl35hUS3CkveTl4MQdB3LwKTfmkEB1zJQueSbqvp Na8w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=zHKHbTyN3ylvMC+aGrTtOuZ55SQGmQ/6ZcuOSRWhTEY=; b=CXhoeKElmLvbaptz6+WtB9gcqFCXAJiof/NBcaxFNvffQePDnzVkMDy7ZTwiqdrsUg GcEu5oY/k6DC1+vjvmTSNYMNDEA+d8pOrADUdruPWHLuwZcPMZFnwtRbT+E5C5eGiEhu gdI5I5XXlInolEHly9fICH6IRh7aIBSbgZZrlHf+dK5pkJCbH3gvJGmHT4VQ1ms5gyYu sKeVTOQUhNbnDWT+dqWKDBbUXQwZNAPDzeEGcQ69uQKqgnNjsnXIAFiNeqbKndIfOswL j1eV144e6HtJk+BRgZ037K1gWylcu0KRTS5JnjKsyMaf0crC5jrE4eCXYSURJIoXgLuj VfgQ== X-Gm-Message-State: AOAM531pjaPzJwEJZ9fL0fhNmdTwmf8w3ZTftm0a/KiAl3LqbIL341Yp uyG751xMISBmodVPt3AN6v8= X-Google-Smtp-Source: ABdhPJyN5FFTKIy9wC2jaw1hQm6/RlMhGiwkK+QuE93ZhLUixLU0l7k8VV9Eln5IF/+w5B+whuUKLw== X-Received: by 2002:a19:8453:: with SMTP id g80mr1401351lfd.167.1590526968106; Tue, 26 May 2020 14:02:48 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.47 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:47 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , Michael Hennerich Subject: [PATCH 2/6] iio: dac: ad5380: Constify struct iio_chan_spec_ext_info Date: Tue, 26 May 2020 23:02:19 +0200 Message-Id: <20200526210223.1672-3-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org ad5380_ext_info is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 12060 3280 192 15532 3cac drivers/iio/dac/ad5380.o After: text data bss dec hex filename 12252 3088 192 15532 3cac drivers/iio/dac/ad5380.o Signed-off-by: Rikard Falkeborn Acked-by: Alexandru Ardelean --- drivers/iio/dac/ad5380.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5380.c b/drivers/iio/dac/ad5380.c index b37e5675f716..04c74cc1a4ec 100644 --- a/drivers/iio/dac/ad5380.c +++ b/drivers/iio/dac/ad5380.c @@ -240,7 +240,7 @@ static const struct iio_info ad5380_info = { .write_raw = ad5380_write_raw, }; -static struct iio_chan_spec_ext_info ad5380_ext_info[] = { +static const struct iio_chan_spec_ext_info ad5380_ext_info[] = { { .name = "powerdown", .read = ad5380_read_dac_powerdown, From patchwork Tue May 26 21:02:20 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571359 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 896341391 for ; Tue, 26 May 2020 21:03:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 72466208C3 for ; Tue, 26 May 2020 21:03:10 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="UYfdLIFi" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391619AbgEZVCw (ORCPT ); Tue, 26 May 2020 17:02:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51662 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391617AbgEZVCv (ORCPT ); Tue, 26 May 2020 17:02:51 -0400 Received: from mail-lj1-x244.google.com (mail-lj1-x244.google.com [IPv6:2a00:1450:4864:20::244]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B5F0AC061A0F; Tue, 26 May 2020 14:02:50 -0700 (PDT) Received: by mail-lj1-x244.google.com with SMTP id z6so26261632ljm.13; Tue, 26 May 2020 14:02:50 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=lfsjZT426GKLsEKLOHm0vE4g7kNwoUqMKolXj8tX534=; b=UYfdLIFiF0TBj26Y6CXXL6PlhSM4MXzndI50oF6mJOStBsg70LU8TVUhTvvar5tLxl u9Iy8BLVgJvAjKVA8F/RHQxkb2Z5rgr5OTTzNqdV1wtGdYlTrKm5YdDb8eEPqL1v+Ej1 ZKSFKoTW6RgFJ+hr9eZck239uXWXXIHKyRqy+DSg0mFoKwZqYd4wRlXjTTZqtynDVnvw uc909ij9JzLYXhTf4cHEf8yJ/9zNBpFKnWINyWivrkMd1+FeOlVZ+LHEk4dPuvVOdsjN KDfUPMjqg+LHxQ+VBpqBWkOWhttpMIylE1Ech5UEczVl/OuaTFDuyoDCsQ5c6xf4wac9 aVNg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=lfsjZT426GKLsEKLOHm0vE4g7kNwoUqMKolXj8tX534=; b=qUCYjqFJbQrC68M06ESkoLomxYI6ke0r5gj8Lt6Wl/L+ScwgdyQmMw8WB5Hs+C/tMq fPxKGn1z5wA4y6GZ9NMkesxAmayd4wmAk+zYKHfpG9jSWGhiHiYgqLQcrlZ5MmEpwg1R FXMJEPc2aK+6DvMUU31fiK7UGn1HS0NusqmWutbZHP9XOWI3FKUIZnZOl79guU3cLPHn ThyL4fHdgAY+etN5ZscgZ3xDcT0b28Klo+T7zhtr4r7ntHYCUUGtL+XqlpMAJIGuHeTp /4qhNda9LG2x78ehhJGf0TPDbFntrldNbQn5s9wSNr4+mlZALL+MwIIT4LEKhBGOZS11 MEWg== X-Gm-Message-State: AOAM5333hYAnrECRX7mGmYV7ME9a9noTQUUdEz/DLnlvhhCNw+K+xXEN ZtOX1juWvIGHQjVyAX0kLYpyOCWlXeA= X-Google-Smtp-Source: ABdhPJzOPnQEwPIP4LdvZgD5d14UmeD+LVhP76Cy57jge574gl/aorWTKpOBohC/DxzVspisSzgsCw== X-Received: by 2002:a2e:85c4:: with SMTP id h4mr1447604ljj.43.1590526969284; Tue, 26 May 2020 14:02:49 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.48 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:48 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , Michael Hennerich Subject: [PATCH 3/6] iio: dac: ad5592r-base: Constify struct iio_chan_spec_ext_info Date: Tue, 26 May 2020 23:02:20 +0200 Message-Id: <20200526210223.1672-4-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org ad5592r_ext_info is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 13293 2088 256 15637 3d15 drivers/iio/dac/ad5592r-base.o After: text data bss dec hex filename 13421 1960 256 15637 3d15 drivers/iio/dac/ad5592r-base.o Signed-off-by: Rikard Falkeborn Acked-by: Alexandru Ardelean --- drivers/iio/dac/ad5592r-base.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/dac/ad5592r-base.c b/drivers/iio/dac/ad5592r-base.c index 410e90e5f75f..7402f67a551d 100644 --- a/drivers/iio/dac/ad5592r-base.c +++ b/drivers/iio/dac/ad5592r-base.c @@ -484,7 +484,7 @@ static ssize_t ad5592r_show_scale_available(struct iio_dev *iio_dev, st->scale_avail[1][0], st->scale_avail[1][1]); } -static struct iio_chan_spec_ext_info ad5592r_ext_info[] = { +static const struct iio_chan_spec_ext_info ad5592r_ext_info[] = { { .name = "scale_available", .read = ad5592r_show_scale_available, From patchwork Tue May 26 21:02:21 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571353 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id E672B1391 for ; Tue, 26 May 2020 21:03:03 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id CDA3E208C3 for ; Tue, 26 May 2020 21:03:03 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="ejXK9v03" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391688AbgEZVCz (ORCPT ); Tue, 26 May 2020 17:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391665AbgEZVCy (ORCPT ); Tue, 26 May 2020 17:02:54 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C0B37C061A0F; Tue, 26 May 2020 14:02:52 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id l15so25954627lje.9; Tue, 26 May 2020 14:02:52 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=uJ9vqboLv1s3AzR5VuRjQV2GDS3hq4+tFKIoSAGXZY0=; b=ejXK9v03Nc2FhTlrQtlJ0OcmI0RiaIIzXrEIAGOK/09oz1IyyAoVv5Z6cha1vUJIBf rdFNtuTkug8NQ2gyahCUoMcHhw2YfU4uvu4YUuXg6Fy0T3PF+qxq84suIm6e30MkBLkj 6J8vy4zY8FbvM1jMzqlAmXOg5qRZTD+p0e6suhzMh7Xj0lDb3baZ26Oi2hUgTYw/r/dB dEJZ0OsO4lgcKgPo1mNE8dty4U6mZUi+fIJvqsUP5QfpLbXV6Xi1K5IJ1iL7sFLw1TWX 4C+8+MIFQ17WhAeMhbxONBRErKKFya3uz/tbD2qrTyPpoBUSqNfLRNTBa5Oj+oknezJR 7c9A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=uJ9vqboLv1s3AzR5VuRjQV2GDS3hq4+tFKIoSAGXZY0=; b=QV1M4bhPl70GqQY76issW/5oSXYDb78DitFlLlQL2z+wawz2CvGKWS4gdEjbrle67w /+PFSlu2cOv3oFZW+SQE7qtN8DmoUYa8yA/jkg2i1ZTZFxgcfRXGJ1ws2KIazDz+GhVY yfRmSgwdRumpYATTLLRylVS/Gby1O0NOebGaFUKE/0KUy7LrQW9mzZqNKbJuE8y+rRdy vbKS4hV8+yFMnnkCAFgE3kn7pIso9WIOcVCvPIIVAnfzXsO+cKggLiHxLnFb32lmS2sc O+KUZsacSOKxk8UO4vrJpZ4HP4olSN+p55U1o0UrgLR6hlpKi4rSUusV33Df48TKivDH snlA== X-Gm-Message-State: AOAM532JE7U8rmoyiadZ2I01Qg2W8uOkNAdfRSgXJWqs6Q6wQyBEMJYr 83Qosp53849BjtHYFflF1aM= X-Google-Smtp-Source: ABdhPJzqMOk4Dg3vbpPI9zz8oNtLsSnTq7AQyBFcmQinJ9H9qNJL+t6f7stdh0AzaWXeb/Z+ltvAww== X-Received: by 2002:a2e:7007:: with SMTP id l7mr1350421ljc.74.1590526971255; Tue, 26 May 2020 14:02:51 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.49 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:49 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn , linux-pm@vger.kernel.org, Michael Hennerich Subject: [PATCH 4/6] iio: dac: ad5686: Constify static struct iio_chan_spec Date: Tue, 26 May 2020 23:02:21 +0200 Message-Id: <20200526210223.1672-5-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org These are never modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 6642 12608 64 19314 4b72 drivers/iio/dac/ad5686.o After: text data bss dec hex filename 16946 2304 64 19314 4b72 drivers/iio/dac/ad5686.o Signed-off-by: Rikard Falkeborn Acked-by: Alexandru Ardelean --- drivers/iio/dac/ad5686.c | 8 ++++---- drivers/iio/dac/ad5686.h | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/drivers/iio/dac/ad5686.c b/drivers/iio/dac/ad5686.c index 8dd67da0a7da..6de48f618c95 100644 --- a/drivers/iio/dac/ad5686.c +++ b/drivers/iio/dac/ad5686.c @@ -206,12 +206,12 @@ static const struct iio_chan_spec_ext_info ad5686_ext_info[] = { } #define DECLARE_AD5693_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ } #define DECLARE_AD5686_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 1, bits, _shift), \ AD5868_CHANNEL(1, 2, bits, _shift), \ AD5868_CHANNEL(2, 4, bits, _shift), \ @@ -219,7 +219,7 @@ static struct iio_chan_spec name[] = { \ } #define DECLARE_AD5676_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \ @@ -231,7 +231,7 @@ static struct iio_chan_spec name[] = { \ } #define DECLARE_AD5679_CHANNELS(name, bits, _shift) \ -static struct iio_chan_spec name[] = { \ +static const struct iio_chan_spec name[] = { \ AD5868_CHANNEL(0, 0, bits, _shift), \ AD5868_CHANNEL(1, 1, bits, _shift), \ AD5868_CHANNEL(2, 2, bits, _shift), \ diff --git a/drivers/iio/dac/ad5686.h b/drivers/iio/dac/ad5686.h index 52009b5eef88..a15f2970577e 100644 --- a/drivers/iio/dac/ad5686.h +++ b/drivers/iio/dac/ad5686.h @@ -104,7 +104,7 @@ typedef int (*ad5686_read_func)(struct ad5686_state *st, u8 addr); struct ad5686_chip_info { u16 int_vref_mv; unsigned int num_channels; - struct iio_chan_spec *channels; + const struct iio_chan_spec *channels; enum ad5686_regmap_type regmap_type; }; From patchwork Tue May 26 21:02:22 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571355 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5518F913 for ; Tue, 26 May 2020 21:03:04 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 3E400208C3 for ; Tue, 26 May 2020 21:03:04 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="VTJ3C7fQ" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2391677AbgEZVCz (ORCPT ); Tue, 26 May 2020 17:02:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51674 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391593AbgEZVCy (ORCPT ); Tue, 26 May 2020 17:02:54 -0400 Received: from mail-lf1-x142.google.com (mail-lf1-x142.google.com [IPv6:2a00:1450:4864:20::142]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C6DD6C03E96D; Tue, 26 May 2020 14:02:53 -0700 (PDT) Received: by mail-lf1-x142.google.com with SMTP id r125so13126459lff.13; Tue, 26 May 2020 14:02:53 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=1e/8ZoNcbwUPL60Diy7Ut8NIpn3SdcrkymcAJ6goHE4=; b=VTJ3C7fQ6SNVyTPjbx6AGR6tlscqMzVI5KkkXZuUZl787seabx3tVt3UCGiTcfYqdZ oppuO0ogqkvt6/P0HKSLaIiUWnycDv9x4d5P/i5GnCm9rEZ2U2g89nnh/MmJaS2zqbhz pUS0z8FGFzQe9vF7dtDb9psNkOwKeEgLss4aBmgHG8XfBEAbaBv3suW3tzHizYVSL1CW Atj4bTG/z9+sjxOT/k7H6KDG9mEC6Q0oUFm28tpn1oqS4m5q4apW1YenPllYgXk4t8Ca UKAsRHQ71WwgXaOgGGTe7sXh1tVSLlXVmZQhbzwxY4Bs4GoSzr4vQFTl2bcBPAVoK+jN lSPA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=1e/8ZoNcbwUPL60Diy7Ut8NIpn3SdcrkymcAJ6goHE4=; b=U0V8y0O1GN5eD5uq4Hh6kVxTvGH3T9D0cxnrVjI4lj8o0YDRdYtZQGYe47qwOV2bZr D/MfYnXkocrMmpfsarEVnwSjr4Z5JA8gnRWnmnSkK4muwpO6FEDw2TiPpL1g/OwM3B8w RkFXOEXVEtgkvxPbUzh80uaIPBB1oxA5rmdrrSCkSRP9M1h8uNO8TOtW9cvS8koVp0a5 SUzaAzaGG1u8WArsIUyjFQcwZDAcQwzSHLR+EJ3NH7FC2gW3qhAK6bRgSvpgsA9Lw59M P0r5KljowW4uPK533kSlxv0jdL4euu2c2B5xKIQ4/ykrnBvIy675M9ddZlixHqvO/aSe 0A2Q== X-Gm-Message-State: AOAM530NJReNSbIgoQByJy/0Vz7I8K8WPRKUU6Uat6WT2JtzNf1oL7Ga Tl0AWDoQer7OOathikHP5i8= X-Google-Smtp-Source: ABdhPJxOQ774qMT0880D1ET4/aT+zlBKentBtauxEZqzRM5sQnkNtuWpBrr7qB2rJjRWVNa2ypSdaw== X-Received: by 2002:a19:c114:: with SMTP id r20mr1387456lff.210.1590526972276; Tue, 26 May 2020 14:02:52 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.51 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:51 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 5/6] iio: light: stk3310: Constify regmap_config Date: Tue, 26 May 2020 23:02:22 +0200 Message-Id: <20200526210223.1672-6-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org stk3310_regmap_config is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 16027 5424 128 21579 544b drivers/iio/light/stk3310.o After: text data bss dec hex filename 16347 5104 128 21579 544b drivers/iio/light/stk3310.o Signed-off-by: Rikard Falkeborn --- drivers/iio/light/stk3310.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/light/stk3310.c b/drivers/iio/light/stk3310.c index 185c24a75ae6..9d1e503bc958 100644 --- a/drivers/iio/light/stk3310.c +++ b/drivers/iio/light/stk3310.c @@ -487,7 +487,7 @@ static bool stk3310_is_volatile_reg(struct device *dev, unsigned int reg) } } -static struct regmap_config stk3310_regmap_config = { +static const struct regmap_config stk3310_regmap_config = { .name = STK3310_REGMAP_NAME, .reg_bits = 8, .val_bits = 8, From patchwork Tue May 26 21:02:23 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Rikard Falkeborn X-Patchwork-Id: 11571357 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6DFC0913 for ; Tue, 26 May 2020 21:03:07 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 55E43208C3 for ; Tue, 26 May 2020 21:03:07 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=gmail.com header.i=@gmail.com header.b="JFvZsvn7" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389933AbgEZVDE (ORCPT ); Tue, 26 May 2020 17:03:04 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2391685AbgEZVCz (ORCPT ); Tue, 26 May 2020 17:02:55 -0400 Received: from mail-lj1-x243.google.com (mail-lj1-x243.google.com [IPv6:2a00:1450:4864:20::243]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C65A9C061A0F; Tue, 26 May 2020 14:02:54 -0700 (PDT) Received: by mail-lj1-x243.google.com with SMTP id w10so26356654ljo.0; Tue, 26 May 2020 14:02:54 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=7szgAjSgR9Dxc5OfQmj2wG81qBzS351Y34fwZU3ACdg=; b=JFvZsvn7M8wwKWkgMnNYUUu8Z0Gg+2qhBAFDcx5roPbQVVlFnODV9dTzIfF5bWyK8r TDOozjhqYP6H+UKRo+M8XDNJAtFngmhEsUuaGPjkwKXrZS7dY9bf0Cky+YJwdumlfUwE +vtuIOnPgCEkcIC3HJXCw/2TD44oK4Q1O4UWmi6Fwf/yDqsiNcZ00WIqYh4ZTDJ4mYgk 8tNLnPECaw85TSwLVfM9VzMz1B6XuL0Z8NxahS4E/hETV8LO+g6WKGlG4r0u7kj8qs59 OdrbbFcUR83zRxjnJqd/Xu7zbAbDS7sqFP6qFwJX2zd27KYP3oZuKz566Mz9ZLi7G/8f +7wA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=7szgAjSgR9Dxc5OfQmj2wG81qBzS351Y34fwZU3ACdg=; b=o4bNpQcp0mDRdcjUUlNw4NcR81ejYWUjt1utT4IOPpwIc6kMWtizoVjOicky85LGLv mvBpRTnUmpZcqi5gN06n01qXJe17Gat9ePCcRygu62dS5z+Oyeqi9tSdWIaLp8FAeY/w 3w3Y9zttf17W0jK6ALW129vmhYIVkeFLLjTUhht6Vc93zx/bdMSpmtICj18CGX48gwmk rNg9+eu9vZ8vvoDW7htP7QuMALYbmzyVgBla9L0m1SlvJ0J1rZbRMEUj1ysjncRyFEEb pEC4oGE4uBFcCG1Vh6vYfvyduH+G9OGlyivVnpsv0edlCWKaNCTudRFoudlRiescRqBD MrWw== X-Gm-Message-State: AOAM530Xae2s+Sa5/pV9gsZZV1kVHYkxSOJmJcrfJ5Xz6Kt/+7JbayUh 2CG1slIGbJNmPQ3I+qHUvpI= X-Google-Smtp-Source: ABdhPJy6iVIbUisUyaxZ7Wsy0lvp/WF590HWd4bc+DrD8zCO4JFD4s7lOdudWJ/TykwOpoXlaNWYqA== X-Received: by 2002:a2e:88d8:: with SMTP id a24mr1594053ljk.62.1590526973327; Tue, 26 May 2020 14:02:53 -0700 (PDT) Received: from localhost.localdomain (h-158-174-22-22.NA.cust.bahnhof.se. [158.174.22.22]) by smtp.gmail.com with ESMTPSA id z133sm240443lfa.41.2020.05.26.14.02.52 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 26 May 2020 14:02:52 -0700 (PDT) From: Rikard Falkeborn To: Jonathan Cameron Cc: Hartmut Knaack , Lars-Peter Clausen , Peter Meerwald-Stadler , linux-iio@vger.kernel.org, linux-kernel@vger.kernel.org, Rikard Falkeborn Subject: [PATCH 6/6] iio: magnetometer: mmc35240: Constify struct reg_default Date: Tue, 26 May 2020 23:02:23 +0200 Message-Id: <20200526210223.1672-7-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.26.2 In-Reply-To: <20200526210223.1672-1-rikard.falkeborn@gmail.com> References: <20200526210223.1672-1-rikard.falkeborn@gmail.com> MIME-Version: 1.0 Sender: linux-iio-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-iio@vger.kernel.org mmc35240_reg_defaults is not modified and can be made const to allow the compiler to put it in read-only memory. Before: text data bss dec hex filename 9759 3288 128 13175 3377 drivers/iio/magnetometer/mmc35240.o After: text data bss dec hex filename 9823 3224 128 13175 3377 drivers/iio/magnetometer/mmc35240.o Signed-off-by: Rikard Falkeborn --- drivers/iio/magnetometer/mmc35240.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/iio/magnetometer/mmc35240.c b/drivers/iio/magnetometer/mmc35240.c index 1787d656d009..f27586716b5c 100644 --- a/drivers/iio/magnetometer/mmc35240.c +++ b/drivers/iio/magnetometer/mmc35240.c @@ -459,7 +459,7 @@ static bool mmc35240_is_volatile_reg(struct device *dev, unsigned int reg) } } -static struct reg_default mmc35240_reg_defaults[] = { +static const struct reg_default mmc35240_reg_defaults[] = { { MMC35240_REG_CTRL0, 0x00 }, { MMC35240_REG_CTRL1, 0x00 }, };