Staging: media: davinci_vpfe: Drop macros
Subsystems (2)
PATCH v3 1/1 Staging: media: davinci_vpfe: Drop macros
Drop macros instead use functions set_bit() and clear_bit directly.
---
Changes in v3:
- Drop inline functions and use functions
Changes in v2:
- Convert macros into inline functions
--- .../staging/media/davinci_vpfe/dm365_ipipeif.c | 16 ++++++++-------- .../staging/media/davinci_vpfe/dm365_ipipeif.h | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-)
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +8 -8
@@ -296,14 +296,14 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ;default : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -RESETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ; }
@@ -344,16 +344,16 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)switch (isif_port_if) {case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_YUYV10_1X20 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );break ;case MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 :case MEDIA_BUS_FMT_YUYV10_2X10 : -SETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT ); val |=IPIPEIF_CBCR_Y <<IPIPEIF_CFG2_YUV8P_SHIFT ;break ;
drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +0 -2
@@ -166,8 +166,6 @@ struct vpfe_ipipeif_device {#define IPIPEIF_RSZ_MIN 16#define IPIPEIF_RSZ_MAX 112#define IPIPEIF_RSZ_CONST 16 -#define SETBIT (reg, bit) (reg = ((reg) | ((0x00000001)<<(bit)))) -#define RESETBIT (reg, bit) (reg = ((reg) & (~(0x00000001<<(bit)))))#define IPIPEIF_ADOFS_LSB_MASK 0x1ff#define IPIPEIF_ADOFS_LSB_SHIFT 5
Signature · 1 line
2.17.1
Quoted 20 lines · Madhumitha Prabakaran
Drop macros instead use functions
set_bit()andclear_bitdirectly.Signed-off-by Madhumitha Prabakaran <[email protected]>---
Changes in v3:
- Drop inline functions and use functionsChanges in v2:
- Convert macros into inline functions--- .../staging/media/davinci_vpfe/dm365_ipipeif.c | 16 ++++++++-------- .../staging/media/davinci_vpfe/dm365_ipipeif.h | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-)drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +0
-0
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c static int ipipeif_hw_setup(struct v4l2_subdev *sd) · line 300
Quoted 7 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +2
-2@@ -296,14 +296,14 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );
I don't think that the arguments are in the right order. And one of the arguments does not have the right type. When I try to compile the result of applying this patch, it gives a lot of errors. You should ensure that a patch doesn't give errors or warnings before submitting it.
julia
Quoted 55 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +6
-6ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ;default : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -RESETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ; }@@ -344,16 +344,16 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)switch (isif_port_if) {case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_YUYV10_1X20 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );break ;case MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 :case MEDIA_BUS_FMT_YUYV10_2X10 : -SETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT ); val |=IPIPEIF_CBCR_Y <<IPIPEIF_CFG2_YUV8P_SHIFT ;break ;drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +0
-3@@ -166,8 +166,6 @@ struct vpfe_ipipeif_device {#define IPIPEIF_RSZ_MIN 16#define IPIPEIF_RSZ_MAX 112#define IPIPEIF_RSZ_CONST 16 -#define SETBIT (reg, bit) (reg = ((reg) | ((0x00000001)<<(bit)))) -#define RESETBIT (reg, bit) (reg = ((reg) & (~(0x00000001<<(bit)))))#define IPIPEIF_ADOFS_LSB_MASK 0x1ff#define IPIPEIF_ADOFS_LSB_SHIFT 5 --2.17.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322214534.24852-1-madhumithabiw%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 28 lines · Julia Lawall
Quoted 24 lines · Madhumitha Prabakaran
Drop macros instead use functions
set_bit()andclear_bitdirectly.Signed-off-by Madhumitha Prabakaran <[email protected]>---
Changes in v3:
- Drop inline functions and use functionsChanges in v2:
- Convert macros into inline functions--- .../staging/media/davinci_vpfe/dm365_ipipeif.c | 16 ++++++++-------- .../staging/media/davinci_vpfe/dm365_ipipeif.h | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-)drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +0
-1@@ -296,14 +296,14 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT );
Quoted 8 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c static int ipipeif_hw_setup(struct v4l2_subdev *sd) · line 300
Quoted 3 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +2
-1-SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );I don't think that the arguments are in the right order. And one of the arguments does not have the right type. When I try to compile the result of applying this patch, it gives a lot of errors. You should ensure that a patch doesn't give errors or warnings before submitting it.
Perhaps, in menuconfig, I couldn't able to configure particular driver. So, when I build it, it showed no error. I assume, I don't have support for that driver.
thanks
Quoted 58 lines
julia
Quoted 55 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +6
-6ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ;default : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -RESETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ; }@@ -344,16 +344,16 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)switch (isif_port_if) {case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_YUYV10_1X20 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );break ;case MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 :case MEDIA_BUS_FMT_YUYV10_2X10 : -SETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT ); val |=IPIPEIF_CBCR_Y <<IPIPEIF_CFG2_YUV8P_SHIFT ;break ;drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +0
-3@@ -166,8 +166,6 @@ struct vpfe_ipipeif_device {#define IPIPEIF_RSZ_MIN 16#define IPIPEIF_RSZ_MAX 112#define IPIPEIF_RSZ_CONST 16 -#define SETBIT (reg, bit) (reg = ((reg) | ((0x00000001)<<(bit)))) -#define RESETBIT (reg, bit) (reg = ((reg) & (~(0x00000001<<(bit)))))#define IPIPEIF_ADOFS_LSB_MASK 0x1ff#define IPIPEIF_ADOFS_LSB_SHIFT 5 --2.17.1
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322214534.24852-1-madhumithabiw%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Quoted 38 lines · Madhumthia Prabakaran
Quoted 28 lines · Julia Lawall
Quoted 24 lines · Madhumitha Prabakaran
Drop macros instead use functions
set_bit()andclear_bitdirectly.Signed-off-by Madhumitha Prabakaran <[email protected]>---
Changes in v3:
- Drop inline functions and use functionsChanges in v2:
- Convert macros into inline functions--- .../staging/media/davinci_vpfe/dm365_ipipeif.c | 16 ++++++++-------- .../staging/media/davinci_vpfe/dm365_ipipeif.h | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-)drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +0
-1@@ -296,14 +296,14 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT );Quoted 8 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c static int ipipeif_hw_setup(struct v4l2_subdev *sd) · line 300
Quoted 3 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +2
-1-SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );I don't think that the arguments are in the right order. And one of the arguments does not have the right type. When I try to compile the result of applying this patch, it gives a lot of errors. You should ensure that a patch doesn't give errors or warnings before submitting it.
Quoted 3 lines
Perhaps, in menuconfig, I couldn't able to configure particular driver. So, when I build it, it showed no error. I assume, I don't have support for that driver.
Do you get a .o file for the .c file you changed? I did make allyesconfig and then make drivers/staging/media/davinci_vpfe/dm365_ipipeif.o
julia
Quoted 68 lines
thanks
Quoted 51 lines
julia
Quoted 48 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +6
-6ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ;default : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -RESETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ; }@@ -344,16 +344,16 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)switch (isif_port_if) {case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_YUYV10_1X20 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );break ;case MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 :case MEDIA_BUS_FMT_YUYV10_2X10 : -SETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT ); val |=IPIPEIF_CBCR_Y <<IPIPEIF_CFG2_YUV8P_SHIFT ;break ;drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +0
-3@@ -166,8 +166,6 @@ struct vpfe_ipipeif_device {#define IPIPEIF_RSZ_MIN 16#define IPIPEIF_RSZ_MAX 112#define IPIPEIF_RSZ_CONST 16 -#define SETBIT (reg, bit) (reg = ((reg) | ((0x00000001)<<(bit)))) -#define RESETBIT (reg, bit) (reg = ((reg) & (~(0x00000001<<(bit)))))#define IPIPEIF_ADOFS_LSB_MASK 0x1ff#define IPIPEIF_ADOFS_LSB_SHIFT 5 --2.17.1
Quoted 7 lines
Quoted 7 lines
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322214534.24852-1-madhumithabiw%40gmail.com.
For more options, visit https://groups.google.com/d/optout.--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322225705.GA9278%40madhuleo.
For more options, visit https://groups.google.com/d/optout.
Quoted 42 lines · Julia Lawall
Quoted 38 lines · Madhumthia Prabakaran
Quoted 36 lines · Julia Lawall
Quoted 20 lines · Madhumitha Prabakaran
Drop macros instead use functions
set_bit()andclear_bitdirectly.Signed-off-by Madhumitha Prabakaran <[email protected]>---
Changes in v3:
- Drop inline functions and use functionsChanges in v2:
- Convert macros into inline functions--- .../staging/media/davinci_vpfe/dm365_ipipeif.c | 16 ++++++++-------- .../staging/media/davinci_vpfe/dm365_ipipeif.h | 2 -- 2 files changed, 8 insertions(+), 10 deletions(-)drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +0
-0drivers/staging/media/davinci_vpfe/dm365_ipipeif.c static int ipipeif_hw_setup(struct v4l2_subdev *sd) · line 300
Quoted 7 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +2
-2@@ -296,14 +296,14 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );I don't think that the arguments are in the right order. And one of the arguments does not have the right type. When I try to compile the result of applying this patch, it gives a lot of errors. You should ensure that a patch doesn't give errors or warnings before submitting it.
Quoted 8 lines
Quoted 3 lines
Perhaps, in menuconfig, I couldn't able to configure particular driver. So, when I build it, it showed no error. I assume, I don't have support for that driver.
Do you get a .o file for the .c file you changed? I did make allyesconfig and then make
drivers/staging/media/davinci_vpfe/dm365_ipipeif.ojulia
I didn't get the .o file. I will fix and resend the patch.
thanks
Quoted 69 lines
Quoted 69 lines
thanks
Quoted 51 lines
julia
Quoted 48 lines
drivers/staging/media/davinci_vpfe/dm365_ipipeif.c +6
-6ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ;default : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -RESETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );ipipeif_write (val, ipipeif_base_addr,IPIPEIF_CFG2 );break ; }@@ -344,16 +344,16 @@ static int ipipeif_hw_setup(struct v4l2_subdev *sd)switch (isif_port_if) {case MEDIA_BUS_FMT_YUYV8_1X16 :case MEDIA_BUS_FMT_YUYV10_1X20 : -RESETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +clear_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT );break ;case MEDIA_BUS_FMT_YUYV8_2X8 :case MEDIA_BUS_FMT_UYVY8_2X8 :case MEDIA_BUS_FMT_Y8_1X8 :case MEDIA_BUS_FMT_YUYV10_2X10 : -SETBIT (val,IPIPEIF_CFG2_YUV8_SHIFT ); -SETBIT (val,IPIPEIF_CFG2_YUV16_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV8_SHIFT ); +set_bit (val,IPIPEIF_CFG2_YUV16_SHIFT ); val |=IPIPEIF_CBCR_Y <<IPIPEIF_CFG2_YUV8P_SHIFT ;break ;drivers/staging/media/davinci_vpfe/dm365_ipipeif.h +0
-3@@ -166,8 +166,6 @@ struct vpfe_ipipeif_device {#define IPIPEIF_RSZ_MIN 16#define IPIPEIF_RSZ_MAX 112#define IPIPEIF_RSZ_CONST 16 -#define SETBIT (reg, bit) (reg = ((reg) | ((0x00000001)<<(bit)))) -#define RESETBIT (reg, bit) (reg = ((reg) & (~(0x00000001<<(bit)))))#define IPIPEIF_ADOFS_LSB_MASK 0x1ff#define IPIPEIF_ADOFS_LSB_SHIFT 5 --2.17.1
Quoted 7 lines
Quoted 7 lines
--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322214534.24852-1-madhumithabiw%40gmail.com.
For more options, visit https://groups.google.com/d/optout.--
You received this message because you are subscribed to the Google Groups "outreachy-kernel" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected].
To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/20190322225705.GA9278%40madhuleo.
For more options, visit https://groups.google.com/d/optout.