skd: fix assert typo
PATCH 1/1 skd: fix assert typo
--- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/skd_main.c +2 -2
@@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev,break ;default : -SKD_ASSERT ("Don't know what to send" ); +SKD_ASSERT (!"Don't know what to send" );return ; }
@@ -2105,7 +2105,7 @@ static void skd_complete_internal(struct skd_device *skdev,break ;default : -SKD_ASSERT ("we didn't send this" ); +SKD_ASSERT (!"we didn't send this" ); } }
Signature · 2 lines
Cheers, Eric
Quoted 10 lines · Eric Engestrom
Signed-off-by Eric Engestrom <[email protected]>--- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/skd_main.c +0
-0
drivers/block/skd_main.c static void skd_send_internal_skspcl(struct skd_device *skdev, · line 1908
Quoted 5 lines
drivers/block/skd_main.c +1
-1@@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev,break ;default : -SKD_ASSERT ("Don't know what to send" ); +SKD_ASSERT (!"Don't know what to send" );
That's perverse. Just change SKD_ASSERT to pr_err and Robert's your mother's brother.
Cheers,
Jeff
PATCH v2 1/1 skd: fix assert typo
The assert was missing a ! to become active, but since that would only turn it into a complicated codepath for a pr_err(), let's simply replace it.
--- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/block/skd_main.c +2 -2
@@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev,break ;default : -SKD_ASSERT ("Don't know what to send" ); +pr_err ("Don't know what to send" );return ; }
@@ -2105,7 +2105,7 @@ static void skd_complete_internal(struct skd_device *skdev,break ;default : -SKD_ASSERT ("we didn't send this" ); +pr_err ("we didn't send this" ); } }
Signature · 2 lines
Cheers, Eric
Quoted 6 lines · Eric Engestrom
The assert was missing a
!to become active, but since that would only turn it into a complicated codepath for apr_err(), let's simply replace it.CC Jeff Moyer <[email protected]>Signed-off-by Eric Engestrom <[email protected]>---
Looks ok,
Signature · 6 lines
Johannes Thumshirn Storage [email protected] +49 911 74053 689 SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg GF: Felix Imendörffer, Jane Smithard, Graham Norton HRB 21284 (AG Nürnberg) Key fingerprint = EC38 9CAB C2C4 F25D 8600 D0D0 0393 969D 2D76 0850
Quoted 2 lines · Eric Engestrom
The assert was missing a
!to become active, but since that would only turn it into a complicated codepath for apr_err(), let's simply replace it.
The skd assert macro prints out file and line number, which would have been nice to keep. Sorry I didn't explicitly mention that last time.
-Jeff
Quoted 28 lines
CC Jeff Moyer <[email protected]>Signed-off-by Eric Engestrom <[email protected]>--- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/skd_main.c +2
-2@@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev,break ;default : -SKD_ASSERT ("Don't know what to send" ); +pr_err ("Don't know what to send" );return ; }@@ -2105,7 +2105,7 @@ static void skd_complete_internal(struct skd_device *skdev,break ;default : -SKD_ASSERT ("we didn't send this" ); +pr_err ("we didn't send this" ); } }
Quoted 7 lines · Jeff Moyer
Quoted 2 lines · Eric Engestrom
The assert was missing a
!to become active, but since that would only turn it into a complicated codepath for apr_err(), let's simply replace it.The skd assert macro prints out file and line number, which would have been nice to keep. Sorry I didn't explicitly mention that last time.
I'm not a fan of duplicating code, so if you want to keep the SKD_ASSERT() format, my suggestion would be to go with the v1 of this patch. It might end up having an if that will always be true, but the compiler will most likely take care of optimising that away :)
Cheers,
Eric
Quoted 31 lines
-Jeff
Quoted 28 lines
CC Jeff Moyer <[email protected]>Signed-off-by Eric Engestrom <[email protected]>--- drivers/block/skd_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/block/skd_main.c +2
-2@@ -1905,7 +1905,7 @@ static void skd_send_internal_skspcl(struct skd_device *skdev,break ;default : -SKD_ASSERT ("Don't know what to send" ); +pr_err ("Don't know what to send" );return ; }@@ -2105,7 +2105,7 @@ static void skd_complete_internal(struct skd_device *skdev,break ;default : -SKD_ASSERT ("we didn't send this" ); +pr_err ("we didn't send this" ); } }