diff mbox series

[v2,05/10] iio: Remove a cast in iio-test-format which is no longer required

Message ID 20210513193204.816681-5-davidgow@google.com (mailing list archive)
State Accepted
Headers show
Series [v2,01/10] kunit: Do not typecheck binary assertions | expand

Commit Message

David Gow May 13, 2021, 7:31 p.m. UTC
KUnit's EXPECT macros no longer typecheck as stringently, so casting the
result of strcmp() is now unnecessary.

Signed-off-by: David Gow <davidgow@google.com>
---
This should be a no-op functionality wise, and while it depends on the
first couple of patches in this series, it's otherwise independent from
the others. I think this makes the test more readable, but if you
particularly dislike it, I'm happy to drop it.

 drivers/iio/test/iio-test-format.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Brendan Higgins June 15, 2021, 8:14 p.m. UTC | #1
On Thu, May 13, 2021 at 12:36 PM David Gow <davidgow@google.com> wrote:
>
> KUnit's EXPECT macros no longer typecheck as stringently, so casting the
> result of strcmp() is now unnecessary.
>
> Signed-off-by: David Gow <davidgow@google.com>

Reviewed-by: Brendan Higgins <brendanhiggins@google.com>
Jonathan Cameron June 16, 2021, 2:08 p.m. UTC | #2
On Tue, 15 Jun 2021 13:14:44 -0700
Brendan Higgins <brendanhiggins@google.com> wrote:

> On Thu, May 13, 2021 at 12:36 PM David Gow <davidgow@google.com> wrote:
> >
> > KUnit's EXPECT macros no longer typecheck as stringently, so casting the
> > result of strcmp() is now unnecessary.
> >
> > Signed-off-by: David Gow <davidgow@google.com>  
> 
> Reviewed-by: Brendan Higgins <brendanhiggins@google.com>

Seems sensible

Acked-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
diff mbox series

Patch

diff --git a/drivers/iio/test/iio-test-format.c b/drivers/iio/test/iio-test-format.c
index 55a0cfe9181d..f1e951eddb43 100644
--- a/drivers/iio/test/iio-test-format.c
+++ b/drivers/iio/test/iio-test-format.c
@@ -8,7 +8,7 @@ 
 #include <linux/iio/iio.h>
 
 #define IIO_TEST_FORMAT_EXPECT_EQ(_test, _buf, _ret, _val) do { \
-		KUNIT_EXPECT_EQ(_test, (int)strlen(_buf), _ret); \
+		KUNIT_EXPECT_EQ(_test, strlen(_buf), _ret); \
 		KUNIT_EXPECT_STREQ(_test, (_buf), (_val)); \
 	} while (0)