diff --git a/scst/include/backport.h b/scst/include/backport.h index b3af751fb..f322549a9 100644 --- a/scst/include/backport.h +++ b/scst/include/backport.h @@ -404,7 +404,7 @@ static inline u32 int_sqrt64(u64 x) u32 r = 0, s; int i; - for (i = 8 * sizeof(r) - 2; i >= 0;i --) { + for (i = 8 * sizeof(r) - 2; i >= 0; i--) { s = r + (1 << i); if (1ll * s * s <= x) r = s; @@ -788,7 +788,10 @@ struct t10_pi_tuple { } while (0) #endif -/* See also commit 1d27e3e2252b ("timer: Remove expires and data arguments from DEFINE_TIMER") */ +/* + * See also commit 1d27e3e2252b ("timer: Remove expires and data arguments + * from DEFINE_TIMER"). + */ #if LINUX_VERSION_CODE < KERNEL_VERSION(4, 15, 0) #undef DEFINE_TIMER #define DEFINE_TIMER(_name, _function) \ diff --git a/scst/include/scst.h b/scst/include/scst.h index 78db4aa06..1679a492d 100644 --- a/scst/include/scst.h +++ b/scst/include/scst.h @@ -71,14 +71,54 @@ #endif #ifdef NOLOCKDEP_SUPPORTED -#define spin_lock_nolockdep(lock) do { current->nolockdep_call = 1; spin_lock(lock); current->nolockdep_call = 0; } while (0) -#define spin_unlock_nolockdep(lock) do { current->nolockdep_call = 1; spin_unlock(lock); current->nolockdep_call = 0; } while (0) -#define mutex_lock_nolockdep(lock) do { current->nolockdep_call = 1; mutex_lock(lock); current->nolockdep_call = 0; } while (0) -#define mutex_unlock_nolockdep(lock) do { current->nolockdep_call = 1; mutex_unlock(lock); current->nolockdep_call = 0; } while (0) -#define down_read_nolockdep(lock) do { current->nolockdep_call = 1; down_read(lock); current->nolockdep_call = 0; } while (0) -#define up_read_nolockdep(lock) do { current->nolockdep_call = 1; up_read(lock); current->nolockdep_call = 0; } while (0) -#define down_write_nolockdep(lock) do { current->nolockdep_call = 1; down_write(lock); current->nolockdep_call = 0; } while (0) -#define up_write_nolockdep(lock) do { current->nolockdep_call = 1; up_write(lock); current->nolockdep_call = 0; } while (0) +#define spin_lock_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + spin_lock(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define spin_unlock_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + spin_unlock(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define mutex_lock_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + mutex_lock(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define mutex_unlock_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + mutex_unlock(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define down_read_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + down_read(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define up_read_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + up_read(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define down_write_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + down_write(lock); \ + current->nolockdep_call = 0; \ + } while (0) +#define up_write_nolockdep(lock) \ + do { \ + current->nolockdep_call = 1; \ + up_write(lock); \ + current->nolockdep_call = 0; \ + } while (0) #else #define spin_lock_nolockdep spin_lock #define spin_unlock_nolockdep spin_unlock