Thread (26 messages) 26 messages, 5 authors, 2023-03-31

Re: [EXTERNAL] Re: [PATCH v5 3/5] soc: ti: pruss: Add pruss_cfg_read()/update() API

From: Md Danish Anwar <hidden>
Date: 2023-03-31 11:35:11
Also in: linux-arm-kernel, linux-devicetree, linux-omap, linux-remoteproc, lkml

Hi Mathieu,

On 31/03/23 15:52, Md Danish Anwar wrote:
On 30/03/23 19:51, Mathieu Poirier wrote:
quoted
On Thu, 30 Mar 2023 at 04:00, Md Danish Anwar [off-list ref] wrote:
quoted
Hi Mathieu,

On 28/03/23 02:31, Mathieu Poirier wrote:
quoted
On Thu, Mar 23, 2023 at 11:54:49AM +0530, MD Danish Anwar wrote:
quoted
From: Suman Anna <redacted>

Add two new generic API pruss_cfg_read() and pruss_cfg_update() to
the PRUSS platform driver to read and program respectively a register
within the PRUSS CFG sub-module represented by a syscon driver.

These APIs are internal to PRUSS driver. Various useful registers
and macros for certain register bit-fields and their values have also
been added.

Signed-off-by: Suman Anna <redacted>
Co-developed-by: Grzegorz Jaszczyk <redacted>
Signed-off-by: Grzegorz Jaszczyk <redacted>
Signed-off-by: Puranjay Mohan <redacted>
Signed-off-by: MD Danish Anwar <danishanwar@ti.com>
---
 drivers/soc/ti/pruss.c |   1 +
 drivers/soc/ti/pruss.h | 112 +++++++++++++++++++++++++++++++++++++++++
 2 files changed, 113 insertions(+)
 create mode 100644 drivers/soc/ti/pruss.h
This patch doesn't compile without warnings.
I checked the warnings. Below are the warnings that I am getting for these patch.

In file included from drivers/soc/ti/pruss.c:24:
drivers/soc/ti/pruss.h:103:12: warning: ‘pruss_cfg_update’ defined but not used
[-Wunused-function]
  103 | static int pruss_cfg_update(struct pruss *pruss, unsigned int reg,
      |            ^~~~~~~~~~~~~~~~
drivers/soc/ti/pruss.h:84:12: warning: ‘pruss_cfg_read’ defined but not used
[-Wunused-function]
   84 | static int pruss_cfg_read(struct pruss *pruss, unsigned int reg,
unsigned int *val)

These warnings are coming because pruss_cfg_read() / update() APIs are
introduced in this patch but they are used later.

One way to resolve this warning is to make this API "inline". I compiled after
making these APIs inline, it got compiled without any warnings.

The other solution is to merge a user API of these APIs in this patch. Patch 4
and 5 introduces some APIs that uses pruss_cfg_read() / update() APIs. If we
squash patch 5 (as patch 5 uses both read() and update() APIs where as patch 4
only uses update() API) with this patch and make it a single patch where
pruss_cfg_read() / update() is introduced as well as used, then this warning
will be resolved.
The proper way to do this is to introduce new APIs only when they are needed.
Sure, Mathieu. I will squash this patch with patch 5 ( as it uses both update()
and read() APIs) so that these APIs are introduced and used in the same patch.
I have sent next revision [v6] of these patch-set addressing your comments.
Please have a look at that.

[v6] https://lore.kernel.org/all/20230331112941.823410-1-danishanwar@ti.com/ (local)

-- 
Thanks and Regards,
Danish.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help