2020-12-01 22:11:10

by Finn Thain

[permalink] [raw]
Subject: [PATCH] scsi/NCR5380: Remove in_interrupt() test

The in_interrupt() macro is deprecated. Also, it's usage in
NCR5380_poll_politely2() has long been redundant.

Cc: Sebastian Andrzej Siewior <[email protected]>
Cc: Ahmed S. Darwish <[email protected]>
Cc: Thomas Gleixner <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Finn Thain <[email protected]>
---
drivers/scsi/NCR5380.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
index 462d911a89f2..6972e7ceb81a 100644
--- a/drivers/scsi/NCR5380.c
+++ b/drivers/scsi/NCR5380.c
@@ -223,7 +223,10 @@ static int NCR5380_poll_politely2(struct NCR5380_hostdata *hostdata,
cpu_relax();
} while (n--);

- if (irqs_disabled() || in_interrupt())
+ /* Sleeping is not allowed when in atomic or interrupt contexts.
+ * Callers in such contexts always disable local irqs.
+ */
+ if (irqs_disabled())
return -ETIMEDOUT;

/* Repeatedly sleep for 1 ms until deadline */
--
2.26.2


2020-12-01 22:39:28

by Michael Schmitz

[permalink] [raw]
Subject: Re: [PATCH] scsi/NCR5380: Remove in_interrupt() test

Hi Finn,

works fine, thanks!

Tested-By: Michael Schmitz <[email protected]>


On 1/12/20 7:46 PM, Finn Thain wrote:
> The in_interrupt() macro is deprecated. Also, it's usage in
> NCR5380_poll_politely2() has long been redundant.
>
> Cc: Sebastian Andrzej Siewior <[email protected]>
> Cc: Ahmed S. Darwish <[email protected]>
> Cc: Thomas Gleixner <[email protected]>
> Link: https://lore.kernel.org/r/[email protected]
> Signed-off-by: Finn Thain <[email protected]>
> ---
> drivers/scsi/NCR5380.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/scsi/NCR5380.c b/drivers/scsi/NCR5380.c
> index 462d911a89f2..6972e7ceb81a 100644
> --- a/drivers/scsi/NCR5380.c
> +++ b/drivers/scsi/NCR5380.c
> @@ -223,7 +223,10 @@ static int NCR5380_poll_politely2(struct NCR5380_hostdata *hostdata,
> cpu_relax();
> } while (n--);
>
> - if (irqs_disabled() || in_interrupt())
> + /* Sleeping is not allowed when in atomic or interrupt contexts.
> + * Callers in such contexts always disable local irqs.
> + */
> + if (irqs_disabled())
> return -ETIMEDOUT;
>
> /* Repeatedly sleep for 1 ms until deadline */