linux-spi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir
@ 2023-05-20 22:40 Osama Muhammad
  2023-05-30 17:40 ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Osama Muhammad @ 2023-05-20 22:40 UTC (permalink / raw)
  To: fancer.lancer, broonie; +Cc: linux-spi, linux-kernel, Osama Muhammad

This patch fixes the error checking in spi-dw-core.c in
debugfs_create_dir. The DebugFS kernel API is developed in
a way that the caller can safely ignore the errors that
occur during the creation of DebugFS nodes.

Signed-off-by: Osama Muhammad <osmtendev@gmail.com>
---
 drivers/spi/spi-dw-core.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

diff --git a/drivers/spi/spi-dw-core.c b/drivers/spi/spi-dw-core.c
index ae3108c70f50..c21152a40391 100644
--- a/drivers/spi/spi-dw-core.c
+++ b/drivers/spi/spi-dw-core.c
@@ -57,21 +57,18 @@ static const struct debugfs_reg32 dw_spi_dbgfs_regs[] = {
 	DW_SPI_DBGFS_REG("RX_SAMPLE_DLY", DW_SPI_RX_SAMPLE_DLY),
 };
 
-static int dw_spi_debugfs_init(struct dw_spi *dws)
+static void dw_spi_debugfs_init(struct dw_spi *dws)
 {
 	char name[32];
 
 	snprintf(name, 32, "dw_spi%d", dws->master->bus_num);
 	dws->debugfs = debugfs_create_dir(name, NULL);
-	if (!dws->debugfs)
-		return -ENOMEM;
 
 	dws->regset.regs = dw_spi_dbgfs_regs;
 	dws->regset.nregs = ARRAY_SIZE(dw_spi_dbgfs_regs);
 	dws->regset.base = dws->regs;
 	debugfs_create_regset32("registers", 0400, dws->debugfs, &dws->regset);
 
-	return 0;
 }
 
 static void dw_spi_debugfs_remove(struct dw_spi *dws)
@@ -80,9 +77,8 @@ static void dw_spi_debugfs_remove(struct dw_spi *dws)
 }
 
 #else
-static inline int dw_spi_debugfs_init(struct dw_spi *dws)
+static inline void dw_spi_debugfs_init(struct dw_spi *dws)
 {
-	return 0;
 }
 
 static inline void dw_spi_debugfs_remove(struct dw_spi *dws)
