Received: by 2002:a25:8b12:0:0:0:0:0 with SMTP id i18csp1737645ybl; Wed, 14 Aug 2019 23:57:03 -0700 (PDT) X-Google-Smtp-Source: APXvYqxAujWCilgbUjA9iBRSD8NsWSHsHGuWy4CtSOrGe5o75WKH6Prb+7ofUcZHwV36+rn50AF8 X-Received: by 2002:a63:7d05:: with SMTP id y5mr2396488pgc.425.1565852222936; Wed, 14 Aug 2019 23:57:02 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1565852222; cv=none; d=google.com; s=arc-20160816; b=JE2BuVUahfM/loipRSuNiz87FcbSj74jOFBiLGxFGIHBR+Xu49rYaTwJuafmaeC9oF PvAWugRPJxxsVwvLde89Oeg8FiLdyP5QF5Tg8EyjXdtVzgQP7qOvDalRASEeCqpbPrLX vAY1sqa3djpPWGhSEcb3d94oqVcMBP1TRLWwG96cJEBhvM1TieDynWFmVEd7iEPlQhoB a38VwvXau+1qMn+UykaBE3KcE6mQPgoRAf7A1sD7oSyfNPAhNk4wQN8fPMc8xu3Pe90R Ko+B2OZ9pqCc6R5nEssRCspZ+YCagMpPypKCRxg4+riSesNoOa55CSV7S7E10863TaKK UtIw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=wIN/3e7DmCq2KFrr2GT8E+NTKTLGporkmHFbvr6BdEw=; b=CWye7UMPWeD0yEtHogOIL0V5qcRuyMhEyO2jzw65BHslIXpuHWJi0m66HKYO40VS1R FgcmC0DI75lB3jDBi10FhiDeqGoEi1VG1TbQimFitcuOLMfavoAFxXqEsts4YLej0oTq YLOGHA93dUzIroYvB4fkiQ12DAg+tRTxS/qiKDOPlijI4YwNjh4tc+oWGI9XzU5p4To9 aqELOhmk7+9/ULnJuFVn97YICK5qYGdYfS2dyA+JI7v38PyiH6FxPbKZuQ0y0eMoe3hy VlLqRNRiXUBY86pr0Shw2lY5I1F3UDMnisrJqWSTdhbIcMwR1bhXE/2rGNcS06R9ZmIi l6oA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ltx3L04W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id 39si1424924plc.377.2019.08.14.23.56.45; Wed, 14 Aug 2019 23:57:02 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ltx3L04W; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1730227AbfHOF7K (ORCPT + 99 others); Thu, 15 Aug 2019 01:59:10 -0400 Received: from mail-pf1-f194.google.com ([209.85.210.194]:37427 "EHLO mail-pf1-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725681AbfHOF7K (ORCPT ); Thu, 15 Aug 2019 01:59:10 -0400 Received: by mail-pf1-f194.google.com with SMTP id 129so849526pfa.4; Wed, 14 Aug 2019 22:59:09 -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=wIN/3e7DmCq2KFrr2GT8E+NTKTLGporkmHFbvr6BdEw=; b=ltx3L04WJuOQgF1LYju3dlRn4Cyjnm4+zW2PdzjSOCef1GRhhmpg5YB9ot7HJ0qAX2 v5UPvV4kcgPEkdP2QisSksYt35mUkjT0ap+xbT+++wFbuXd3iLCedKgZLoMhncCYykx8 qLi8S9OScvOEQw2uQ3ckPj+nZChss+Sa7PSgOfmWibcvWr65mWWd4Khz7J1FnIr6ZWt3 NMRusJXN/zBwQpXL3hNc55bSpvg3UUN+AzhQ89RiYQGYL5UwixAHZmbz5i/PPgvdwKBU xAr6jneyWsGHPHAfQG5GqDTvgjC3Y7NKMahmlEMwdQEJtj6UuCaMZW27wJ7uOiRua90r VYhA== 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=wIN/3e7DmCq2KFrr2GT8E+NTKTLGporkmHFbvr6BdEw=; b=KaiIG0Ip7mJBQ+F9nxLavwRGlxW8SZKuesMBZJu7UhMm7iOQuuOLZDeMMYB1c2fPDQ /xNCq0P3lyR11Jia8Weq2MC4Ys6XkNnV6crfAYSIwzg4cHFJQveVvMsl9zZeWJNJAeV0 i2E6cPtDT7KLrBEPuyckf2oq1TYdIr53nLj3rXwHRNQuBdYjW3oZBdm6hMhaAu4gb4hy Ydk6FesRz6KLWuz502Ryi358cYv7isjfWdHy6iIQTvvlNQSUEeGRf4eEZxZyHGSeXNXI NkhcFOhByiG+faTFGDLKQdsrYnaVuFB1Je4uUXVuA5VUntOSOgAlKbsG66vebDZxWBZG UjcQ== X-Gm-Message-State: APjAAAXlw7aONWVAEG+7I5UNHOr2m9ES60wL4J/dCmOXHGNwMhLsFSNO HptLUDkvLuqvTakb2ZQ7G/A= X-Received: by 2002:a63:e48:: with SMTP id 8mr2211940pgo.389.1565848749290; Wed, 14 Aug 2019 22:59:09 -0700 (PDT) Received: from localhost.localdomain ([110.225.3.176]) by smtp.gmail.com with ESMTPSA id e7sm1760010pfn.72.2019.08.14.22.59.06 (version=TLS1_3 cipher=AEAD-AES256-GCM-SHA384 bits=256/256); Wed, 14 Aug 2019 22:59:08 -0700 (PDT) From: Nishka Dasgupta To: pierre-yves.mordret@st.com, mcoquelin.stm32@gmail.com, alexandre.torgue@st.com, linux-i2c@vger.kernel.org, linux-stm32@st-md-mailman.stormreply.com, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Cc: Nishka Dasgupta Subject: [PATCH] i2c: stm32f7: Make structure stm32f7_i2c_algo constant Date: Thu, 15 Aug 2019 11:28:57 +0530 Message-Id: <20190815055857.1944-1-nishkadg.linux@gmail.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Static structure stm32f7_i2c_algo, of type i2c_algorithm, is used only when it is assigned to constant field algo of a variable having type i2c_adapter. As stm32f7_i2c_algo is therefore never modified, make it const as well to protect it from unintended modification. Issue found with Coccinelle. Signed-off-by: Nishka Dasgupta --- drivers/i2c/busses/i2c-stm32f7.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/i2c/busses/i2c-stm32f7.c b/drivers/i2c/busses/i2c-stm32f7.c index 266d1c269b83..d36cf08461f7 100644 --- a/drivers/i2c/busses/i2c-stm32f7.c +++ b/drivers/i2c/busses/i2c-stm32f7.c @@ -1809,7 +1809,7 @@ static u32 stm32f7_i2c_func(struct i2c_adapter *adap) I2C_FUNC_SMBUS_I2C_BLOCK; } -static struct i2c_algorithm stm32f7_i2c_algo = { +static const struct i2c_algorithm stm32f7_i2c_algo = { .master_xfer = stm32f7_i2c_xfer, .smbus_xfer = stm32f7_i2c_smbus_xfer, .functionality = stm32f7_i2c_func, -- 2.19.1