* [PATCH 0/2] staging: zoran: replace bit mask and fix styling
@ 2018-11-05 14:13 Ioannis Valasakis
2018-11-05 14:13 ` [PATCH 1/2] staging: zoran: replace masking with BIT macro Ioannis Valasakis
2018-11-05 14:13 ` [PATCH 2/2] staging: zoran: remove unnecessary braces Ioannis Valasakis
0 siblings, 2 replies; 4+ messages in thread
From: Ioannis Valasakis @ 2018-11-05 14:13 UTC (permalink / raw)
To: outreachy-kernel; +Cc: gregkh
staging: zoran: replace bit mask and fix styling issues reported by
checkpatch.
Ioannis Valasakis (2):
staging: zoran: replace masking with BIT macro
staging: zoran: remove unnecessary braces
drivers/staging/media/zoran/zoran_device.c | 14 ++++++--------
1 file changed, 6 insertions(+), 8 deletions(-)
--
2.19.1
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] staging: zoran: replace masking with BIT macro
2018-11-05 14:13 [PATCH 0/2] staging: zoran: replace bit mask and fix styling Ioannis Valasakis
@ 2018-11-05 14:13 ` Ioannis Valasakis
2018-11-05 14:17 ` [Outreachy kernel] " Julia Lawall
2018-11-05 14:13 ` [PATCH 2/2] staging: zoran: remove unnecessary braces Ioannis Valasakis
1 sibling, 1 reply; 4+ messages in thread
From: Ioannis Valasakis @ 2018-11-05 14:13 UTC (permalink / raw)
To: outreachy-kernel; +Cc: gregkh
Replace bit masking with the more preferable BIT macro.
Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
---
drivers/staging/media/zoran/zoran_device.c | 12 ++++++------
1 file changed, 6 insertions(+), 6 deletions(-)
diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c
index 40adceebca7e..1e6782b72369 100644
--- a/drivers/staging/media/zoran/zoran_device.c
+++ b/drivers/staging/media/zoran/zoran_device.c
@@ -92,7 +92,7 @@ GPIO (struct zoran *zr,
/* Make sure the bit number is legal
* A bit number of -1 (lacking) gives a mask of 0,
* making it harmless */
- mask = (1 << (24 + bit)) & 0xff000000;
+ mask = (BIT((24 + bit))) & 0xff000000;
reg = btread(ZR36057_GPPGCR1) & ~mask;
if (value) {
reg |= mask;
@@ -285,8 +285,8 @@ zr36057_adjust_vfe (struct zoran *zr,
case BUZ_MODE_MOTION_DECOMPRESS:
btand(~ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
reg = btread(ZR36057_VFEHCR);
- if ((reg & (1 << 10)) && zr->card.type != LML33R10) {
- reg += ((1 << 10) | 1);
+ if ((reg & (BIT(10))) && zr->card.type != LML33R10) {
+ reg += ((BIT(10)) | 1);
}
btwrite(reg, ZR36057_VFEHCR);
break;
@@ -300,8 +300,8 @@ zr36057_adjust_vfe (struct zoran *zr,
else
btor(ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
reg = btread(ZR36057_VFEHCR);
- if (!(reg & (1 << 10)) && zr->card.type != LML33R10) {
- reg -= ((1 << 10) | 1);
+ if (!(reg & (BIT(10))) && zr->card.type != LML33R10) {
+ reg -= ((BIT(10)) | 1);
}
btwrite(reg, ZR36057_VFEHCR);
break;
@@ -407,7 +407,7 @@ zr36057_set_vfe (struct zoran *zr,
} else if (HorDcm >= 32) {
reg |= 2 << ZR36057_VFESPFR_HFilter; /* 4 tap filter */
} else if (HorDcm >= 16) {
- reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */
+ reg |= BIT(ZR36057_VFESPFR_HFilter); /* 3 tap filter */
}
reg |= format->vfespfr;
btwrite(reg, ZR36057_VFESPFR);
--
2.19.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] staging: zoran: remove unnecessary braces
2018-11-05 14:13 [PATCH 0/2] staging: zoran: replace bit mask and fix styling Ioannis Valasakis
2018-11-05 14:13 ` [PATCH 1/2] staging: zoran: replace masking with BIT macro Ioannis Valasakis
@ 2018-11-05 14:13 ` Ioannis Valasakis
1 sibling, 0 replies; 4+ messages in thread
From: Ioannis Valasakis @ 2018-11-05 14:13 UTC (permalink / raw)
To: outreachy-kernel; +Cc: gregkh
Braces are not necessary for single statement blocks therefore there
were removed. Reported by checkpatch.
Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
---
drivers/staging/media/zoran/zoran_device.c | 6 ++----
1 file changed, 2 insertions(+), 4 deletions(-)
diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c
index 1e6782b72369..47214e2de04c 100644
--- a/drivers/staging/media/zoran/zoran_device.c
+++ b/drivers/staging/media/zoran/zoran_device.c
@@ -285,9 +285,8 @@ zr36057_adjust_vfe (struct zoran *zr,
case BUZ_MODE_MOTION_DECOMPRESS:
btand(~ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
reg = btread(ZR36057_VFEHCR);
- if ((reg & (BIT(10))) && zr->card.type != LML33R10) {
+ if ((reg & (BIT(10))) && zr->card.type != LML33R10)
reg += ((BIT(10)) | 1);
- }
btwrite(reg, ZR36057_VFEHCR);
break;
case BUZ_MODE_MOTION_COMPRESS:
@@ -300,9 +299,8 @@ zr36057_adjust_vfe (struct zoran *zr,
else
btor(ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
reg = btread(ZR36057_VFEHCR);
- if (!(reg & (BIT(10))) && zr->card.type != LML33R10) {
+ if (!(reg & (BIT(10))) && zr->card.type != LML33R10)
reg -= ((BIT(10)) | 1);
- }
btwrite(reg, ZR36057_VFEHCR);
break;
}
--
2.19.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Outreachy kernel] [PATCH 1/2] staging: zoran: replace masking with BIT macro
2018-11-05 14:13 ` [PATCH 1/2] staging: zoran: replace masking with BIT macro Ioannis Valasakis
@ 2018-11-05 14:17 ` Julia Lawall
0 siblings, 0 replies; 4+ messages in thread
From: Julia Lawall @ 2018-11-05 14:17 UTC (permalink / raw)
To: Ioannis Valasakis; +Cc: outreachy-kernel, gregkh
On Mon, 5 Nov 2018, Ioannis Valasakis wrote:
> Replace bit masking with the more preferable BIT macro.
>
> Signed-off-by: Ioannis Valasakis <code@wizofe.uk>
> ---
> drivers/staging/media/zoran/zoran_device.c | 12 ++++++------
> 1 file changed, 6 insertions(+), 6 deletions(-)
>
> diff --git a/drivers/staging/media/zoran/zoran_device.c b/drivers/staging/media/zoran/zoran_device.c
> index 40adceebca7e..1e6782b72369 100644
> --- a/drivers/staging/media/zoran/zoran_device.c
> +++ b/drivers/staging/media/zoran/zoran_device.c
> @@ -92,7 +92,7 @@ GPIO (struct zoran *zr,
> /* Make sure the bit number is legal
> * A bit number of -1 (lacking) gives a mask of 0,
> * making it harmless */
> - mask = (1 << (24 + bit)) & 0xff000000;
> + mask = (BIT((24 + bit))) & 0xff000000;
> reg = btread(ZR36057_GPPGCR1) & ~mask;
> if (value) {
> reg |= mask;
> @@ -285,8 +285,8 @@ zr36057_adjust_vfe (struct zoran *zr,
> case BUZ_MODE_MOTION_DECOMPRESS:
> btand(~ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
> reg = btread(ZR36057_VFEHCR);
> - if ((reg & (1 << 10)) && zr->card.type != LML33R10) {
> - reg += ((1 << 10) | 1);
> + if ((reg & (BIT(10))) && zr->card.type != LML33R10) {
> + reg += ((BIT(10)) | 1);
Theer is no need for parentheses around a call to BIT.
julia
> }
> btwrite(reg, ZR36057_VFEHCR);
> break;
> @@ -300,8 +300,8 @@ zr36057_adjust_vfe (struct zoran *zr,
> else
> btor(ZR36057_VFESPFR_ExtFl, ZR36057_VFESPFR);
> reg = btread(ZR36057_VFEHCR);
> - if (!(reg & (1 << 10)) && zr->card.type != LML33R10) {
> - reg -= ((1 << 10) | 1);
> + if (!(reg & (BIT(10))) && zr->card.type != LML33R10) {
> + reg -= ((BIT(10)) | 1);
> }
> btwrite(reg, ZR36057_VFEHCR);
> break;
> @@ -407,7 +407,7 @@ zr36057_set_vfe (struct zoran *zr,
> } else if (HorDcm >= 32) {
> reg |= 2 << ZR36057_VFESPFR_HFilter; /* 4 tap filter */
> } else if (HorDcm >= 16) {
> - reg |= 1 << ZR36057_VFESPFR_HFilter; /* 3 tap filter */
> + reg |= BIT(ZR36057_VFESPFR_HFilter); /* 3 tap filter */
> }
> reg |= format->vfespfr;
> btwrite(reg, ZR36057_VFESPFR);
> --
> 2.19.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 outreachy-kernel+unsubscribe@googlegroups.com.
> To post to this group, send email to outreachy-kernel@googlegroups.com.
> To view this discussion on the web visit https://groups.google.com/d/msgid/outreachy-kernel/f5cb20814f9f4ce4d4de2b1b5b972aca741eafd2.1541427136.git.code%40wizofe.uk.
> For more options, visit https://groups.google.com/d/optout.
>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-05 14:17 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-11-05 14:13 [PATCH 0/2] staging: zoran: replace bit mask and fix styling Ioannis Valasakis
2018-11-05 14:13 ` [PATCH 1/2] staging: zoran: replace masking with BIT macro Ioannis Valasakis
2018-11-05 14:17 ` [Outreachy kernel] " Julia Lawall
2018-11-05 14:13 ` [PATCH 2/2] staging: zoran: remove unnecessary braces Ioannis Valasakis
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.