-- 
2.34.1


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir
  2023-05-20 22:40 [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir Osama Muhammad
@ 2023-05-30 17:40 ` Mark Brown
  2023-05-30 21:14   ` Serge Semin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2023-05-30 17:40 UTC (permalink / raw)
  To: fancer.lancer, Osama Muhammad; +Cc: linux-spi, linux-kernel

On Sun, 21 May 2023 03:40:25 +0500, Osama Muhammad wrote:
> This patch fixes the error checking in spi-dw-core.c in
> debugfs_create_dir. The DebugFS kernel API is developed in
> a way that the caller can safely ignore the errors that
> occur during the creation of DebugFS nodes.
> 
> 

Applied to

   https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next

Thanks!

[1/1] spi-dw-core.c: Fix error checking for debugfs_create_dir
      commit: 0178f1e5d9845a31024eddd37e93a182e2dbab5d

All being well this means that it will be integrated into the linux-next
tree (usually sometime in the next 24 hours) and sent to Linus during
the next merge window (or sooner if it is a bug fix), however if
problems are discovered then the patch may be dropped or reverted.

You may get further e-mails resulting from automated or manual testing
and review of the tree, please engage with people reporting problems and
send followup patches addressing any issues that are reported if needed.

If any updates are required or you are submitting further changes they
should be sent as incremental updates against current git, existing
patches will not be replaced.

Please add any relevant lists and maintainers to the CCs when replying
to this mail.

Thanks,
Mark


^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir
  2023-05-30 17:40 ` Mark Brown
@ 2023-05-30 21:14   ` Serge Semin
  2023-05-30 21:16     ` Mark Brown
  0 siblings, 1 reply; 5+ messages in thread
From: Serge Semin @ 2023-05-30 21:14 UTC (permalink / raw)
  To: Mark Brown; +Cc: Osama Muhammad, linux-spi, linux-kernel

Hi Mark,

On Tue, May 30, 2023 at 06:40:51PM +0100, Mark Brown wrote:
> On Sun, 21 May 2023 03:40:25 +0500, Osama Muhammad wrote:
> > This patch fixes the error checking in spi-dw-core.c in
> > debugfs_create_dir. The DebugFS kernel API is developed in
> > a way that the caller can safely ignore the errors that
> > occur during the creation of DebugFS nodes.
> > 
> > 
> 

> Applied to
> 
>    https://git.kernel.org/pub/scm/linux/kernel/git/broonie/spi.git for-next
> 
> Thanks!
> 
> [1/1] spi-dw-core.c: Fix error checking for debugfs_create_dir
>       commit: 0178f1e5d9845a31024eddd37e93a182e2dbab5d

Oh, thanks. I've absolutely missed the respinned version of the patch
(it should have been marked as v2 though). Anyway the change looks
good except it introduces a redundant empty line at the tail of the
dw_spi_debugfs_init() function. Is it possible to rebase the branch
and drop the line it? If it's not I'll send an incremental cleanup
patch then.

-Serge(y)

> 
> All being well this means that it will be integrated into the linux-next
> tree (usually sometime in the next 24 hours) and sent to Linus during
> the next merge window (or sooner if it is a bug fix), however if
> problems are discovered then the patch may be dropped or reverted.
> 
> You may get further e-mails resulting from automated or manual testing
> and review of the tree, please engage with people reporting problems and
> send followup patches addressing any issues that are reported if needed.
> 
> If any updates are required or you are submitting further changes they
> should be sent as incremental updates against current git, existing
> patches will not be replaced.
> 
> Please add any relevant lists and maintainers to the CCs when replying
> to this mail.
> 
> Thanks,
> Mark
> 

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir
  2023-05-30 21:14   ` Serge Semin
@ 2023-05-30 21:16     ` Mark Brown
  2023-05-31 10:52       ` Serge Semin
  0 siblings, 1 reply; 5+ messages in thread
From: Mark Brown @ 2023-05-30 21:16 UTC (permalink / raw)
  To: Serge Semin; +Cc: Osama Muhammad, linux-spi, linux-kernel

[-- Attachment #1: Type: text/plain, Size: 476 bytes --]

On Wed, May 31, 2023 at 12:14:46AM +0300, Serge Semin wrote:

> Oh, thanks. I've absolutely missed the respinned version of the patch
> (it should have been marked as v2 though). Anyway the change looks
> good except it introduces a redundant empty line at the tail of the
> dw_spi_debugfs_init() function. Is it possible to rebase the branch
> and drop the line it? If it's not I'll send an incremental cleanup
> patch then.

I'd rather just take the incremental patch here.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 488 bytes --]

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir
  2023-05-30 21:16     ` Mark Brown
@ 2023-05-31 10:52       ` Serge Semin
  0 siblings, 0 replies; 5+ messages in thread
From: Serge Semin @ 2023-05-31 10:52 UTC (permalink / raw)
  To: Mark Brown; +Cc: Osama Muhammad, linux-spi, linux-kernel

On Tue, May 30, 2023 at 10:16:00PM +0100, Mark Brown wrote:
> On Wed, May 31, 2023 at 12:14:46AM +0300, Serge Semin wrote:
> 
> > Oh, thanks. I've absolutely missed the respinned version of the patch
> > (it should have been marked as v2 though). Anyway the change looks
> > good except it introduces a redundant empty line at the tail of the
> > dw_spi_debugfs_init() function. Is it possible to rebase the branch
> > and drop the line it? If it's not I'll send an incremental cleanup
> > patch then.
> 
> I'd rather just take the incremental patch here.

Done. Please find the cleanup patch here:
https://lore.kernel.org/linux-spi/20230530221725.26319-1-Sergey.Semin@baikalelectronics.ru

-Serge(y)


^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2023-05-31 10:53 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2023-05-20 22:40 [PATCH v1] spi-dw-core.c: Fix error checking for debugfs_create_dir Osama Muhammad
2023-05-30 17:40 ` Mark Brown
2023-05-30 21:14   ` Serge Semin
2023-05-30 21:16     ` Mark Brown
2023-05-31 10:52       ` Serge Semin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).