Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp2800783pxk; Sun, 4 Oct 2020 12:33:34 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwV52MQinuLyzUYdKL1uiE0OhR/QOhg0yjqIFJBXQ9q0JmhUnmqm2xq+HuHTCFaPE5iUgJr X-Received: by 2002:a50:9a86:: with SMTP id p6mr13463197edb.96.1601840014656; Sun, 04 Oct 2020 12:33:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601840014; cv=none; d=google.com; s=arc-20160816; b=hMlYKjWX0YEUl8KBVexvtjbmT5qfGwS0O+DFBZIjaHHP0ty+2qH8VDM+IkDkJ6ka3A KXm79ioovBQJANenQSteUkqqzJAZkN2HJHTwa0Y4vUjeLmIklVdS+tnW6XG0lNo4VuBC PpGu8ww3Aw8Eo1VZ4GbmggXeHfyBOk4Q2vxWR39jv01dCBI/GCMW2Zcszo/a0MVYzoAM oyGAJQ3hjeJ5m+edCH1ikOGeP0hMI2s4w7JhrlrN/g6Yjh3wLMyEJwilNXUS6d0dSuqj 4/SvSXv/4yYWoEfLrqyb/I8WaRm/dCDoTs2/VIpEDVpBUa9ahvxJJr41MXLGNFx9jFHf 3Yrw== 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 :message-id:date:subject:cc:to:from:dkim-signature; bh=GB4h5Xl/CoQUaS0iXXY2E8krzQRbuhNv8HD6xlseMxY=; b=mKnfn4bV7ur5P8F0gIY68JullfeLqFd1mpYawzTrX2Qh8BKF6rHa18aMWa0A3UUBTg tgGSXYQOmarno11vrz78+6f1CHPnPH+IU91/moulVR+9WIUFtlpmdGSE61XdGcfKUtzJ IRDINwOIOmom4Q4IFhdrMxy6ofSNU5BJj8zKpJfdYD4CRwK5Z2oAcvtnaXYrF3FNAYDX IPCEBSa99fWKWY7l7B1FmpMZQVmUFsS2eEruCEP9oQRhIFdmkf+RXwTDVyGiVv98FWzq t0K3UllEpyiVJXU4T9v3LK7775xkPYuHrQpAFFynOyRhBChAXLE3l7dpd9EKmYRsGh4P vj9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fq+RG1al; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id k3si60298eji.109.2020.10.04.12.33.12; Sun, 04 Oct 2020 12:33:34 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=fq+RG1al; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726296AbgJDTcM (ORCPT + 99 others); Sun, 4 Oct 2020 15:32:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbgJDTcM (ORCPT ); Sun, 4 Oct 2020 15:32:12 -0400 Received: from mail-lf1-x141.google.com (mail-lf1-x141.google.com [IPv6:2a00:1450:4864:20::141]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 405D8C0613CE; Sun, 4 Oct 2020 12:32:12 -0700 (PDT) Received: by mail-lf1-x141.google.com with SMTP id r127so3802540lff.12; Sun, 04 Oct 2020 12:32:12 -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:mime-version :content-transfer-encoding; bh=GB4h5Xl/CoQUaS0iXXY2E8krzQRbuhNv8HD6xlseMxY=; b=fq+RG1alzKFM4Rvwo0TAFkVbMbKqF0jBNOZkVnPZgwPBHWyq34z+myBfOIoO9KR2BV As6A+A7txwxqhxRf1dfQio3ljksdfMEM7sNWk5GyrUdF4OrdGYyCpzoSJPf6SakGTwo6 b6L/RwUS7apA8i4vDcT8C04MoeoL+22W7QKPIcl+Bk3o87Erh+Yh4Tcr+SopDcHlcko+ aV+2LkXRj46F53QJHjcTdDHAGBxsNodereE+VEOs+VUaWSUEogAiM65in79vw9Pjx3no I5VUM0Q91gH7Y7F6V5kkWTxNVtNd2QYoJP4DNYRhB9PKGMnF8df5OkR19xA9gN3I2gNo T7vg== 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:mime-version :content-transfer-encoding; bh=GB4h5Xl/CoQUaS0iXXY2E8krzQRbuhNv8HD6xlseMxY=; b=sPZi3rv515zOcv1FFReUXKCIJfx13ZYXs/Wo1my1LGLx1rwP6AYq7umbuu5+vofkoN JQO8kIIRU3Tcq9YhqeFlUUUpEvPMepQzck5gN21QsU40kdCzYijzGkRebnzfneP4E8FD rG8XJoyEZQhpPBlAfews7hxqTLAcGxKTv79F/aBPePB7Y6Z9EfUb5aAkqI6YpSWy7Emq YC8hx7K9ay1rK4SKEmUbRzr5y+nbjURM6H8wskcOhLNii8lkH1d+AuWI63uhjFyDRquz xQCDS57v8+qLsnNtnnAGM3EHi3fAmxs/1TfH7yVnjq6AOHoyaGD/AEUhnpHuUoUA5iMW 9PTg== X-Gm-Message-State: AOAM530gKNmU9MRbk9HpM34DTS4thfwXCZpxnsYreiBIwfcFOUfh5q1E VKxRWTIxLGiQ+jJm5pyCoPc= X-Received: by 2002:a19:8c52:: with SMTP id i18mr496992lfj.115.1601839930067; Sun, 04 Oct 2020 12:32:10 -0700 (PDT) Received: from localhost.localdomain (h-155-4-221-232.NA.cust.bahnhof.se. [155.4.221.232]) by smtp.gmail.com with ESMTPSA id h22sm2298220ljl.101.2020.10.04.12.32.09 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sun, 04 Oct 2020 12:32:09 -0700 (PDT) From: Rikard Falkeborn To: Greg Kroah-Hartman Cc: linux-kernel@vger.kernel.org, Rikard Falkeborn , Sebastian Reichel , Angelo Dureghello , Akira Shimahara , Evgeniy Polyakov , linux-pm@vger.kernel.org Subject: [PATCH 0/3] w1: Constify w1_family_ops Date: Sun, 4 Oct 2020 21:31:59 +0200 Message-Id: <20201004193202.4044-1-rikard.falkeborn@gmail.com> X-Mailer: git-send-email 2.28.0 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org None of the current instances of struct w1_family_ops in the kernel is modified. Constify these to let the compiler put them in read-only memory. The first patch changes the fops field in w1_family struct to a pointer to const and makes a local variable a pointer to const to avoid a compiler warning. This patch is a prerequisite for the second and third patches which constifies the static structs in drivers in w1 and power. These changes was done with coccinelle (details in the commit messages). With these changes applied, all instances of struct w1_family_ops in the kernel are const. Build-tested on x86 allmodconfig. Rikard Falkeborn (3): w1: Constify struct w1_family_ops w1: Constify static w1_family_ops structs power: supply: Constify static w1_family_ops structs drivers/power/supply/bq27xxx_battery_hdq.c | 2 +- drivers/power/supply/ds2760_battery.c | 2 +- drivers/power/supply/max1721x_battery.c | 2 +- drivers/w1/slaves/w1_ds2405.c | 2 +- drivers/w1/slaves/w1_ds2406.c | 2 +- drivers/w1/slaves/w1_ds2408.c | 2 +- drivers/w1/slaves/w1_ds2413.c | 2 +- drivers/w1/slaves/w1_ds2423.c | 2 +- drivers/w1/slaves/w1_ds2430.c | 2 +- drivers/w1/slaves/w1_ds2431.c | 2 +- drivers/w1/slaves/w1_ds2433.c | 2 +- drivers/w1/slaves/w1_ds2438.c | 2 +- drivers/w1/slaves/w1_ds250x.c | 2 +- drivers/w1/slaves/w1_ds2780.c | 2 +- drivers/w1/slaves/w1_ds2781.c | 2 +- drivers/w1/slaves/w1_ds2805.c | 2 +- drivers/w1/slaves/w1_ds28e04.c | 2 +- drivers/w1/slaves/w1_ds28e17.c | 2 +- drivers/w1/slaves/w1_therm.c | 6 +++--- drivers/w1/w1.c | 4 ++-- include/linux/w1.h | 2 +- 21 files changed, 24 insertions(+), 24 deletions(-) -- 2.28.0