are you looking for email marketing?

2015-04-02 Thread Martin

Hi,

You are receiving this email because we wish you to use our target email
marketing service.

Email marketing is one of the best marketing strategies of all time and has
helped many businesses
globally achieve their goals, double their profits and increase their
client base.

We have worked on a number of projects and campaigns, all our packages are
tailor made and designed according to your requirements.
Increase your client base and market your product to millions or let us
bring the buying leads for you!
We can always help your business reach the next level!
Our goal is to increase your business sales 2-5 times than now.

If you would require more information please send us an email and we would
be glad to discuss the project requirements with you!
Looking forward to your positive response.

Kind Regards
Martin
Email Marketing Specialist
Contact: talo...@tom.com

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: skein: Remove extra blank lines

2016-09-26 Thread Martin
Fix coding style issue "multiple blank lines" 
detected by checkpatch.pl in threefish_block.c file.

Signed-off-by: Martin 
---
 drivers/staging/skein/threefish_block.c | 16 
 1 file changed, 16 deletions(-)

diff --git a/drivers/staging/skein/threefish_block.c 
b/drivers/staging/skein/threefish_block.c
index a95563f..5064065 100644
--- a/drivers/staging/skein/threefish_block.c
+++ b/drivers/staging/skein/threefish_block.c
@@ -64,7 +64,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, u64 
*input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k3 + t2;
b0 += b1 + k2;
b1 = rol64(b1, 14) ^ b0;
@@ -117,7 +116,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k0 + t1;
b0 += b1 + k4;
b1 = rol64(b1, 14) ^ b0;
@@ -170,7 +168,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k2 + t0;
b0 += b1 + k1;
b1 = rol64(b1, 14) ^ b0;
@@ -223,7 +220,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k4 + t2;
b0 += b1 + k3;
b1 = rol64(b1, 14) ^ b0;
@@ -276,7 +272,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k1 + t1;
b0 += b1 + k0;
b1 = rol64(b1, 14) ^ b0;
@@ -329,7 +324,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k3 + t0;
b0 += b1 + k2;
b1 = rol64(b1, 14) ^ b0;
@@ -382,7 +376,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k0 + t2;
b0 += b1 + k4;
b1 = rol64(b1, 14) ^ b0;
@@ -435,7 +428,6 @@ void threefish_encrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 += b1;
b1 = rol64(b1, 32) ^ b2;
 
-
b1 += k2 + t1;
b0 += b1 + k1;
b1 = rol64(b1, 14) ^ b0;
@@ -579,7 +571,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k3 + t2;
b3 -= k4 + 16;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -648,7 +639,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k1 + t0;
b3 -= k2 + 14;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -717,7 +707,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k4 + t1;
b3 -= k0 + 12;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -786,7 +775,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k2 + t2;
b3 -= k3 + 10;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -855,7 +843,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k0 + t0;
b3 -= k1 + 8;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -924,7 +911,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k3 + t1;
b3 -= k4 + 6;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -993,7 +979,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k1 + t2;
b3 -= k2 + 4;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
@@ -1062,7 +1047,6 @@ void threefish_decrypt_256(struct threefish_key *key_ctx, 
u64 *input,
b2 -= b3 + k4 + t0;
b3 -= k0 + 2;
 
-
tmp = b3 ^ b0;
b3 = ror64(tmp, 32);
b0 -= b3;
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: Add Edimax EW-7811UN V2 to device table

2021-02-04 Thread Martin Kaiser
The Edimax EW-7811UN V2 uses an RTL8188EU chipset and works with this
driver.

Signed-off-by: Martin Kaiser 
---
 drivers/staging/rtl8188eu/os_dep/usb_intf.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/rtl8188eu/os_dep/usb_intf.c 
b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
index 43ebd11b53fe..efad43d8e465 100644
--- a/drivers/staging/rtl8188eu/os_dep/usb_intf.c
+++ b/drivers/staging/rtl8188eu/os_dep/usb_intf.c
@@ -41,6 +41,7 @@ static const struct usb_device_id rtw_usb_id_tbl[] = {
{USB_DEVICE(0x2357, 0x0111)}, /* TP-Link TL-WN727N v5.21 */
{USB_DEVICE(0x2C4E, 0x0102)}, /* MERCUSYS MW150US v2 */
{USB_DEVICE(0x0df6, 0x0076)}, /* Sitecom N150 v2 */
+   {USB_DEVICE(0x7392, 0xb811)}, /* Edimax EW-7811UN V2 */
{USB_DEVICE(USB_VENDER_ID_REALTEK, 0xffef)}, /* Rosewill RNX-N150NUB */
{}  /* Terminating entry */
 };
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: use netdev routines for private data

2021-03-21 Thread Martin Kaiser
This driver implements its own routines to allocate, access and free the
private data of its net_device. Use the functionality from the networking
core instead.

Signed-off-by: Martin Kaiser 
---
 drivers/staging/rtl8188eu/core/rtw_debug.c|  8 +-
 drivers/staging/rtl8188eu/core/rtw_pwrctrl.c  |  2 +-
 drivers/staging/rtl8188eu/core/rtw_xmit.c |  5 +-
 .../staging/rtl8188eu/include/osdep_intf.h|  2 +-
 .../staging/rtl8188eu/include/osdep_service.h | 13 ---
 .../staging/rtl8188eu/os_dep/ioctl_linux.c| 88 +--
 drivers/staging/rtl8188eu/os_dep/os_intfs.c   | 22 +++--
 .../staging/rtl8188eu/os_dep/osdep_service.c  | 31 ---
 .../staging/rtl8188eu/os_dep/rtw_android.c|  6 +-
 drivers/staging/rtl8188eu/os_dep/usb_intf.c   | 27 +++---
 drivers/staging/rtl8188eu/os_dep/xmit_linux.c |  2 +-
 11 files changed, 78 insertions(+), 128 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_debug.c 
b/drivers/staging/rtl8188eu/core/rtw_debug.c
index 11198d43a371..1060837fe463 100644
--- a/drivers/staging/rtl8188eu/core/rtw_debug.c
+++ b/drivers/staging/rtl8188eu/core/rtw_debug.c
@@ -33,7 +33,7 @@ int proc_set_write_reg(struct file *file, const char __user 
*buffer,
   unsigned long count, void *data)
 {
struct net_device *dev = data;
-   struct adapter *padapter = rtw_netdev_priv(dev);
+   struct adapter *padapter = netdev_priv(dev);
char tmp[32];
u32 addr, val, len;
 
@@ -75,7 +75,7 @@ int proc_get_read_reg(char *page, char **start,
  int *eof, void *data)
 {
struct net_device *dev = data;
-   struct adapter *padapter = rtw_netdev_priv(dev);
+   struct adapter *padapter = netdev_priv(dev);
 
int len = 0;
 
@@ -139,7 +139,7 @@ int proc_get_adapter_state(char *page, char **start,
   int *eof, void *data)
 {
struct net_device *dev = data;
-   struct adapter *padapter = rtw_netdev_priv(dev);
+   struct adapter *padapter = netdev_priv(dev);
int len = 0;
 
len += scnprintf(page + len, count - len, "bSurpriseRemoved=%d, 
bDriverStopped=%d\n",
@@ -155,7 +155,7 @@ int proc_get_best_channel(char *page, char **start,
  int *eof, void *data)
 {
struct net_device *dev = data;
-   struct adapter *padapter = rtw_netdev_priv(dev);
+   struct adapter *padapter = netdev_priv(dev);
struct mlme_ext_priv *pmlmeext = &padapter->mlmeextpriv;
int len = 0;
u32 i, best_channel_24G = 1, index_24G = 0;
diff --git a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c 
b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
index 3848e695ac84..c3c1cf67cf7e 100644
--- a/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
+++ b/drivers/staging/rtl8188eu/core/rtw_pwrctrl.c
@@ -84,7 +84,7 @@ static int rtw_hw_resume(struct adapter *padapter)
pwrpriv->bips_processing = true;
rtw_reset_drv_sw(padapter);
 
-   if (ips_netdrv_open(rtw_netdev_priv(pnetdev)) != _SUCCESS) {
+   if (ips_netdrv_open(netdev_priv(pnetdev)) != _SUCCESS) {
mutex_unlock(&pwrpriv->mutex_lock);
goto error_exit;
}
diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 317355f830cb..ed81cbc5e191 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -44,7 +44,10 @@ s32 _rtw_init_xmit_priv(struct xmit_priv *pxmitpriv, struct 
adapter *padapter)
u32 max_xmit_extbuf_size = MAX_XMIT_EXTBUF_SZ;
u32 num_xmit_extbuf = NR_XMIT_EXTBUFF;
 
-   /*  We don't need to memset padapter->XXX to zero, because adapter is 
allocated by vzalloc(). */
+   /*
+* We don't need to memset padapter->XXX to zero because adapter is
+* allocated by alloc_etherdev_mq, which eventually calls kvzalloc.
+*/
 
spin_lock_init(&pxmitpriv->lock);
 
diff --git a/drivers/staging/rtl8188eu/include/osdep_intf.h 
b/drivers/staging/rtl8188eu/include/osdep_intf.h
index 5ee4ed995025..5012b9176526 100644
--- a/drivers/staging/rtl8188eu/include/osdep_intf.h
+++ b/drivers/staging/rtl8188eu/include/osdep_intf.h
@@ -23,7 +23,7 @@ void rtw_cancel_all_timer(struct adapter *padapter);
 
 int rtw_ioctl(struct net_device *dev, struct ifreq *rq, int cmd);
 
-struct net_device *rtw_init_netdev(struct adapter *padapter);
+struct net_device *rtw_init_netdev(void);
 u16 rtw_recv_select_queue(struct sk_buff *skb);
 
 int netdev_open(struct net_device *pnetdev);
diff --git a/drivers/staging/rtl8188eu/include/osdep_service.h 
b/drivers/staging/rtl8188eu/include/osdep_service.h
index 56e937b26407..efd0833e28c8 100644
--- a/drivers/staging/rtl8188eu/include/osdep_service.h
+++ b/drivers/staging/rtl8188eu/include/osdep_service.h
@@ -66,19 +66,6 @@ u8 *_rtw_malloc(u32 sz);
 
 void _rtw_init_queue(struct __queue *pqueue);
 
-struct rtw_netdev_priv_indica

[PATCH 4/6] media: cedrus: Add support for V3s

2020-09-04 Thread Martin Cerveny
V3s video engine runs at lower speed and support video decoder
for H.264 and JPEG/MJPEG only.

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 3fd9fd810..3c4fcef37 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -506,6 +506,12 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant 
= {
.mod_rate   = 40200,
 };
 
+static const struct cedrus_variant sun8i_v3s_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_H264_DEC,
+   .mod_rate   = 29700,
+};
+
 static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
  CEDRUS_CAPABILITY_MPEG2_DEC |
@@ -552,6 +558,10 @@ static const struct of_device_id cedrus_dt_match[] = {
.compatible = "allwinner,sun8i-h3-video-engine",
.data = &sun8i_h3_cedrus_variant,
},
+   {
+   .compatible = "allwinner,sun8i-v3s-video-engine",
+   .data = &sun8i_v3s_cedrus_variant,
+   },
{
.compatible = "allwinner,sun50i-a64-video-engine",
.data = &sun50i_a64_cedrus_variant,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-09-04 Thread Martin Cerveny
First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and 
next three patches add support for Cedrus VPU.

Best regards,
Martin

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  media: allwinner,sun4i-a10-video-engine: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  6 
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 33 +++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 28 +++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 71 insertions(+), 1 deletion(-)

-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/6] media: cedrus: Register all codecs as capability

2020-09-04 Thread Martin Cerveny
All codecs should have capabilities.
For example "Allwinner V3s" does not support "MPEG2".

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c| 18 +-
 drivers/staging/media/sunxi/cedrus/cedrus.h|  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c  |  2 ++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index bc27f9430..3fd9fd810 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -474,42 +474,58 @@ static int cedrus_remove(struct platform_device *pdev)
 }
 
 static const struct cedrus_variant sun4i_a10_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun5i_a13_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun7i_a20_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_a33_cedrus_variant = {
-   .capabilities   = CEDRUS_CAPABILITY_UNTILED,
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h5_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h6_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.quirks = CEDRUS_QUIRK_NO_DMA_OFFSET,
.mod_rate   = 6,
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h 
b/drivers/staging/media/sunxi/cedrus/cedrus.h
index 9676a..b6032f40c 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
@@ -28,6 +28,8 @@
 
 #define CEDRUS_CAPABILITY_UNTILED  BIT(0)
 #define CEDRUS_CAPABILITY_H265_DEC BIT(1)
+#define CEDRUS_CAPABILITY_H264_DEC BIT(2)
+#define CEDRUS_CAPABILITY_MPEG2_DECBIT(3)
 
 #define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0)
 
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c 
b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index 16d82309e..cb4aca5be 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -38,10 +38,12 @@ static struct cedrus_format cedrus_formats[] = {
{
.pixelformat= V4L2_PIX_FMT_MPEG2_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_H264_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_H264_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_HEVC_SLICE,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] media: allwinner, sun4i-a10-video-engine: Add V3s compatible

2020-09-04 Thread Martin Cerveny
Allwinner V3s SoC contains video engine. Add compatible for it.

Signed-off-by: Martin Cerveny 
---
 .../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 4cc1a670c..08515c18c 100644
--- 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -18,6 +18,7 @@ properties:
   - allwinner,sun7i-a20-video-engine
   - allwinner,sun8i-a33-video-engine
   - allwinner,sun8i-h3-video-engine
+  - allwinner,sun8i-v3s-video-engine
   - allwinner,sun50i-a64-video-engine
   - allwinner,sun50i-h5-video-engine
   - allwinner,sun50i-h6-video-engine
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 3/6] ARM: dts: sun8i: v3s: Add node for system control

2020-09-04 Thread Martin Cerveny
Allwinner V3s has system control and SRAM C1 region similar to H3.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e5312869c..3f18866fb 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -138,6 +138,29 @@
};
};
 
+   syscon: system-control@1c0 {
+   compatible = "allwinner,sun8i-v3s-system-control",
+"allwinner,sun8i-h3-system-control";
+   reg = <0x01c0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   sram_c: sram@1d0 {
+   compatible = "mmio-sram";
+   reg = <0x01d0 0x8>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x01d0 0x8>;
+
+   ve_sram: sram-section@0 {
+   compatible = 
"allwinner,sun8i-v3s-sram-c1",
+
"allwinner,sun4i-a10-sram-c1";
+   reg = <0x00 0x8>;
+   };
+   };
+   };
+
tcon0: lcd-controller@1c0c000 {
compatible = "allwinner,sun8i-v3s-tcon";
reg = <0x01c0c000 0x1000>;
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] ARM: dts: sun8i: v3s: Add video engine node

2020-09-04 Thread Martin Cerveny
Allwinner V3S SoC has a video engine.
Add a node for it.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 3f18866fb..3fb01dc1a 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -195,6 +195,16 @@
};
};
 
+   video-codec@1c0e000 {
+   compatible = "allwinner,sun8i-v3s-video-engine";
+   reg = <0x01c0e000 0x1000>;
+   clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+<&ccu CLK_DRAM_VE>;
+   clock-names = "ahb", "mod", "ram";
+   resets = <&ccu RST_BUS_VE>;
+   interrupts = ;
+   allwinner,sram = <&ve_sram 1>;
+   };
 
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun7i-a20-mmc";
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] dt-bindings: sram: allwinner, sun4i-a10-system-control: Add V3s compatibles

2020-09-04 Thread Martin Cerveny
Allwinner V3s has system control similar to that in H3.
Add compatibles for system control with SRAM C1 region.

Signed-off-by: Martin Cerveny 
---
 .../bindings/sram/allwinner,sun4i-a10-system-control.yaml   | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
index f5825935f..9577d6c14 100644
--- 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
+++ 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
@@ -33,6 +33,9 @@ properties:
   - const: allwinner,sun4i-a10-system-control
   - const: allwinner,sun8i-a23-system-control
   - const: allwinner,sun8i-h3-system-control
+  - items:
+  - const: allwinner,sun8i-v3s-system-control
+  - const: allwinner,sun8i-h3-system-control
   - const: allwinner,sun50i-a64-sram-controller
 deprecated: true
   - const: allwinner,sun50i-a64-system-control
@@ -86,6 +89,9 @@ patternProperties:
   - items:
   - const: allwinner,sun8i-h3-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
+  - items:
+  - const: allwinner,sun8i-v3s-sram-c1
+  - const: allwinner,sun4i-a10-sram-c1
   - items:
   - const: allwinner,sun50i-a64-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-09-08 Thread Martin Cerveny

Hello.

On Tue, 8 Sep 2020, Maxime Ripard wrote:

On Fri, Sep 04, 2020 at 10:01:06PM +0200, Martin Cerveny wrote:

First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and
next three patches add support for Cedrus VPU.


How was it tested?


On V3s with LCD and bootlin raw v4l2 api test:
- https://github.com/mcerveny/linux/tree/v3s_videocodec_v3
- https://github.com/mcerveny/v4l2-request-test

Regards.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 4/6] media: cedrus: Add support for V3s

2020-09-12 Thread Martin Cerveny
V3s video engine runs at lower speed and support video decoder
for H.264 and JPEG/MJPEG only.

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index ae7e154eca9f..79ec5e07b416 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -511,6 +511,12 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant 
= {
.mod_rate   = 40200,
 };
 
+static const struct cedrus_variant sun8i_v3s_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_H264_DEC,
+   .mod_rate   = 29700,
+};
+
 static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
  CEDRUS_CAPABILITY_MPEG2_DEC |
@@ -557,6 +563,10 @@ static const struct of_device_id cedrus_dt_match[] = {
.compatible = "allwinner,sun8i-h3-video-engine",
.data = &sun8i_h3_cedrus_variant,
},
+   {
+   .compatible = "allwinner,sun8i-v3s-video-engine",
+   .data = &sun8i_v3s_cedrus_variant,
+   },
{
.compatible = "allwinner,sun50i-a64-video-engine",
.data = &sun50i_a64_cedrus_variant,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 6/6] ARM: dts: sun8i: v3s: Add video engine node

2020-09-12 Thread Martin Cerveny
Allwinner V3S SoC has a video engine.
Add a node for it.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 3f18866fb37b..3fb01dc1a9ba 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -195,6 +195,16 @@
};
};
 
+   video-codec@1c0e000 {
+   compatible = "allwinner,sun8i-v3s-video-engine";
+   reg = <0x01c0e000 0x1000>;
+   clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+<&ccu CLK_DRAM_VE>;
+   clock-names = "ahb", "mod", "ram";
+   resets = <&ccu RST_BUS_VE>;
+   interrupts = ;
+   allwinner,sram = <&ve_sram 1>;
+   };
 
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun7i-a20-mmc";
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/6] dt-bindings: sram: allwinner, sun4i-a10-system-control: Add V3s compatibles

2020-09-12 Thread Martin Cerveny
Allwinner V3s has system control similar to that in H3.
Add compatibles for system control with SRAM C1 region.

Signed-off-by: Martin Cerveny 
---
 .../bindings/sram/allwinner,sun4i-a10-system-control.yaml   | 6 ++
 1 file changed, 6 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
index f5825935fd22..9577d6c1494a 100644
--- 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
+++ 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
@@ -33,6 +33,9 @@ properties:
   - const: allwinner,sun4i-a10-system-control
   - const: allwinner,sun8i-a23-system-control
   - const: allwinner,sun8i-h3-system-control
+  - items:
+  - const: allwinner,sun8i-v3s-system-control
+  - const: allwinner,sun8i-h3-system-control
   - const: allwinner,sun50i-a64-sram-controller
 deprecated: true
   - const: allwinner,sun50i-a64-system-control
@@ -86,6 +89,9 @@ patternProperties:
   - items:
   - const: allwinner,sun8i-h3-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
+  - items:
+  - const: allwinner,sun8i-v3s-sram-c1
+  - const: allwinner,sun4i-a10-sram-c1
   - items:
   - const: allwinner,sun50i-a64-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-09-12 Thread Martin Cerveny
First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and 
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
and V4L2 raw API testing utility
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented

best regards,
Martin

Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  dt-bindings: media: cedrus: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  6 
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 33 +++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 28 +++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 71 insertions(+), 1 deletion(-)

-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 3/6] ARM: dts: sun8i: v3s: Add node for system control

2020-09-12 Thread Martin Cerveny
Allwinner V3s has system control and SRAM C1 region similar to H3.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 23 +++
 1 file changed, 23 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e5312869c0d2..3f18866fb37b 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -138,6 +138,29 @@
};
};
 
+   syscon: system-control@1c0 {
+   compatible = "allwinner,sun8i-v3s-system-control",
+"allwinner,sun8i-h3-system-control";
+   reg = <0x01c0 0x1000>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges;
+
+   sram_c: sram@1d0 {
+   compatible = "mmio-sram";
+   reg = <0x01d0 0x8>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x01d0 0x8>;
+
+   ve_sram: sram-section@0 {
+   compatible = 
"allwinner,sun8i-v3s-sram-c1",
+
"allwinner,sun4i-a10-sram-c1";
+   reg = <0x00 0x8>;
+   };
+   };
+   };
+
tcon0: lcd-controller@1c0c000 {
compatible = "allwinner,sun8i-v3s-tcon";
reg = <0x01c0c000 0x1000>;
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/6] dt-bindings: media: cedrus: Add V3s compatible

2020-09-12 Thread Martin Cerveny
Allwinner V3s SoC contains video engine. Add compatible for it.

Signed-off-by: Martin Cerveny 
---
 .../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 4cc1a670c986..08515c18cbb7 100644
--- 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -18,6 +18,7 @@ properties:
   - allwinner,sun7i-a20-video-engine
   - allwinner,sun8i-a33-video-engine
   - allwinner,sun8i-h3-video-engine
+  - allwinner,sun8i-v3s-video-engine
   - allwinner,sun50i-a64-video-engine
   - allwinner,sun50i-h5-video-engine
   - allwinner,sun50i-h6-video-engine
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 1/6] media: cedrus: Register all codecs as capability

2020-09-12 Thread Martin Cerveny
All codecs should have capabilities.
For example "Allwinner V3s" does not support "MPEG2".

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c| 18 +-
 drivers/staging/media/sunxi/cedrus/cedrus.h|  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c  |  2 ++
 3 files changed, 21 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 7c6b91f0e780..ae7e154eca9f 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -479,42 +479,58 @@ static int cedrus_remove(struct platform_device *pdev)
 }
 
 static const struct cedrus_variant sun4i_a10_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun5i_a13_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun7i_a20_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_a33_cedrus_variant = {
-   .capabilities   = CEDRUS_CAPABILITY_UNTILED,
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h5_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h6_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.quirks = CEDRUS_QUIRK_NO_DMA_OFFSET,
.mod_rate   = 6,
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h 
b/drivers/staging/media/sunxi/cedrus/cedrus.h
index 9676ab8a..b6032f40cde8 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
@@ -28,6 +28,8 @@
 
 #define CEDRUS_CAPABILITY_UNTILED  BIT(0)
 #define CEDRUS_CAPABILITY_H265_DEC BIT(1)
+#define CEDRUS_CAPABILITY_H264_DEC BIT(2)
+#define CEDRUS_CAPABILITY_MPEG2_DECBIT(3)
 
 #define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0)
 
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c 
b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index 16d82309e7b6..cb4aca5be415 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -38,10 +38,12 @@ static struct cedrus_format cedrus_formats[] = {
{
.pixelformat= V4L2_PIX_FMT_MPEG2_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_H264_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_H264_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_HEVC_SLICE,
-- 
2.17.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-11-15 Thread Martin Cerveny

Hello.

On Thu, 5 Nov 2020, Hans Verkuil wrote:


Hi Martin,

On 12/09/2020 16:30, Martin Cerveny wrote:

First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
and V4L2 raw API testing utility
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented


When I tried to merged these patches I got merge conflicts.

Possibly due to other 5.10 changes, but certainly because of conflicts
with patches from Jernej:

https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-4-jernej.skra...@siol.net/
https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-5-jernej.skra...@siol.net/

I've merged Jerne's patches and posted a PR for that:
https://patchwork.linuxtv.org/project/linux-media/patch/f3b8e5e2-5f0e-fb6f-e5b2-7f44f7e36...@xs4all.nl/

Can you rebase your patches on top of my branch that contains Jernej's patches?

https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e

Once my PR is merged into the media_tree master I can take your rebased
patches.


I updated patches:
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e

BUT, commit (555 commits) for v5.10-1
https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):

1) colors are disrupted

There are missing some initialization now.

If I use "5.9" compatible code
(last bisect good point 
https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29
 )
then reboot (not power-off!) and use new code 
( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )

and colors are OK.

2) decoding of complex streams fails

( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
- bbb-h264-all-i-32 - OK
- bbb-h264-32 - bad from frame 5
- bbb-h264-high-32 - bad from frame 6

best regards,
Martin


Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  dt-bindings: media: cedrus: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  6 
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 33 +++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 28 +++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 71 insertions(+), 1 deletion(-)




___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-11-16 Thread Martin Cerveny




On Mon, 16 Nov 2020, Hans Verkuil wrote:


On 15/11/2020 19:59, Martin Cerveny wrote:

Hello.

On Thu, 5 Nov 2020, Hans Verkuil wrote:


Hi Martin,

On 12/09/2020 16:30, Martin Cerveny wrote:

First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
and V4L2 raw API testing utility
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented


When I tried to merged these patches I got merge conflicts.

Possibly due to other 5.10 changes, but certainly because of conflicts
with patches from Jernej:

https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-4-jernej.skra...@siol.net/
https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-5-jernej.skra...@siol.net/

I've merged Jerne's patches and posted a PR for that:
https://patchwork.linuxtv.org/project/linux-media/patch/f3b8e5e2-5f0e-fb6f-e5b2-7f44f7e36...@xs4all.nl/

Can you rebase your patches on top of my branch that contains Jernej's patches?

https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e

Once my PR is merged into the media_tree master I can take your rebased
patches.


I updated patches:
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e

BUT, commit (555 commits) for v5.10-1
https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):

1) colors are disrupted

There are missing some initialization now.

If I use "5.9" compatible code
(last bisect good point 
https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29
 )
then reboot (not power-off!) and use new code
( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
and colors are OK.


Could this or the next issue be related to this bug fix?

https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f

That fix isn't yet in our master tree.


Confirmed. It recovers colors !



2) decoding of complex streams fails

( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
- bbb-h264-all-i-32 - OK
- bbb-h264-32 - bad from frame 5
- bbb-h264-high-32 - bad from frame 6


I think cedrus devs need to take a look at these issues.


Maybe something wrong in my testing code,
problematic commit swapped some variables between structures :-(

I try to investigate more, regards Martin


Regards,

Hans



best regards,
Martin


Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  dt-bindings: media: cedrus: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  6 
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 33 +++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 28 +++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 71 insertions(+), 1 deletion(-)






___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-11-16 Thread Martin Cerveny

Hello.

On Mon, 16 Nov 2020, Martin Cerveny wrote:

On Mon, 16 Nov 2020, Hans Verkuil wrote:

On 15/11/2020 19:59, Martin Cerveny wrote:

On Thu, 5 Nov 2020, Hans Verkuil wrote:

On 12/09/2020 16:30, Martin Cerveny wrote:

First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/v3s_videocodec_v4 )
and V4L2 raw API testing utility
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 6)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented


When I tried to merged these patches I got merge conflicts.

Possibly due to other 5.10 changes, but certainly because of conflicts
with patches from Jernej:

https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-4-jernej.skra...@siol.net/
https://patchwork.linuxtv.org/project/linux-media/patch/20200825173523.1289379-5-jernej.skra...@siol.net/

I've merged Jerne's patches and posted a PR for that:
https://patchwork.linuxtv.org/project/linux-media/patch/f3b8e5e2-5f0e-fb6f-e5b2-7f44f7e36...@xs4all.nl/

Can you rebase your patches on top of my branch that contains Jernej's 
patches?


https://git.linuxtv.org/hverkuil/media_tree.git/log/?h=for-v5.11e

Once my PR is merged into the media_tree master I can take your rebased
patches.


I updated patches:
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e

BUT, commit (555 commits) for v5.10-1
https://github.com/torvalds/linux/commit/fd5c32d80884268a381ed0e67cccef0b3d37750b
disrupts usability of Cedrus H.264 (at least for my Allwinner V3s):

1) colors are disrupted

There are missing some initialization now.

If I use "5.9" compatible code
(last bisect good point 
https://github.com/torvalds/linux/commit/647412daeb454b6dad12a6c6961ab90aac9e5d29 
)

then reboot (not power-off!) and use new code
( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
and colors are OK.


Could this or the next issue be related to this bug fix?

https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f

That fix isn't yet in our master tree.


Confirmed. It recovers colors !



2) decoding of complex streams fails

( https://github.com/mcerveny/v4l2-request-test/tree/v5.10 )
- bbb-h264-all-i-32 - OK
- bbb-h264-32 - bad from frame 5
- bbb-h264-high-32 - bad from frame 6


I think cedrus devs need to take a look at these issues.


Maybe something wrong in my testing code,
problematic commit swapped some variables between structures :-(

I try to investigate more, regards Martin


Yes. I found new format in ref_pic_list.
I updated test application. All H.264 tests are working now.

https://github.com/mcerveny/v4l2-request-test

Is it necessary to release new "Patch V3" (rebased) series from 
https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e or not ?


Regards, Martin


Regards,

Hans



best regards,
Martin


Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  dt-bindings: media: cedrus: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  6 
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 33 +++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 28 +++-
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 71 insertions(+), 1 deletion(-)








___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 3/6] ARM: dts: sun8i: v3s: Add node for system control

2020-11-16 Thread Martin Cerveny
Allwinner V3s has system control and SRAM C1 region similar to H3.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 0c7341676921..70193512c222 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -161,6 +161,20 @@ syscon: system-control@1c0 {
#address-cells = <1>;
#size-cells = <1>;
ranges;
+
+   sram_c: sram@1d0 {
+   compatible = "mmio-sram";
+   reg = <0x01d0 0x8>;
+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x01d0 0x8>;
+
+   ve_sram: sram-section@0 {
+   compatible = 
"allwinner,sun8i-v3s-sram-c1",
+
"allwinner,sun4i-a10-sram-c1";
+   reg = <0x00 0x8>;
+   };
+   };
};
 
tcon0: lcd-controller@1c0c000 {
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 6/6] ARM: dts: sun8i: v3s: Add video engine node

2020-11-16 Thread Martin Cerveny
Allwinner V3S SoC has a video engine.
Add a node for it.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 70193512c222..e8f304125e2d 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -211,6 +211,16 @@ tcon0_out: port@1 {
};
};
 
+   video-codec@1c0e000 {
+   compatible = "allwinner,sun8i-v3s-video-engine";
+   reg = <0x01c0e000 0x1000>;
+   clocks = <&ccu CLK_BUS_VE>, <&ccu CLK_VE>,
+<&ccu CLK_DRAM_VE>;
+   clock-names = "ahb", "mod", "ram";
+   resets = <&ccu RST_BUS_VE>;
+   interrupts = ;
+   allwinner,sram = <&ve_sram 1>;
+   };
 
mmc0: mmc@1c0f000 {
compatible = "allwinner,sun7i-a20-mmc";
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 0/6] ARM: dts: sun8i: v3s: Enable video decoder

2020-11-16 Thread Martin Cerveny
First patch extends cedrus capability to all decoders
because V3s missing MPEG2 decoder.

Next two patches add system control node (SRAM C1) and 
next three patches add support for Cedrus VPU.

Tested on "Lichee Zero" V3s platform with testing LCD patch
( https://github.com/mcerveny/linux/tree/media_tree_for-v5.11e )
and V4L2 raw API testing utility (updated to v5.10)
( https://github.com/mcerveny/v4l2-request-test ):
- enabled LCD (DRM dual VI and sigle UI planes)
- added RGB panel
- enabled PWM
- need additional patch 
https://git.linuxtv.org/media_tree.git/commit/?h=fixes&id=9ac924b98728c3733c91c6c59fc410827d0da49f

There is low memory on V3s (64MB) and maximum must be available to CMA:
- CONFIG_CMA_SIZE_MBYTES=28
- add swap to swapout other processes
- decrease buffers in v4l2-request-test (.buffers_count from 16 to 8)

Only H.264 decoder working - MPEG and H.265 unsupported by V3s,
JPEG/MJPEG still unimplemented, encoder unimplemented

best regards,
Martin

Changes since v2:
- updated/rebased to 
https://git.linuxtv.org/hverkuil/media_tree.git/?h=for-v5.11e
- some parts of patches implemeted by others
- updated R40
Changes since v1:
- patch 0005 rename
- added testing description

Martin Cerveny (6):
  media: cedrus: Register all codecs as capability
  dt-bindings: sram: allwinner,sun4i-a10-system-control: Add V3s
compatibles
  ARM: dts: sun8i: v3s: Add node for system control
  media: cedrus: Add support for V3s
  dt-bindings: media: cedrus: Add V3s compatible
  ARM: dts: sun8i: v3s: Add video engine node

 .../allwinner,sun4i-a10-video-engine.yaml |  1 +
 .../allwinner,sun4i-a10-system-control.yaml   |  3 ++
 arch/arm/boot/dts/sun8i-v3s.dtsi  | 24 ++
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 32 +--
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 6 files changed, 62 insertions(+), 2 deletions(-)

-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 2/6] dt-bindings: sram: allwinner, sun4i-a10-system-control: Add V3s compatibles

2020-11-16 Thread Martin Cerveny
Allwinner V3s has system control similar to that in H3.
Add compatibles for system control with SRAM C1 region.

Signed-off-by: Martin Cerveny 
---
 .../bindings/sram/allwinner,sun4i-a10-system-control.yaml  | 3 +++
 1 file changed, 3 insertions(+)

diff --git 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
index b66a07e21d1e..bdd352b01434 100644
--- 
a/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
+++ 
b/Documentation/devicetree/bindings/sram/allwinner,sun4i-a10-system-control.yaml
@@ -92,6 +92,9 @@ patternProperties:
   - items:
   - const: allwinner,sun8i-h3-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
+  - items:
+  - const: allwinner,sun8i-v3s-sram-c1
+  - const: allwinner,sun4i-a10-sram-c1
   - items:
   - const: allwinner,sun8i-r40-sram-c1
   - const: allwinner,sun4i-a10-sram-c1
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 5/6] dt-bindings: media: cedrus: Add V3s compatible

2020-11-16 Thread Martin Cerveny
Allwinner V3s SoC contains video engine. Add compatible for it.

Signed-off-by: Martin Cerveny 
---
 .../bindings/media/allwinner,sun4i-a10-video-engine.yaml | 1 +
 1 file changed, 1 insertion(+)

diff --git 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
index 0d58bbcd24d3..2f7058f7760c 100644
--- 
a/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
+++ 
b/Documentation/devicetree/bindings/media/allwinner,sun4i-a10-video-engine.yaml
@@ -18,6 +18,7 @@ properties:
   - allwinner,sun7i-a20-video-engine
   - allwinner,sun8i-a33-video-engine
   - allwinner,sun8i-h3-video-engine
+  - allwinner,sun8i-v3s-video-engine
   - allwinner,sun8i-r40-video-engine
   - allwinner,sun50i-a64-video-engine
   - allwinner,sun50i-h5-video-engine
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 4/6] media: cedrus: Add support for V3s

2020-11-16 Thread Martin Cerveny
V3s video engine runs at lower speed and support video decoder
for H.264 and JPEG/MJPEG only.

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c | 10 ++
 1 file changed, 10 insertions(+)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 3487554fab68..ee4e21b29374 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -518,6 +518,12 @@ static const struct cedrus_variant sun8i_h3_cedrus_variant 
= {
.mod_rate   = 40200,
 };
 
+static const struct cedrus_variant sun8i_v3s_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_H264_DEC,
+   .mod_rate   = 29700,
+};
+
 static const struct cedrus_variant sun8i_r40_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
  CEDRUS_CAPABILITY_MPEG2_DEC |
@@ -571,6 +577,10 @@ static const struct of_device_id cedrus_dt_match[] = {
.compatible = "allwinner,sun8i-h3-video-engine",
.data = &sun8i_h3_cedrus_variant,
},
+   {
+   .compatible = "allwinner,sun8i-v3s-video-engine",
+   .data = &sun8i_v3s_cedrus_variant,
+   },
{
.compatible = "allwinner,sun8i-r40-video-engine",
.data = &sun8i_r40_cedrus_variant,
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3 1/6] media: cedrus: Register all codecs as capability

2020-11-16 Thread Martin Cerveny
All codecs should have capabilities.
For example "Allwinner V3s" does not support "MPEG2".

Signed-off-by: Martin Cerveny 
---
 drivers/staging/media/sunxi/cedrus/cedrus.c   | 22 +--
 drivers/staging/media/sunxi/cedrus/cedrus.h   |  2 ++
 .../staging/media/sunxi/cedrus/cedrus_video.c |  2 ++
 3 files changed, 24 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.c 
b/drivers/staging/media/sunxi/cedrus/cedrus.c
index 9a102b7c1bb9..3487554fab68 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.c
@@ -486,47 +486,65 @@ static int cedrus_remove(struct platform_device *pdev)
 }
 
 static const struct cedrus_variant sun4i_a10_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun5i_a13_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun7i_a20_cedrus_variant = {
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_a33_cedrus_variant = {
-   .capabilities   = CEDRUS_CAPABILITY_UNTILED,
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 32000,
 };
 
 static const struct cedrus_variant sun8i_h3_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun8i_r40_cedrus_variant = {
-   .capabilities   = CEDRUS_CAPABILITY_UNTILED,
+   .capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC,
.mod_rate   = 29700,
 };
 
 static const struct cedrus_variant sun50i_a64_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h5_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.mod_rate   = 40200,
 };
 
 static const struct cedrus_variant sun50i_h6_cedrus_variant = {
.capabilities   = CEDRUS_CAPABILITY_UNTILED |
+ CEDRUS_CAPABILITY_MPEG2_DEC |
+ CEDRUS_CAPABILITY_H264_DEC |
  CEDRUS_CAPABILITY_H265_DEC,
.quirks = CEDRUS_QUIRK_NO_DMA_OFFSET,
.mod_rate   = 6,
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus.h 
b/drivers/staging/media/sunxi/cedrus/cedrus.h
index 93c843ae14bb..30cdb15d6800 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus.h
+++ b/drivers/staging/media/sunxi/cedrus/cedrus.h
@@ -28,6 +28,8 @@
 
 #define CEDRUS_CAPABILITY_UNTILED  BIT(0)
 #define CEDRUS_CAPABILITY_H265_DEC BIT(1)
+#define CEDRUS_CAPABILITY_H264_DEC BIT(2)
+#define CEDRUS_CAPABILITY_MPEG2_DECBIT(3)
 
 #define CEDRUS_QUIRK_NO_DMA_OFFSET BIT(0)
 
diff --git a/drivers/staging/media/sunxi/cedrus/cedrus_video.c 
b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
index 911f607d9b09..bdca23fc214b 100644
--- a/drivers/staging/media/sunxi/cedrus/cedrus_video.c
+++ b/drivers/staging/media/sunxi/cedrus/cedrus_video.c
@@ -38,10 +38,12 @@ static struct cedrus_format cedrus_formats[] = {
{
.pixelformat= V4L2_PIX_FMT_MPEG2_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_MPEG2_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_H264_SLICE,
.directions = CEDRUS_DECODE_SRC,
+   .capabilities   = CEDRUS_CAPABILITY_H264_DEC,
},
{
.pixelformat= V4L2_PIX_FMT_HEVC_SLICE,
-- 
2.25.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v3 3/6] ARM: dts: sun8i: v3s: Add node for system control

2020-12-03 Thread Martin Cerveny

Hello.

On Thu, 3 Dec 2020, Chen-Yu Tsai wrote:


Hi,

On Mon, Nov 16, 2020 at 8:57 PM Martin Cerveny  wrote:


Allwinner V3s has system control and SRAM C1 region similar to H3.

Signed-off-by: Martin Cerveny 
---
 arch/arm/boot/dts/sun8i-v3s.dtsi | 14 ++
 1 file changed, 14 insertions(+)

diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index 0c7341676921..70193512c222 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -161,6 +161,20 @@ syscon: system-control@1c0 {
#address-cells = <1>;
#size-cells = <1>;
ranges;
+
+   sram_c: sram@1d0 {
+   compatible = "mmio-sram";
+   reg = <0x01d0 0x8>;


How was this address derived? Did you check that there is actually SRAM here?


Yes, I did some checking (mmap). But I repeated measurement and found 
mirrored regions:


- SRAM_C is mirrored from 0x_4000 (primary location) to 0x01d0_4000 (size 
0xb000)
  (probably exact size is 0xb0c0)
- rest of 0x01d0_ are discontinuously filled with R/W register sets
  (probably some internals registers from VE) that I thought to be SRAM too
- register SRAM_CTRL_REG0==0x01c00_ (value 0x7fff_) switch whole
  region 0x01d0_-0x01df_ __AND__ 0x_4000-0x_
- VE/cedrus code use this regions indirectly
  (VE_AVC_SRAM_PORT_OFFSET/VE_AVC_SRAM_PORT_DATA...)
  and it is not influenced by "true" SRAM mapping or size

-> so I suppose to better use only SRAM_C lower definition:

---
diff --git a/arch/arm/boot/dts/sun8i-v3s.dtsi b/arch/arm/boot/dts/sun8i-v3s.dtsi
index e8f304125e2d..90d703e5b73b 100644
--- a/arch/arm/boot/dts/sun8i-v3s.dtsi
+++ b/arch/arm/boot/dts/sun8i-v3s.dtsi
@@ -162,17 +162,17 @@ syscon: system-control@1c0 {
#size-cells = <1>;
ranges;

-   sram_c: sram@1d0 {
+   sram_c: sram@4000 {
compatible = "mmio-sram";
-   reg = <0x01d0 0x8>;
+   reg = <0x4000 0xb000>;
#address-cells = <1>;
#size-cells = <1>;
-   ranges = <0 0x01d0 0x8>;
+   ranges = <0 0 0x4000 0xb000>;

ve_sram: sram-section@0 {
compatible = 
"allwinner,sun8i-v3s-sram-c1",
 
"allwinner,sun4i-a10-sram-c1";
-   reg = <0x00 0x8>;
+   reg = <0x0 0xb000>;
};
        };
};
---

Does someone have accessible specific documentation of VE/cedrus for V3s ?

Regards, Martin


ChenYu


+   #address-cells = <1>;
+   #size-cells = <1>;
+   ranges = <0 0x01d0 0x8>;
+
+   ve_sram: sram-section@0 {
+   compatible = 
"allwinner,sun8i-v3s-sram-c1",
+
"allwinner,sun4i-a10-sram-c1";
+   reg = <0x00 0x8>;
+   };
+   };
};

tcon0: lcd-controller@1c0c000 {
--
2.25.1


___
linux-arm-kernel mailing list
linux-arm-ker...@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel



___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: fix rtw_xmit_entry's return value

2021-01-22 Thread Martin Kaiser
A netdev xmit function should return NETDEV_TX_OK or NETDEV_TX_BUSY.

Signed-off-by: Martin Kaiser 
---
 drivers/staging/rtl8188eu/os_dep/xmit_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c 
b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
index c22ddeb9a56b..b0efa2eb705e 100644
--- a/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
+++ b/drivers/staging/rtl8188eu/os_dep/xmit_linux.c
@@ -205,5 +205,5 @@ int rtw_xmit_entry(struct sk_buff *pkt, struct net_device 
*pnetdev)
 ("%s: drop, tx_drop=%d\n", __func__, (u32)pxmitpriv->tx_drop));
 
 exit:
-   return 0;
+   return NETDEV_TX_OK;
 }
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8723bs: fix rtw_cfg80211_monitor_if_xmit_entry's return value

2021-01-31 Thread Martin Kaiser
A netdev xmit function should return NETDEV_TX_OK or NETDEV_TX_BUSY.

Signed-off-by: Martin Kaiser 
---
 drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c 
b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
index 11032316c53d..ff164a8c8679 100644
--- a/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
+++ b/drivers/staging/rtl8723bs/os_dep/ioctl_cfg80211.c
@@ -2516,7 +2516,7 @@ static netdev_tx_t 
rtw_cfg80211_monitor_if_xmit_entry(struct sk_buff *skb, struc
 
dev_kfree_skb_any(skb);
 
-   return 0;
+   return NETDEV_TX_OK;
 
 }
 
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Obědové karty

2018-12-13 Thread Martin Kaspar
Dobrý den,
 
moderní příspěvek na stravování v podobě obědové karty, kterou lze použít ve 
více než 15 000 restauracích a gastronomických zařízení po celé zemi, je 
nástroj, který Vám pomůže poskytnout svým zaměstnancům nejžádanější benefit v 
ČR.

Výzkum Světové zdravotnické organizace WHO naznačuje, že zaměstnanec, který 
dostává  od svého zaměstnavatele příspěvek na jídlo, je efektivnější o 20 % a 
počet absencí klesá o 27 %.

Výběrem našich obědových karet jako formy výhod zaměstnavatel získá nejen 
produktivnější a k práci více motivované zaměstnance, ale také finanční výhody, 
protože hodnota prostředků na kartě znamená úsporu 34 % při odvodech na 
sociálním a zdravotním pojištění zaměstnance a na dani z příjmu. Navíc je 
příspěvek na obědovou kartu zaměstnanci o 48 % výhodnější než příspěvek do mzdy.
 
Mohli bych Vám poskytnout více informací o naší obědové kartě?


Martin Kaspar
Project Manager 
www.obedovekarty.cz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Obědové karty

2018-12-13 Thread Martin Kaspar
Dobrý den,
 
moderní příspěvek na stravování v podobě obědové karty, kterou lze použít ve 
více než 15 000 restauracích a gastronomických zařízení po celé zemi, je 
nástroj, který Vám pomůže poskytnout svým zaměstnancům nejžádanější benefit v 
ČR.

Výzkum Světové zdravotnické organizace WHO naznačuje, že zaměstnanec, který 
dostává  od svého zaměstnavatele příspěvek na jídlo, je efektivnější o 20 % a 
počet absencí klesá o 27 %.

Výběrem našich obědových karet jako formy výhod zaměstnavatel získá nejen 
produktivnější a k práci více motivované zaměstnance, ale také finanční výhody, 
protože hodnota prostředků na kartě znamená úsporu 34 % při odvodech na 
sociálním a zdravotním pojištění zaměstnance a na dani z příjmu. Navíc je 
příspěvek na obědovou kartu zaměstnanci o 48 % výhodnější než příspěvek do mzdy.
 
Mohli bych Vám poskytnout více informací o naší obědové kartě?


Martin Kaspar
Project Manager 
www.obedovekarty.cz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Obědové karty

2018-12-13 Thread Martin Kaspar
Dobrý den,
 
moderní příspěvek na stravování v podobě obědové karty, kterou lze použít ve 
více než 15 000 restauracích a gastronomických zařízení po celé zemi, je 
nástroj, který Vám pomůže poskytnout svým zaměstnancům nejžádanější benefit v 
ČR.

Výzkum Světové zdravotnické organizace WHO naznačuje, že zaměstnanec, který 
dostává  od svého zaměstnavatele příspěvek na jídlo, je efektivnější o 20 % a 
počet absencí klesá o 27 %.

Výběrem našich obědových karet jako formy výhod zaměstnavatel získá nejen 
produktivnější a k práci více motivované zaměstnance, ale také finanční výhody, 
protože hodnota prostředků na kartě znamená úsporu 34 % při odvodech na 
sociálním a zdravotním pojištění zaměstnance a na dani z příjmu. Navíc je 
příspěvek na obědovou kartu zaměstnanci o 48 % výhodnější než příspěvek do mzdy.
 
Mohli bych Vám poskytnout více informací o naší obědové kartě?


Martin Kaspar
Project Manager 
www.obedovekarty.cz
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtw_ieee80211: fix constant comparison warning

2019-01-23 Thread Stephen Martin
Fixed comparison on right side of test warnings.

Signed-off-by: Stephen Martin 
---
 drivers/staging/rtl8188eu/core/rtw_ieee80211.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c 
b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
index 5c4ff81987bd..8439d0b84a76 100644
--- a/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
+++ b/drivers/staging/rtl8188eu/core/rtw_ieee80211.c
@@ -927,7 +927,7 @@ static int rtw_get_cipher_info(struct wlan_network 
*pnetwork)
 
if (pbuf && (wpa_ielen > 0)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("%s: wpa_ielen: 
%d", __func__, wpa_ielen));
-   if (_SUCCESS == rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, 
&group_cipher, &pairwise_cipher, &is8021x)) {
+   if (rtw_parse_wpa_ie(pbuf, wpa_ielen + 2, &group_cipher, 
&pairwise_cipher, &is8021x) == _SUCCESS) {
pnetwork->BcnInfo.pairwise_cipher = pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher;
pnetwork->BcnInfo.is_8021x = is8021x;
@@ -940,7 +940,7 @@ static int rtw_get_cipher_info(struct wlan_network 
*pnetwork)
 
if (pbuf && (wpa_ielen > 0)) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, ("get RSN 
IE\n"));
-   if (_SUCCESS == rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, 
&group_cipher, &pairwise_cipher, &is8021x)) {
+   if (rtw_parse_wpa2_ie(pbuf, wpa_ielen + 2, 
&group_cipher, &pairwise_cipher, &is8021x) == _SUCCESS) {
RT_TRACE(_module_rtl871x_mlme_c_, _drv_info_, 
("get RSN IE  OK!!!\n"));
pnetwork->BcnInfo.pairwise_cipher = 
pairwise_cipher;
pnetwork->BcnInfo.group_cipher = group_cipher;
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


staging: rtl8188eu: fix bad indentation for conditional statement

2019-02-18 Thread Stephen Martin
Fixed else block indentation

Signed-off-by: Stephen Martin 
---
 drivers/staging/rtl8188eu/core/rtw_xmit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8188eu/core/rtw_xmit.c 
b/drivers/staging/rtl8188eu/core/rtw_xmit.c
index 3b1ccd138c3f..1723a47a96b4 100644
--- a/drivers/staging/rtl8188eu/core/rtw_xmit.c
+++ b/drivers/staging/rtl8188eu/core/rtw_xmit.c
@@ -626,7 +626,7 @@ static s32 xmitframe_addmic(struct adapter *padapter, 
struct xmit_frame *pxmitfr
if (pframe[1] & 2)  /* From Ds == 1 */
rtw_secmicappend(&micdata, &pframe[24], 
6);
else
-   rtw_secmicappend(&micdata, &pframe[10], 6);
+   rtw_secmicappend(&micdata, &pframe[10], 
6);
} else {/* ToDS == 0 */
rtw_secmicappend(&micdata, &pframe[4], 6);   /* 
DA */
if (pframe[1] & 2)  /* From Ds == 1 */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: isdn/gigaset : Fix bare unsigned warnings and trailing lines errors

2019-08-22 Thread Martin Tomes
There are many bare use of unsigned warnings and trailing statements should be 
on next line errors from checkpatch.pl script.
Change the code by adding 'unsigned int'. Move 'break' statement of 'switch' 
command to next line.

Signed-off-by: Martin Tomes 
---
 drivers/staging/isdn/gigaset/usb-gigaset.c | 52 ++
 1 file changed, 31 insertions(+), 21 deletions(-)

diff --git a/drivers/staging/isdn/gigaset/usb-gigaset.c 
b/drivers/staging/isdn/gigaset/usb-gigaset.c
index 1b9b436..d565242 100644
--- a/drivers/staging/isdn/gigaset/usb-gigaset.c
+++ b/drivers/staging/isdn/gigaset/usb-gigaset.c
@@ -143,16 +143,16 @@ struct usb_cardstate {
charbchars[6];  /* for request 0x19 */
 };
 
-static inline unsigned tiocm_to_gigaset(unsigned state)
+static inline unsigned int tiocm_to_gigaset(unsigned int state)
 {
return ((state & TIOCM_DTR) ? 1 : 0) | ((state & TIOCM_RTS) ? 2 : 0);
 }
 
-static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned old_state,
- unsigned new_state)
+static int gigaset_set_modem_ctrl(struct cardstate *cs, unsigned int old_state,
+ unsigned int new_state)
 {
struct usb_device *udev = cs->hw.usb->udev;
-   unsigned mask, val;
+   unsigned int mask, val;
int r;
 
mask = tiocm_to_gigaset(old_state ^ new_state);
@@ -178,7 +178,7 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
int r, r2;
 
gig_dbg(DEBUG_USBREQ, "request %02x (%04x)",
-   (unsigned)req, (unsigned)val);
+   (unsigned int)req, (unsigned int)val);
r = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x12, 0x41,
0xf /*?*/, 0, NULL, 0, 2000 /*?*/);
/* no idea what this does */
@@ -191,7 +191,7 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
val, 0, NULL, 0, 2000 /*?*/);
if (r < 0)
dev_err(&udev->dev, "error %d on request 0x%02x\n",
-   -r, (unsigned)req);
+   -r, (unsigned int)req);
 
r2 = usb_control_msg(udev, usb_sndctrlpipe(udev, 0), 0x19, 0x41,
 0, 0, cs->hw.usb->bchars, 6, 2000 /*?*/);
@@ -205,7 +205,7 @@ static int set_value(struct cardstate *cs, u8 req, u16 val)
  * set the baud rate on the internal serial adapter
  * using the undocumented parameter setting command
  */
-static int gigaset_baud_rate(struct cardstate *cs, unsigned cflag)
+static int gigaset_baud_rate(struct cardstate *cs, unsigned int cflag)
 {
u16 val;
u32 rate;
@@ -213,16 +213,26 @@ static int gigaset_baud_rate(struct cardstate *cs, 
unsigned cflag)
cflag &= CBAUD;
 
switch (cflag) {
-   caseB300: rate = 300; break;
-   caseB600: rate = 600; break;
-   case   B1200: rate =1200; break;
-   case   B2400: rate =2400; break;
-   case   B4800: rate =4800; break;
-   case   B9600: rate =9600; break;
-   case  B19200: rate =   19200; break;
-   case  B38400: rate =   38400; break;
-   case  B57600: rate =   57600; break;
-   case B115200: rate =  115200; break;
+   caseB300: rate = 300;
+ break;
+   caseB600: rate = 600;
+ break;
+   case   B1200: rate =1200;
+ break;
+   case   B2400: rate =2400;
+ break;
+   case   B4800: rate =4800;
+ break;
+   case   B9600: rate =9600;
+ break;
+   case  B19200: rate =   19200;
+ break;
+   case  B38400: rate =   38400;
+ break;
+   case  B57600: rate =   57600;
+ break;
+   case B115200: rate =  115200;
+ break;
default:
rate =  9600;
dev_err(cs->dev, "unsupported baudrate request 0x%x,"
@@ -345,7 +355,7 @@ static void gigaset_read_int_callback(struct urb *urb)
struct inbuf_t *inbuf = cs->inbuf;
int status = urb->status;
int r;
-   unsigned numbytes;
+   unsigned int numbytes;
unsigned char *src;
unsigned long flags;
 
@@ -357,7 +367,7 @@ static void gigaset_read_int_callback(struct urb *urb)
if (unlikely(*src))
dev_warn(cs->dev,
 "%s: There was no leading 0, but 
0x%02x!\n",
-__func__, (unsigned) *src);
+__func__, (unsigned int) *src);
++src; /* skip leading 0x00 */
--numbytes;
if (gigaset_fill_inbuf(

[PATCH 1/6] staging: exfat: remove unnecessary parentheses

2019-10-29 Thread Roi Martin
Fix checkpatch.pl warning:

CHECK: Unnecessary parentheses around ...

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_core.c  | 24 
 drivers/staging/exfat/exfat_super.c | 44 ++---
 2 files changed, 34 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index 79174e5c4145..d8f4fad732c4 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -550,7 +550,7 @@ s32 load_alloc_bitmap(struct super_block *sb)
 
for (j = 0; j < p_fs->map_sectors; j++) {
p_fs->vol_amap[j] = NULL;
-   ret = sector_read(sb, sector + j, 
&(p_fs->vol_amap[j]), 1);
+   ret = sector_read(sb, sector + j, 
&p_fs->vol_amap[j], 1);
if (ret != FFS_SUCCESS) {
/*  release all buffers and 
free vol_amap */
i = 0;
@@ -910,10 +910,10 @@ u32 fat_get_entry_type(struct dentry_t *p_entry)
 {
struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry;
 
-   if (*(ep->name) == 0x0)
+   if (*ep->name == 0x0)
return TYPE_UNUSED;
 
-   else if (*(ep->name) == 0xE5)
+   else if (*ep->name == 0xE5)
return TYPE_DELETED;
 
else if (ep->attr == ATTR_EXTEND)
@@ -978,10 +978,10 @@ void fat_set_entry_type(struct dentry_t *p_entry, u32 
type)
struct dos_dentry_t *ep = (struct dos_dentry_t *)p_entry;
 
if (type == TYPE_UNUSED)
-   *(ep->name) = 0x0;
+   *ep->name = 0x0;
 
else if (type == TYPE_DELETED)
-   *(ep->name) = 0xE5;
+   *ep->name = 0xE5;
 
else if (type == TYPE_EXTEND)
ep->attr = ATTR_EXTEND;
@@ -1562,7 +1562,7 @@ void update_dir_checksum_with_entry_set(struct 
super_block *sb,
u16 chksum = 0;
s32 chksum_type = CS_DIR_ENTRY, i;
 
-   ep = (struct dentry_t *)&(es->__buf);
+   ep = (struct dentry_t *)&es->__buf;
for (i = 0; i < es->num_entries; i++) {
pr_debug("%s ep %p\n", __func__, ep);
chksum = calc_checksum_2byte((void *)ep, DENTRY_SIZE, chksum,
@@ -1571,7 +1571,7 @@ void update_dir_checksum_with_entry_set(struct 
super_block *sb,
chksum_type = CS_DEFAULT;
}
 
-   ep = (struct dentry_t *)&(es->__buf);
+   ep = (struct dentry_t *)&es->__buf;
SET16_A(((struct file_dentry_t *)ep)->checksum, chksum);
write_whole_entry_set(sb, es);
 }
@@ -1832,7 +1832,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct 
super_block *sb,
}
 
if (file_ep)
-   *file_ep = (struct dentry_t *)&(es->__buf);
+   *file_ep = (struct dentry_t *)&es->__buf;
 
pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u 
buf ptr %p\n",
   __func__, es, (unsigned long long)es->sector, es->offset,
@@ -1859,7 +1859,7 @@ static s32 __write_partial_entries_in_entry_set(struct 
super_block *sb,
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
u32 clu;
-   u8 *buf, *esbuf = (u8 *)&(es->__buf);
+   u8 *buf, *esbuf = (u8 *)&es->__buf;
 
pr_debug("%s entered es %p sec %llu off %d count %d\n",
__func__, es, (unsigned long long)sec, off, count);
@@ -1929,7 +1929,7 @@ s32 write_partial_entries_in_entry_set(struct super_block 
*sb,
struct chain_t dir;
 
/* vaidity check */
-   if (ep + count  > ((struct dentry_t *)&(es->__buf)) + es->num_entries)
+   if (ep + count  > ((struct dentry_t *)&es->__buf) + es->num_entries)
return FFS_ERROR;
 
dir.dir = GET_CLUSTER_FROM_SECTOR(es->sector);
@@ -1938,7 +1938,7 @@ s32 write_partial_entries_in_entry_set(struct super_block 
*sb,
 
byte_offset = (es->sector - START_SECTOR(dir.dir)) <<
p_bd->sector_size_bits;
-   byte_offset += ((void **)ep - &(es->__buf)) + es->offset;
+   byte_offset += ((void **)ep - &es->__buf) + es->offset;
 
ret = _walk_fat_chain(sb, &dir, byte_offset, &clu);
if (ret != FFS_SUCCESS)
@@ -2122,7 +2122,7 @@ s32 find_empty_entry(struct inode *inode, struct chain_t 
*p_dir, s32 num_entries
p_fs->fs_func->set_entry_flag(ep, p_dir->flags);
buf_modify(sb, sector);
 
-   update_dir_checksum(sb, &(fid->dir),
+   

[PATCH 3/6] staging: exfat: remove unnecessary new line in if condition

2019-10-29 Thread Roi Martin
Fix checkpatch.pl warning:

CHECK: Logical continuations should be on the previous line

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_core.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index 177787296ab9..4d6ea5c809d3 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -1727,8 +1727,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct 
super_block *sb,
ep = (struct dentry_t *)(buf + off);
entry_type = p_fs->fs_func->get_entry_type(ep);
 
-   if ((entry_type != TYPE_FILE)
-   && (entry_type != TYPE_DIR))
+   if ((entry_type != TYPE_FILE) && (entry_type != TYPE_DIR))
goto err_out;
 
if (type == ES_ALL_ENTRIES)
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/6] staging: exfat: fix multiple coding-style issues

2019-10-29 Thread Roi Martin
Fix multiple coding-style issues reported by the checkpatch.pl script in
the exfat module.

Roi Martin (6):
  staging: exfat: remove unnecessary parentheses
  staging: exfat: make alignment match open parenthesis
  staging: exfat: remove unnecessary new line in if condition
  staging: exfat: replace printk(KERN_INFO ...) with pr_info()
  staging: exfat: avoid multiple assignments
  staging: exfat: replace kmalloc with kmalloc_array

 drivers/staging/exfat/exfat_core.c  |  50 +-
 drivers/staging/exfat/exfat_super.c | 136 +++-
 2 files changed, 119 insertions(+), 67 deletions(-)

-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 5/6] staging: exfat: avoid multiple assignments

2019-10-29 Thread Roi Martin
Fix checkpatch.pl warning:

CHECK: multiple assignments should be avoided

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_core.c  |  3 +-
 drivers/staging/exfat/exfat_super.c | 90 +++--
 2 files changed, 73 insertions(+), 20 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index 4d6ea5c809d3..f446e6e6c4ee 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -470,7 +470,8 @@ s32 exfat_count_used_clusters(struct super_block *sb)
struct fs_info_t *p_fs = &(EXFAT_SB(sb)->fs_info);
struct bd_info_t *p_bd = &(EXFAT_SB(sb)->bd_info);
 
-   map_i = map_b = 0;
+   map_i = 0;
+   map_b = 0;
 
for (i = 2; i < p_fs->num_clusters; i += 8) {
k = *(((u8 *)p_fs->vol_amap[map_i]->b_data) + map_b);
diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index 401f057fe924..278270a3cad6 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -864,7 +864,8 @@ static int ffsWriteFile(struct inode *inode, struct 
file_id_t *fid,
 
while (count > 0) {
clu_offset = (s32)(fid->rwoffset >> p_fs->cluster_size_bits);
-   clu = last_clu = fid->start_clu;
+   clu = fid->start_clu;
+   last_clu = fid->start_clu;
 
if (fid->flags == 0x03) {
if ((clu_offset > 0) && (clu != CLUSTER_32(~0))) {
@@ -2351,6 +2352,7 @@ static int exfat_create(struct inode *dir, struct dentry 
*dentry, umode_t mode,
bool excl)
 {
struct super_block *sb = dir->i_sb;
+   struct timespec64 curtime;
struct inode *inode;
struct file_id_t fid;
loff_t i_pos;
@@ -2375,7 +2377,10 @@ static int exfat_create(struct inode *dir, struct dentry 
*dentry, umode_t mode,
goto out;
}
INC_IVERSION(dir);
-   dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir);
+   curtime = current_time(dir);
+   dir->i_ctime = curtime;
+   dir->i_mtime = curtime;
+   dir->i_atime = curtime;
if (IS_DIRSYNC(dir))
(void)exfat_sync_inode(dir);
else
@@ -2389,7 +2394,10 @@ static int exfat_create(struct inode *dir, struct dentry 
*dentry, umode_t mode,
goto out;
}
INC_IVERSION(inode);
-   inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+   curtime = current_time(inode);
+   inode->i_mtime = curtime;
+   inode->i_atime = curtime;
+   inode->i_ctime = curtime;
/*
 * timestamp is already written, so mark_inode_dirty() is unnecessary.
 */
@@ -2522,6 +2530,7 @@ static int exfat_unlink(struct inode *dir, struct dentry 
*dentry)
 {
struct inode *inode = dentry->d_inode;
struct super_block *sb = dir->i_sb;
+   struct timespec64 curtime;
int err;
 
__lock_super(sb);
@@ -2539,14 +2548,18 @@ static int exfat_unlink(struct inode *dir, struct 
dentry *dentry)
goto out;
}
INC_IVERSION(dir);
-   dir->i_mtime = dir->i_atime = current_time(dir);
+   curtime = current_time(dir);
+   dir->i_mtime = curtime;
+   dir->i_atime = curtime;
if (IS_DIRSYNC(dir))
(void)exfat_sync_inode(dir);
else
mark_inode_dirty(dir);
 
clear_nlink(inode);
-   inode->i_mtime = inode->i_atime = current_time(inode);
+   curtime = current_time(inode);
+   inode->i_mtime = curtime;
+   inode->i_atime = curtime;
exfat_detach(inode);
remove_inode_hash(inode);
 
@@ -2560,6 +2573,7 @@ static int exfat_symlink(struct inode *dir, struct dentry 
*dentry,
 const char *target)
 {
struct super_block *sb = dir->i_sb;
+   struct timespec64 curtime;
struct inode *inode;
struct file_id_t fid;
loff_t i_pos;
@@ -2597,7 +2611,10 @@ static int exfat_symlink(struct inode *dir, struct 
dentry *dentry,
}
 
INC_IVERSION(dir);
-   dir->i_ctime = dir->i_mtime = dir->i_atime = current_time(dir);
+   curtime = current_time(dir);
+   dir->i_ctime = curtime;
+   dir->i_mtime = curtime;
+   dir->i_atime = curtime;
if (IS_DIRSYNC(dir))
(void)exfat_sync_inode(dir);
else
@@ -2611,7 +2628,10 @@ static int exfat_symlink(struct inode *dir, struct 
dentry *dentry,
goto out;
}
INC_IVERSION(inode);
-   inode->i_mtime = inode->i_atime = inode->i_ctime = current_time(inode);
+   curtime = current_time(inode);
+   inode->i_mtime = curtime;
+   inode->i_atime = curtime;
+ 

[PATCH 4/6] staging: exfat: replace printk(KERN_INFO ...) with pr_info()

2019-10-29 Thread Roi Martin
Fix checkpatch.pl warning:

WARNING: Prefer [subsystem eg: netdev]_info([subsystem]dev, ...
then dev_info(dev, ... then pr_info(...  to printk(KERN_INFO ...

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_super.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/exfat/exfat_super.c 
b/drivers/staging/exfat/exfat_super.c
index aa0d492fc673..401f057fe924 100644
--- a/drivers/staging/exfat/exfat_super.c
+++ b/drivers/staging/exfat/exfat_super.c
@@ -396,7 +396,7 @@ static int ffsMountVol(struct super_block *sb)
if (i < 53) {
 #ifdef CONFIG_EXFAT_DONT_MOUNT_VFAT
ret = -EINVAL;
-   printk(KERN_INFO "EXFAT: Attempted to mount VFAT filesystem\n");
+   pr_info("EXFAT: Attempted to mount VFAT filesystem\n");
goto out;
 #else
if (GET16(p_pbr->bpb + 11)) /* num_fat_sectors */
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 6/6] staging: exfat: replace kmalloc with kmalloc_array

2019-10-29 Thread Roi Martin
Replace expressions of the form:
kmalloc(count * size, GFP_KERNEL);
With:
kmalloc_array(count, size, GFP_KERNEL);

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_core.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index f446e6e6c4ee..a9391f0b8141 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -713,8 +713,8 @@ static s32 __load_upcase_table(struct super_block *sb, 
sector_t sector,
 
u32 checksum = 0;
 
-   upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
-   GFP_KERNEL);
+   upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+   p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
@@ -793,8 +793,8 @@ static s32 __load_default_upcase_table(struct super_block 
*sb)
u16 uni = 0;
u16 **upcase_table;
 
-   upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
-   GFP_KERNEL);
+   upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+   p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return FFS_MEMORYERR;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/6] staging: exfat: make alignment match open parenthesis

2019-10-29 Thread Roi Martin
Fix checkpatch.pl warning:

CHECK: Alignment should match open parenthesis

Signed-off-by: Roi Martin 
---
 drivers/staging/exfat/exfat_core.c | 12 ++--
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index d8f4fad732c4..177787296ab9 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -1703,7 +1703,7 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct 
super_block *sb,
size_t bufsize;
 
pr_debug("%s entered p_dir dir %u flags %x size %d\n",
-   __func__, p_dir->dir, p_dir->flags, p_dir->size);
+__func__, p_dir->dir, p_dir->flags, p_dir->size);
 
byte_offset = entry << DENTRY_SIZE_BITS;
ret = _walk_fat_chain(sb, p_dir, byte_offset, &clu);
@@ -1835,8 +1835,8 @@ struct entry_set_cache_t *get_entry_set_in_dir(struct 
super_block *sb,
*file_ep = (struct dentry_t *)&es->__buf;
 
pr_debug("%s exiting es %p sec %llu offset %d flags %d, num_entries %u 
buf ptr %p\n",
-  __func__, es, (unsigned long long)es->sector, es->offset,
-  es->alloc_flag, es->num_entries, &es->__buf);
+__func__, es, (unsigned long long)es->sector, es->offset,
+es->alloc_flag, es->num_entries, &es->__buf);
return es;
 err_out:
pr_debug("%s exited NULL (es %p)\n", __func__, es);
@@ -1862,7 +1862,7 @@ static s32 __write_partial_entries_in_entry_set(struct 
super_block *sb,
u8 *buf, *esbuf = (u8 *)&es->__buf;
 
pr_debug("%s entered es %p sec %llu off %d count %d\n",
-   __func__, es, (unsigned long long)sec, off, count);
+__func__, es, (unsigned long long)sec, off, count);
num_entries = count;
 
while (num_entries) {
@@ -1876,8 +1876,8 @@ static s32 __write_partial_entries_in_entry_set(struct 
super_block *sb,
goto err_out;
pr_debug("es->buf %p buf_off %u\n", esbuf, buf_off);
pr_debug("copying %d entries from %p to sector %llu\n",
-   copy_entries, (esbuf + buf_off),
-   (unsigned long long)sec);
+copy_entries, (esbuf + buf_off),
+(unsigned long long)sec);
memcpy(buf + off, esbuf + buf_off,
   copy_entries << DENTRY_SIZE_BITS);
buf_modify(sb, sec);
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 6/6] staging: exfat: replace kmalloc with kmalloc_array

2019-10-31 Thread Roi Martin
Replace expressions of the form:
kmalloc(count * size, GFP_KERNEL);
With:
kmalloc_array(count, size, GFP_KERNEL);

Signed-off-by: Roi Martin 
---
v2 changes:

This patch has been rebased against the branch "staging-testing" of the
tree:

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

 drivers/staging/exfat/exfat_core.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/exfat/exfat_core.c 
b/drivers/staging/exfat/exfat_core.c
index f71235c6a338..f4f82aecc05d 100644
--- a/drivers/staging/exfat/exfat_core.c
+++ b/drivers/staging/exfat/exfat_core.c
@@ -713,8 +713,8 @@ static s32 __load_upcase_table(struct super_block *sb, 
sector_t sector,
 
u32 checksum = 0;
 
-   upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
-   GFP_KERNEL);
+   upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+   p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return -ENOMEM;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
@@ -793,8 +793,8 @@ static s32 __load_default_upcase_table(struct super_block 
*sb)
u16 uni = 0;
u16 **upcase_table;
 
-   upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
-   GFP_KERNEL);
+   upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
+   p_fs->vol_utbl = upcase_table;
if (!upcase_table)
return -ENOMEM;
memset(upcase_table, 0, UTBL_COL_COUNT * sizeof(u16 *));
-- 
2.20.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 6/6] staging: exfat: replace kmalloc with kmalloc_array

2019-10-31 Thread Roi Martin
> This patch failed to apply.  Please fix it up and resend it as a new
> version.

I have rebased the patch against the branch "staging-testing" of the
tree:

https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging.git

And sent the new version.

Thanks,

    Roi Martin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2 6/6] staging: exfat: replace kmalloc with kmalloc_array

2019-10-31 Thread Roi Martin
> > diff --git a/drivers/staging/exfat/exfat_core.c 
> > b/drivers/staging/exfat/exfat_core.c
> > index f71235c6a338..f4f82aecc05d 100644
> > --- a/drivers/staging/exfat/exfat_core.c
> > +++ b/drivers/staging/exfat/exfat_core.c
> > @@ -713,8 +713,8 @@ static s32 __load_upcase_table(struct super_block *sb, 
> > sector_t sector,
> >  
> > u32 checksum = 0;
> >  
> > -   upcase_table = p_fs->vol_utbl = kmalloc(UTBL_COL_COUNT * sizeof(u16 *),
> > -   GFP_KERNEL);
> > +   upcase_table = kmalloc_array(UTBL_COL_COUNT, sizeof(u16 *), GFP_KERNEL);
> > +   p_fs->vol_utbl = upcase_table;
> 
> This patch is fine, but one idea for future patches is that you could
> remove the "upcase_table" variable and use "p_fs->vol_utbl" everywhere
> instead.

Thanks for the suggestion.

This is my first contribution and I tried to introduce the minimum
number of changes necessary to fix the issues reported by checkpatch.pl.
Also, I'm still immersed in getting familiar with the contribution
process and the code.

Do you think it makes sense to include this change in a future patch
series along with other refactoring? Or, should I modify this patch?

By the way, upcase_table is sometimes accessed in quite complex ways.
For instance:

upcase_table[col_index][get_row_index(index)] = uni;

Where having an intermediate variable instead of using the struct field
directly seems to improve readability a bit. Otherwise:

p_fs->vol_utbl[col_index][get_row_index(index)] = uni;

I assume, in cases like this, from a coding style perspective, the
following approach is preferred:

    row_index = get_row_index(index);
p_fs->vol_utbl[col_index][row_index] = uni;

Is that correct?

Regards,

Roi Martin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] tools: hv: hv_kvp_daemon: fix usage of realloc()

2017-09-13 Thread Martin Kepplinger
realloc() returns NULL in case it fails. Since we don't save the
pointer in question elsewhere, we leak memory by assigning NULL
to the original memory in the heap.

realloc() doesn't free memory in case of failure, so let's do
it manually.

Signed-off-by: Martin Kepplinger 
---
 tools/hv/hv_kvp_daemon.c | 17 +
 1 file changed, 13 insertions(+), 4 deletions(-)

diff --git a/tools/hv/hv_kvp_daemon.c b/tools/hv/hv_kvp_daemon.c
index eaa3bec273c8..0b3b18d0a6e3 100644
--- a/tools/hv/hv_kvp_daemon.c
+++ b/tools/hv/hv_kvp_daemon.c
@@ -231,6 +231,7 @@ static int kvp_file_init(void)
size_t records_read;
char *fname;
struct kvp_record *record;
+   struct kvp_record *record_tmp;
struct kvp_record *readp;
int num_blocks;
int i;
@@ -284,12 +285,15 @@ static int kvp_file_init(void)
 * We have more data to read.
 */
num_blocks++;
-   record = realloc(record, alloc_unit *
+   record_tmp = realloc(record, alloc_unit *
num_blocks);
-   if (record == NULL) {
+   if (!record_tmp) {
+   free(record);
fclose(filep);
close(fd);
return 1;
+   } else {
+   record = record_tmp;
}
continue;
}
@@ -355,6 +359,7 @@ static int kvp_key_add_or_modify(int pool, const __u8 *key, 
int key_size,
int i;
int num_records;
struct kvp_record *record;
+   struct kvp_record *record_tmp;
int num_blocks;
 
if ((key_size > HV_KVP_EXCHANGE_MAX_KEY_SIZE) ||
@@ -387,11 +392,15 @@ static int kvp_key_add_or_modify(int pool, const __u8 
*key, int key_size,
 */
if (num_records == (ENTRIES_PER_BLOCK * num_blocks)) {
/* Need to allocate a larger array for reg entries. */
-   record = realloc(record, sizeof(struct kvp_record) *
+   record_tmp = realloc(record, sizeof(struct kvp_record) *
 ENTRIES_PER_BLOCK * (num_blocks + 1));
 
-   if (record == NULL)
+   if (!record_tmp) {
+   free(record);
return 1;
+   } else {
+   record = record_tmp;
+   }
kvp_file_info[pool].num_blocks++;
 
}
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging/media: lirc: style fix - replace hard-coded function names

2017-11-26 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string
>From f11f24667ba6696cb71ac33a67fc0c7d3b4cd542 Mon Sep 17 00:00:00 2001
From: Martin Homuth 
Date: Sun, 26 Nov 2017 20:14:33 +0100
Subject: [PATCH] lirc: style fix - replace hard-coded function names

Instead of hard coding the function name the __func__ variable
should be used.

Signed-off-by: Martin Homuth 
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	unsigned int m;
 	DECLARE_WAITQUEUE(wait, current);
 
-	dev_dbg(ir->dev, "read called\n");
+	dev_dbg(ir->dev, "%s called\n", __func__);
 	if (n % rbuf->chunk_size) {
-		dev_dbg(ir->dev, "read result = -EINVAL\n");
+		dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
 		return -EINVAL;
 	}
 
@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 retries++;
 			}
 			if (retries >= 5) {
-dev_err(ir->dev, "Buffer read failed!\n");
+dev_err(ir->dev, "%s failed!\n", __func__);
 ret = -EIO;
 			}
 		}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user *outbuf, size_t n,
 	put_ir_rx(rx, false);
 	set_current_state(TASK_RUNNING);
 
-	dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+	dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
 		ret ? "Error" : "OK");
 
 	return ret ? ret : written;
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH Resend] staging: media: lirc: style fix - replace hard-coded function names

2017-11-28 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.
Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

Signed-off-by: Martin Homuth 
---
 drivers/staging/media/lirc/lirc_zilog.c | 8 
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/media/lirc/lirc_zilog.c
b/drivers/staging/media/lirc/lirc_zilog.c
index 6bd0717bf76e..be68ee652071 100644
--- a/drivers/staging/media/lirc/lirc_zilog.c
+++ b/drivers/staging/media/lirc/lirc_zilog.c
@@ -888,9 +888,9 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
unsigned int m;
DECLARE_WAITQUEUE(wait, current);

-   dev_dbg(ir->dev, "read called\n");
+   dev_dbg(ir->dev, "%s called\n", __func__);
if (n % rbuf->chunk_size) {
-   dev_dbg(ir->dev, "read result = -EINVAL\n");
+   dev_dbg(ir->dev, "%s result = -EINVAL\n", __func__);
return -EINVAL;
}

@@ -949,7 +949,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
retries++;
}
if (retries >= 5) {
-   dev_err(ir->dev, "Buffer read failed!\n");
+   dev_err(ir->dev, "%s failed!\n", __func__);
ret = -EIO;
}
}
@@ -959,7 +959,7 @@ static ssize_t read(struct file *filep, char __user
*outbuf, size_t n,
put_ir_rx(rx, false);
set_current_state(TASK_RUNNING);

-   dev_dbg(ir->dev, "read result = %d (%s)\n", ret,
+   dev_dbg(ir->dev, "%s result = %d (%s)\n", __func__, ret,
ret ? "Error" : "OK");

return ret ? ret : written;
-- 
2.13.6

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the lirc module.
Instead of hard coding the function name the __func__ variable
should be used.


It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'read', this
function's name, in a string

Signed-off-by: Martin Homuth 
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read_reg\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH Resend] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the cxd2099
module. Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'i2c_read_reg', this
function's name, in a string

Signed-off-by: Martin Homuth 
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read_reg\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH Resend] staging: media: cxd2099: style fix - replace hard-coded function names

2017-11-29 Thread Martin Homuth
This patch fixes the remaining coding style warnings in the cxd2099
module. Instead of hard coding the function name the __func__ variable
should be used.

It fixes the following checkpatch.pl warning:

WARNING: Prefer using '"%s...", __func__' to using 'i2c_read_reg', this
function's name, in a string

Signed-off-by: Martin Homuth 
---
 drivers/staging/media/cxd2099/cxd2099.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/media/cxd2099/cxd2099.c
b/drivers/staging/media/cxd2099/cxd2099.c
index 3e30f48..6641dd2 100644
--- a/drivers/staging/media/cxd2099/cxd2099.c
+++ b/drivers/staging/media/cxd2099/cxd2099.c
@@ -101,7 +101,7 @@ static int i2c_read_reg(struct i2c_adapter *adapter,
u8 adr,
   .buf = val, .len = 1} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read_reg\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
@@ -116,7 +116,7 @@ static int i2c_read(struct i2c_adapter *adapter, u8 adr,
   .buf = data, .len = n} };

if (i2c_transfer(adapter, msgs, 2) != 2) {
-   dev_err(&adapter->dev, "error in i2c_read\n");
+   dev_err(&adapter->dev, "error in %s\n", __func__);
return -1;
}
return 0;
-- 
2.10.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 0/5] staging: rtl8712: fix several checkpatch style issues

2017-12-18 Thread Martin Homuth
This patch series fixes some coding style issues reported by checkpatch.pl.

It is based on next-20171218

Martin Homuth (5):
  staging: rtl8712: style fix over 80 characters warnings
  staging: rtl8712: style fix multiple line dereferences
  staging: rtl8712: style fix indentation
  staging: rtl8712: style fix unneeded else
  staging: rtl8712: style fix returned error code

 drivers/staging/rtl8712/ieee80211.c   |  6 ++-
 drivers/staging/rtl8712/os_intfs.c|  5 +-
 drivers/staging/rtl8712/rtl8712_cmd.c | 18 ---
 drivers/staging/rtl8712/rtl8712_recv.c|  8 +--
 drivers/staging/rtl8712/rtl8712_xmit.c|  3 +-
 drivers/staging/rtl8712/rtl871x_cmd.c | 36 +++---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 72
++-
 drivers/staging/rtl8712/rtl871x_ioctl_set.c   | 72
+--
 drivers/staging/rtl8712/rtl871x_mlme.c|  6 +--
 drivers/staging/rtl8712/rtl871x_mlme.h|  3 +-
 drivers/staging/rtl8712/rtl871x_security.c| 37 +++---
 drivers/staging/rtl8712/usb_ops_linux.c   |  2 +-
 12 files changed, 140 insertions(+), 128 deletions(-)

-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/5] staging: rtl8712: style fix over 80 characters warnings

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl by reducing the characters per line to under
80.

It fixes the following checkpatch.pl warning:

WARNING: line over 80 characters

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/ieee80211.c|  6 --
 drivers/staging/rtl8712/os_intfs.c |  5 -
 drivers/staging/rtl8712/rtl8712_cmd.c  | 18 ++
 drivers/staging/rtl8712/rtl8712_xmit.c |  3 ++-
 drivers/staging/rtl8712/rtl871x_mlme.h |  3 ++-
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c
b/drivers/staging/rtl8712/ieee80211.c
index 33e82a9dd462..987270395635 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -169,12 +169,13 @@ int r8712_generate_ie(struct registry_priv
*pregistrypriv)
int sz = 0, rate_len;
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
u8 *ie = pdev_network->IEs;
+   u16 beaconPeriod = (u16)pdev_network->Configuration.BeaconPeriod;

/*timestamp will be inserted by hardware*/
sz += 8;
ie += sz;
/*beacon interval : 2bytes*/
-   *(__le16 *)ie =
cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
+   *(__le16 *)ie = cpu_to_le16(beaconPeriod);
sz += 2;
ie += 2;
/*capability info*/
@@ -221,7 +222,8 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie,
int *wpa_ie_len, int limit)
pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
if (pbuf) {
/*check if oui matches...*/
-   if (memcmp((pbuf + 2), wpa_oui_type, 
sizeof(wpa_oui_type)))
+   if (memcmp((pbuf + 2), wpa_oui_type,
+  sizeof(wpa_oui_type)))
goto check_next_ie;
/*check version...*/
memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
diff --git a/drivers/staging/rtl8712/os_intfs.c
b/drivers/staging/rtl8712/os_intfs.c
index 95caf8df9a13..e7df5d7986fc 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -238,10 +238,13 @@ static u32 start_drv_threads(struct _adapter
*padapter)

 void r8712_stop_drv_threads(struct _adapter *padapter)
 {
+   struct completion *completion =
+   &padapter->cmdpriv.terminate_cmdthread_comp;
+
/*Below is to terminate r8712_cmd_thread & event_thread...*/
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
-   
wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
+   wait_for_completion_interruptible(completion);
padapter->cmdpriv.cmd_seq = 1;
 }

diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c
b/drivers/staging/rtl8712/rtl8712_cmd.c
index 3c88994fdfcd..9c8e0c50a804 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -321,10 +321,13 @@ int r8712_cmd_thread(void *context)
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
struct _adapter *padapter = context;
struct  cmd_priv*pcmdpriv = &(padapter->cmdpriv);
+   struct completion *cmd_queue_comp =
+   &pcmdpriv->cmd_queue_comp;
+   struct mutex *pwctrl_lock = &padapter->pwrctrlpriv.mutex_lock;

allow_signal(SIGTERM);
while (1) {
-   if 
(wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp))
+   if (wait_for_completion_interruptible(cmd_queue_comp))
break;
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
break;
@@ -343,6 +346,7 @@ int r8712_cmd_thread(void *context)
if (pcmd) { /* if pcmd != NULL, cmd will be handled by f/w */
struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
u8 blnPending = 0;
+   u16 cmdcode = pcmd->cmdcode;

pcmdpriv->cmd_issued_cnt++;
cmdsz = round_up(pcmd->cmdsz, 8);
@@ -387,20 +391,18 @@ int r8712_cmd_thread(void *context)
r8712_write_mem(padapter, RTL8712_DMA_H2CCMD, wr_sz,
(u8 *)pdesc);
pcmdpriv->cmd_seq++;
-   if (pcmd->cmdcode == GEN_CMD_CODE(_CreateBss)) {
+   if (cmdcode == GEN_CMD_CODE(_CreateBss)) {
pcmd->res = H2C_SUCCESS;
-   pcmd_callback = cmd_callback[pcmd->
-   cmdcode].callback;
+   pcmd_callback = cmd_callback[cmdcode].callback;
  

[PATCH 3/5] staging: rtl8712: style fix indentation

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl related to indentation.

It fixes the following checkpatch.pl warning:

WARNING: suspect code indent for conditional statements

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 ++--
 drivers/staging/rtl8712/rtl871x_security.c| 12 ++--
 drivers/staging/rtl8712/usb_ops_linux.c   |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index e339d3ff479e..08b8b396abd2 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1723,12 +1723,12 @@ static int r871x_wx_set_auth(struct net_device *dev,
 */
if (padapter->securitypriv.ndisencryptstatus ==
Ndis802_11Encryption1Enabled) {
-   /* it means init value, or using wep,
-* ndisencryptstatus =
-*  Ndis802_11Encryption1Enabled,
-* then it needn't reset it;
-*/
-   break;
+   /* it means init value, or using wep,
+* ndisencryptstatus =
+*  Ndis802_11Encryption1Enabled,
+* then it needn't reset it;
+*/
+   break;
}

if (paramval) {
diff --git a/drivers/staging/rtl8712/rtl871x_security.c
b/drivers/staging/rtl8712/rtl871x_security.c
index 4cea9bacb8e2..75d86998fd58 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1069,16 +1069,16 @@ static sint aes_cipher(u8 *key, uinthdrlen,
if ((frtype == WIFI_DATA_CFACK) ||
 (frtype == WIFI_DATA_CFPOLL) ||
 (frtype == WIFI_DATA_CFACKPOLL)) {
-   qc_exists = 1;
-   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
-   hdrlen += 2;
+   qc_exists = 1;
+   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
+   hdrlen += 2;
} else if ((frsubtype == 0x08) ||
   (frsubtype == 0x09) ||
   (frsubtype == 0x0a) ||
   (frsubtype == 0x0b)) {
-   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
-   hdrlen += 2;
-   qc_exists = 1;
+   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
+   hdrlen += 2;
+   qc_exists = 1;
} else {
qc_exists = 0;
}
diff --git a/drivers/staging/rtl8712/usb_ops_linux.c
b/drivers/staging/rtl8712/usb_ops_linux.c
index 441e76b8959d..6d12a96fa65f 100644
--- a/drivers/staging/rtl8712/usb_ops_linux.c
+++ b/drivers/staging/rtl8712/usb_ops_linux.c
@@ -145,7 +145,7 @@ static unsigned int ffaddr2pipehdl(struct dvobj_priv
*pdvobj, u32 addr)
break;
}
} else {
-  pipe = 0;
+   pipe = 0;
}
return pipe;
 }
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: rtl8712: style fix unneeded else

2017-12-18 Thread Martin Homuth
This patch fixes a coding style issues in the rtl8712 module as noted
by checkpatch.pl where an unnecessary else is used.

It fixes the following checkpatch.pl warning:

WARNING: else is not generally useful after a break or return

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_set.c | 72
++---
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
index 8a5ced4fa9d3..f4a53df7f2c1 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
@@ -55,6 +55,7 @@ static u8 do_join(struct _adapter *padapter)
u8 *pibss = NULL;
struct  mlme_priv   *pmlmepriv = &(padapter->mlmepriv);
struct  __queue *queue  = &(pmlmepriv->scanned_queue);
+   int ret;

phead = &queue->queue;
plist = phead->next;
@@ -74,45 +75,42 @@ static u8 do_join(struct _adapter *padapter)
if (!pmlmepriv->sitesurveyctrl.traffic_busy)
r8712_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid);
return true;
-   } else {
-   int ret;
+   }

-   ret = r8712_select_and_join_from_scan(pmlmepriv);
-   if (ret == _SUCCESS) {
-   mod_timer(&pmlmepriv->assoc_timer,
- jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
+   ret = r8712_select_and_join_from_scan(pmlmepriv);
+   if (ret == _SUCCESS) {
+   mod_timer(&pmlmepriv->assoc_timer,
+ jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
+   } else {
+   if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+   /* submit r8712_createbss_cmd to change to an
+* ADHOC_MASTER pmlmepriv->lock has been
+* acquired by caller...
+*/
+   struct wlan_bssid_ex *pdev_network =
+   &(padapter->registrypriv.dev_network);
+   pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
+   pibss = padapter->registrypriv.dev_network.MacAddress;
+   memcpy(&pdev_network->Ssid,
+  &pmlmepriv->assoc_ssid,
+  sizeof(struct ndis_802_11_ssid));
+   r8712_update_registrypriv_dev_network(padapter);
+   r8712_generate_random_ibss(pibss);
+   if (r8712_createbss_cmd(padapter) != _SUCCESS)
+   return false;
+   pmlmepriv->to_join = false;
} else {
-   if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
-   /* submit r8712_createbss_cmd to change to an
-* ADHOC_MASTER pmlmepriv->lock has been
-* acquired by caller...
-*/
-   struct wlan_bssid_ex *pdev_network =
-   &(padapter->registrypriv.dev_network);
-   pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
-   pibss = padapter->registrypriv.dev_network.
-   MacAddress;
-   memcpy(&pdev_network->Ssid,
-   &pmlmepriv->assoc_ssid,
-   sizeof(struct ndis_802_11_ssid));
-   r8712_update_registrypriv_dev_network(padapter);
-   r8712_generate_random_ibss(pibss);
-   if (r8712_createbss_cmd(padapter) != _SUCCESS)
-   return false;
-   pmlmepriv->to_join = false;
-   } else {
-   /* can't associate ; reset under-linking */
-   if (pmlmepriv->fw_state & _FW_UNDER_LINKING)
-   pmlmepriv->fw_state ^=
-_FW_UNDER_LINKING;
-   /* when set_ssid/set_bssid for do_join(), but
-* there are no desired bss in scanning queue
-* we try to issue sitesurvey first
-*/
-   if (!pmlmepriv->sitesurveyctrl.traffic_busy)
-   r8712_sitesurvey_cmd(padapter,
-  &pmlmepriv->assoc_ssid);
-   }
+   /* can't a

[PATCH 2/5] staging: rtl8712: style fix multiple line dereferences

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl related to dereferencing over multiple lines.

It fixes the following checkpatch.pl warning:

WARNING: Avoid multiple line dereference - prefer %s

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl8712_recv.c|  8 ++--
 drivers/staging/rtl8712/rtl871x_cmd.c | 36 -
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 58
++-
 drivers/staging/rtl8712/rtl871x_mlme.c|  6 +--
 drivers/staging/rtl8712/rtl871x_security.c| 25 ++--
 5 files changed, 69 insertions(+), 64 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c
b/drivers/staging/rtl8712/rtl8712_recv.c
index 8f555e6e1b3f..8395b90d60b6 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -918,8 +918,8 @@ static void process_link_qual(struct _adapter *padapter,
}
padapter->recvpriv.signal_qual_data.total_val +=
  pattrib->signal_qual;
-   padapter->recvpriv.signal_qual_data.elements[padapter->
- recvpriv.signal_qual_data.index++] =
+   padapter->recvpriv.signal_qual_data.elements
+   [padapter->recvpriv.signal_qual_data.index++] =
  pattrib->signal_qual;
if (padapter->recvpriv.signal_qual_data.index >=
PHY_LINKQUALITY_SLID_WIN_MAX)
@@ -947,8 +947,8 @@ static void process_rssi(struct _adapter *padapter,
union recv_frame *prframe)
}
padapter->recvpriv.signal_strength_data.total_val +=
pattrib->signal_strength;
-   padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.
-   signal_strength_data.index++] =
+   padapter->recvpriv.signal_strength_data.elements
+   [padapter->recvpriv.signal_strength_data.index++] =
pattrib->signal_strength;
if (padapter->recvpriv.signal_strength_data.index >=
PHY_RSSI_SLID_WIN_MAX)
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c
b/drivers/staging/rtl8712/rtl871x_cmd.c
index a424f447a725..620cee8b8514 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -455,8 +455,8 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter,
struct wlan_network *pnetwork)
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
struct security_priv*psecuritypriv = &padapter->securitypriv;
struct registry_priv*pregistrypriv = &padapter->registrypriv;
-   enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->
-   network.InfrastructureMode;
+   enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode =
+   pnetwork->network.InfrastructureMode;

padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
@@ -862,22 +862,22 @@ void r8712_createbss_cmd_callback(struct _adapter
*padapter,
pnetwork->Privacy = le32_to_cpu(pnetwork->Privacy);
pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
pnetwork->NetworkTypeInUse = le32_to_cpu(pnetwork->NetworkTypeInUse);
-   pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->
-   Configuration.ATIMWindow);
-   pnetwork->Configuration.DSConfig = le32_to_cpu(pnetwork->
-   Configuration.DSConfig);
-   pnetwork->Configuration.FHConfig.DwellTime = le32_to_cpu(pnetwork->
-   Configuration.FHConfig.DwellTime);
-   pnetwork->Configuration.FHConfig.HopPattern = le32_to_cpu(pnetwork->
-   Configuration.FHConfig.HopPattern);
-   pnetwork->Configuration.FHConfig.HopSet = le32_to_cpu(pnetwork->
-   Configuration.FHConfig.HopSet);
-   pnetwork->Configuration.FHConfig.Length = le32_to_cpu(pnetwork->
-   Configuration.FHConfig.Length);
-   pnetwork->Configuration.Length = le32_to_cpu(pnetwork->
-   Configuration.Length);
-   pnetwork->InfrastructureMode = le32_to_cpu(pnetwork->
-  InfrastructureMode);
+   pnetwork->Configuration.ATIMWindow =
+   le32_to_cpu(pnetwork->Configuration.ATIMWindow);
+   pnetwork->Configuration.DSConfig =
+   le32_to_cpu(pnetwork->Configuration.DSConfig);
+   pnetwork->Configuration.FHConfig.DwellTime =
+   le32_to_cpu(pnetwork->Configuration.FHConfig.DwellTime);
+  

[PATCH 5/5] staging: rtl8712: style fix returned error code

2017-12-18 Thread Martin Homuth
This patch fixes a coding style issues in the rtl8712 module as noted
by checkpatch.pl regarding the returned error code.

It fixes the following checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 08b8b396abd2..ba5f08f1247e 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1857,7 +1857,7 @@ static int dummy(struct net_device *dev,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b)
 {
-   return -ENOSYS;
+   return -EINVAL;
 }

 static int r8711_drvext_hdl(struct net_device *dev,
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 0/5] staging: rtl8712: fix several checkpatch style issues

2017-12-18 Thread Martin Homuth
This patch series fixes some coding style issues reported by checkpatch.pl.

It is based on next-20171218

v2:
 - avoid line-wrapping by thunderbird
 - use temporary pointers to avoid index in separate line ([2/5])

Martin Homuth (5):
  staging: rtl8712: style fix over 80 characters warnings
  staging: rtl8712: style fix multiple line dereferences
  staging: rtl8712: style fix indentation
  staging: rtl8712: style fix unneeded else
  staging: rtl8712: style fix returned error code

 drivers/staging/rtl8712/ieee80211.c   |  6 ++-
 drivers/staging/rtl8712/os_intfs.c|  5 +-
 drivers/staging/rtl8712/rtl8712_cmd.c | 18 ---
 drivers/staging/rtl8712/rtl8712_recv.c| 14 +++--
 drivers/staging/rtl8712/rtl8712_xmit.c|  3 +-
 drivers/staging/rtl8712/rtl871x_cmd.c | 36 ++---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 75 ++-
 drivers/staging/rtl8712/rtl871x_ioctl_set.c   | 72 +
 drivers/staging/rtl8712/rtl871x_mlme.c|  9 ++--
 drivers/staging/rtl8712/rtl871x_mlme.h|  3 +-
 drivers/staging/rtl8712/rtl871x_security.c| 37 ++---
 drivers/staging/rtl8712/usb_ops_linux.c   |  2 +-
 12 files changed, 143 insertions(+), 137 deletions(-)

-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 2/5] staging: rtl8712: style fix multiple line dereferences

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl related to dereferencing over multiple lines.

It fixes the following checkpatch.pl warning:

WARNING: Avoid multiple line dereference - prefer %s

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl8712_recv.c| 14 +++---
 drivers/staging/rtl8712/rtl871x_cmd.c | 36 
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 61 ++-
 drivers/staging/rtl8712/rtl871x_mlme.c|  9 ++--
 drivers/staging/rtl8712/rtl871x_security.c| 25 +--
 5 files changed, 72 insertions(+), 73 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl8712_recv.c 
b/drivers/staging/rtl8712/rtl8712_recv.c
index 8f555e6e1b3f..7665c00b2485 100644
--- a/drivers/staging/rtl8712/rtl8712_recv.c
+++ b/drivers/staging/rtl8712/rtl8712_recv.c
@@ -899,6 +899,7 @@ static void process_link_qual(struct _adapter *padapter,
 {
u32 last_evm = 0, tmpVal;
struct rx_pkt_attrib *pattrib;
+   struct smooth_rssi_data *sqd = &padapter->recvpriv.signal_qual_data;
 
if (prframe == NULL || padapter == NULL)
return;
@@ -918,9 +919,8 @@ static void process_link_qual(struct _adapter *padapter,
}
padapter->recvpriv.signal_qual_data.total_val +=
  pattrib->signal_qual;
-   padapter->recvpriv.signal_qual_data.elements[padapter->
- recvpriv.signal_qual_data.index++] =
- pattrib->signal_qual;
+   padapter->recvpriv.signal_qual_data.elements[sqd->index++] =
+   pattrib->signal_qual;
if (padapter->recvpriv.signal_qual_data.index >=
PHY_LINKQUALITY_SLID_WIN_MAX)
padapter->recvpriv.signal_qual_data.index = 0;
@@ -936,20 +936,18 @@ static void process_rssi(struct _adapter *padapter, union 
recv_frame *prframe)
 {
u32 last_rssi, tmp_val;
struct rx_pkt_attrib *pattrib = &prframe->u.hdr.attrib;
+   struct smooth_rssi_data *ssd = &padapter->recvpriv.signal_strength_data;
 
if (padapter->recvpriv.signal_strength_data.total_num++ >=
PHY_RSSI_SLID_WIN_MAX) {
padapter->recvpriv.signal_strength_data.total_num =
 PHY_RSSI_SLID_WIN_MAX;
-   last_rssi = padapter->recvpriv.signal_strength_data.elements
-   [padapter->recvpriv.signal_strength_data.index];
+   last_rssi = ssd->elements[ssd->index];
padapter->recvpriv.signal_strength_data.total_val -= last_rssi;
}
padapter->recvpriv.signal_strength_data.total_val +=
pattrib->signal_strength;
-   padapter->recvpriv.signal_strength_data.elements[padapter->recvpriv.
-   signal_strength_data.index++] =
-   pattrib->signal_strength;
+   ssd->elements[ssd->index++] = pattrib->signal_strength;
if (padapter->recvpriv.signal_strength_data.index >=
PHY_RSSI_SLID_WIN_MAX)
padapter->recvpriv.signal_strength_data.index = 0;
diff --git a/drivers/staging/rtl8712/rtl871x_cmd.c 
b/drivers/staging/rtl8712/rtl871x_cmd.c
index a424f447a725..620cee8b8514 100644
--- a/drivers/staging/rtl8712/rtl871x_cmd.c
+++ b/drivers/staging/rtl8712/rtl871x_cmd.c
@@ -455,8 +455,8 @@ u8 r8712_joinbss_cmd(struct _adapter  *padapter, struct 
wlan_network *pnetwork)
struct qos_priv *pqospriv = &pmlmepriv->qospriv;
struct security_priv*psecuritypriv = &padapter->securitypriv;
struct registry_priv*pregistrypriv = &padapter->registrypriv;
-   enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode = pnetwork->
-   network.InfrastructureMode;
+   enum NDIS_802_11_NETWORK_INFRASTRUCTURE ndis_network_mode =
+   pnetwork->network.InfrastructureMode;
 
padapter->ledpriv.LedControlHandler(padapter, LED_CTL_START_TO_LINK);
pcmd = kmalloc(sizeof(*pcmd), GFP_ATOMIC);
@@ -862,22 +862,22 @@ void r8712_createbss_cmd_callback(struct _adapter 
*padapter,
pnetwork->Privacy = le32_to_cpu(pnetwork->Privacy);
pnetwork->Rssi = le32_to_cpu(pnetwork->Rssi);
pnetwork->NetworkTypeInUse = le32_to_cpu(pnetwork->NetworkTypeInUse);
-   pnetwork->Configuration.ATIMWindow = le32_to_cpu(pnetwork->
-   Configuration.ATIMWindow);
-   pnetwork->Configuration.DSConfig = le32_to_cpu(pnetwork->
-   Configuration.DSConfig);
-   pnetwork->Configuration.FHConfig.DwellTime 

[PATCH v2 1/5] staging: rtl8712: style fix over 80 characters warnings

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl by reducing the characters per line to under
80.

It fixes the following checkpatch.pl warning:

WARNING: line over 80 characters

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/ieee80211.c|  6 --
 drivers/staging/rtl8712/os_intfs.c |  5 -
 drivers/staging/rtl8712/rtl8712_cmd.c  | 18 ++
 drivers/staging/rtl8712/rtl8712_xmit.c |  3 ++-
 drivers/staging/rtl8712/rtl871x_mlme.h |  3 ++-
 5 files changed, 22 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8712/ieee80211.c 
b/drivers/staging/rtl8712/ieee80211.c
index 33e82a9dd462..987270395635 100644
--- a/drivers/staging/rtl8712/ieee80211.c
+++ b/drivers/staging/rtl8712/ieee80211.c
@@ -169,12 +169,13 @@ int r8712_generate_ie(struct registry_priv *pregistrypriv)
int sz = 0, rate_len;
struct wlan_bssid_ex *pdev_network = &pregistrypriv->dev_network;
u8 *ie = pdev_network->IEs;
+   u16 beaconPeriod = (u16)pdev_network->Configuration.BeaconPeriod;
 
/*timestamp will be inserted by hardware*/
sz += 8;
ie += sz;
/*beacon interval : 2bytes*/
-   *(__le16 *)ie = 
cpu_to_le16((u16)pdev_network->Configuration.BeaconPeriod);
+   *(__le16 *)ie = cpu_to_le16(beaconPeriod);
sz += 2;
ie += 2;
/*capability info*/
@@ -221,7 +222,8 @@ unsigned char *r8712_get_wpa_ie(unsigned char *pie, int 
*wpa_ie_len, int limit)
pbuf = r8712_get_ie(pbuf, _WPA_IE_ID_, &len, limit);
if (pbuf) {
/*check if oui matches...*/
-   if (memcmp((pbuf + 2), wpa_oui_type, 
sizeof(wpa_oui_type)))
+   if (memcmp((pbuf + 2), wpa_oui_type,
+  sizeof(wpa_oui_type)))
goto check_next_ie;
/*check version...*/
memcpy((u8 *)&val16, (pbuf + 6), sizeof(val16));
diff --git a/drivers/staging/rtl8712/os_intfs.c 
b/drivers/staging/rtl8712/os_intfs.c
index 95caf8df9a13..e7df5d7986fc 100644
--- a/drivers/staging/rtl8712/os_intfs.c
+++ b/drivers/staging/rtl8712/os_intfs.c
@@ -238,10 +238,13 @@ static u32 start_drv_threads(struct _adapter *padapter)
 
 void r8712_stop_drv_threads(struct _adapter *padapter)
 {
+   struct completion *completion =
+   &padapter->cmdpriv.terminate_cmdthread_comp;
+
/*Below is to terminate r8712_cmd_thread & event_thread...*/
complete(&padapter->cmdpriv.cmd_queue_comp);
if (padapter->cmdThread)
-   
wait_for_completion_interruptible(&padapter->cmdpriv.terminate_cmdthread_comp);
+   wait_for_completion_interruptible(completion);
padapter->cmdpriv.cmd_seq = 1;
 }
 
diff --git a/drivers/staging/rtl8712/rtl8712_cmd.c 
b/drivers/staging/rtl8712/rtl8712_cmd.c
index 3c88994fdfcd..9c8e0c50a804 100644
--- a/drivers/staging/rtl8712/rtl8712_cmd.c
+++ b/drivers/staging/rtl8712/rtl8712_cmd.c
@@ -321,10 +321,13 @@ int r8712_cmd_thread(void *context)
void (*pcmd_callback)(struct _adapter *dev, struct cmd_obj *pcmd);
struct _adapter *padapter = context;
struct  cmd_priv*pcmdpriv = &(padapter->cmdpriv);
+   struct completion *cmd_queue_comp =
+   &pcmdpriv->cmd_queue_comp;
+   struct mutex *pwctrl_lock = &padapter->pwrctrlpriv.mutex_lock;
 
allow_signal(SIGTERM);
while (1) {
-   if 
(wait_for_completion_interruptible(&pcmdpriv->cmd_queue_comp))
+   if (wait_for_completion_interruptible(cmd_queue_comp))
break;
if (padapter->bDriverStopped || padapter->bSurpriseRemoved)
break;
@@ -343,6 +346,7 @@ int r8712_cmd_thread(void *context)
if (pcmd) { /* if pcmd != NULL, cmd will be handled by f/w */
struct dvobj_priv *pdvobj = &padapter->dvobjpriv;
u8 blnPending = 0;
+   u16 cmdcode = pcmd->cmdcode;
 
pcmdpriv->cmd_issued_cnt++;
cmdsz = round_up(pcmd->cmdsz, 8);
@@ -387,20 +391,18 @@ int r8712_cmd_thread(void *context)
r8712_write_mem(padapter, RTL8712_DMA_H2CCMD, wr_sz,
(u8 *)pdesc);
pcmdpriv->cmd_seq++;
-   if (pcmd->cmdcode == GEN_CMD_CODE(_CreateBss)) {
+   if (cmdcode == GEN_CMD_CODE(_CreateBss)) {
pcmd->res = H2C_SUCCESS;
-   pcmd_callback = cmd_callback[pcmd->
-   cmdcode].callback;
+   pcmd_callback = cmd_callback[cmdcode].callback;
  

[PATCH v2 4/5] staging: rtl8712: style fix unneeded else

2017-12-18 Thread Martin Homuth
This patch fixes a coding style issues in the rtl8712 module as noted
by checkpatch.pl where an unnecessary else is used.

It fixes the following checkpatch.pl warning:

WARNING: else is not generally useful after a break or return

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_set.c | 72 ++---
 1 file changed, 35 insertions(+), 37 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_set.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
index 8a5ced4fa9d3..f4a53df7f2c1 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_set.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_set.c
@@ -55,6 +55,7 @@ static u8 do_join(struct _adapter *padapter)
u8 *pibss = NULL;
struct  mlme_priv   *pmlmepriv = &(padapter->mlmepriv);
struct  __queue *queue  = &(pmlmepriv->scanned_queue);
+   int ret;
 
phead = &queue->queue;
plist = phead->next;
@@ -74,45 +75,42 @@ static u8 do_join(struct _adapter *padapter)
if (!pmlmepriv->sitesurveyctrl.traffic_busy)
r8712_sitesurvey_cmd(padapter, &pmlmepriv->assoc_ssid);
return true;
-   } else {
-   int ret;
+   }
 
-   ret = r8712_select_and_join_from_scan(pmlmepriv);
-   if (ret == _SUCCESS) {
-   mod_timer(&pmlmepriv->assoc_timer,
- jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
+   ret = r8712_select_and_join_from_scan(pmlmepriv);
+   if (ret == _SUCCESS) {
+   mod_timer(&pmlmepriv->assoc_timer,
+ jiffies + msecs_to_jiffies(MAX_JOIN_TIMEOUT));
+   } else {
+   if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
+   /* submit r8712_createbss_cmd to change to an
+* ADHOC_MASTER pmlmepriv->lock has been
+* acquired by caller...
+*/
+   struct wlan_bssid_ex *pdev_network =
+   &(padapter->registrypriv.dev_network);
+   pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
+   pibss = padapter->registrypriv.dev_network.MacAddress;
+   memcpy(&pdev_network->Ssid,
+  &pmlmepriv->assoc_ssid,
+  sizeof(struct ndis_802_11_ssid));
+   r8712_update_registrypriv_dev_network(padapter);
+   r8712_generate_random_ibss(pibss);
+   if (r8712_createbss_cmd(padapter) != _SUCCESS)
+   return false;
+   pmlmepriv->to_join = false;
} else {
-   if (check_fwstate(pmlmepriv, WIFI_ADHOC_STATE)) {
-   /* submit r8712_createbss_cmd to change to an
-* ADHOC_MASTER pmlmepriv->lock has been
-* acquired by caller...
-*/
-   struct wlan_bssid_ex *pdev_network =
-   &(padapter->registrypriv.dev_network);
-   pmlmepriv->fw_state = WIFI_ADHOC_MASTER_STATE;
-   pibss = padapter->registrypriv.dev_network.
-   MacAddress;
-   memcpy(&pdev_network->Ssid,
-   &pmlmepriv->assoc_ssid,
-   sizeof(struct ndis_802_11_ssid));
-   r8712_update_registrypriv_dev_network(padapter);
-   r8712_generate_random_ibss(pibss);
-   if (r8712_createbss_cmd(padapter) != _SUCCESS)
-   return false;
-   pmlmepriv->to_join = false;
-   } else {
-   /* can't associate ; reset under-linking */
-   if (pmlmepriv->fw_state & _FW_UNDER_LINKING)
-   pmlmepriv->fw_state ^=
-_FW_UNDER_LINKING;
-   /* when set_ssid/set_bssid for do_join(), but
-* there are no desired bss in scanning queue
-* we try to issue sitesurvey first
-*/
-   if (!pmlmepriv->sitesurveyctrl.traffic_busy)
-   r8712_sitesurvey_cmd(padapter,
-  &pmlmepriv->assoc_ssid);
-   }
+   /* can't a

[PATCH v2 3/5] staging: rtl8712: style fix indentation

2017-12-18 Thread Martin Homuth
This patch fixes various coding style issues in the rtl8712 module as
noted by checkpatch.pl related to indentation.

It fixes the following checkpatch.pl warning:

WARNING: suspect code indent for conditional statements

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 12 ++--
 drivers/staging/rtl8712/rtl871x_security.c| 12 ++--
 drivers/staging/rtl8712/usb_ops_linux.c   |  2 +-
 3 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 50e6582b9955..2c8b99d48f22 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1722,12 +1722,12 @@ static int r871x_wx_set_auth(struct net_device *dev,
 */
if (padapter->securitypriv.ndisencryptstatus ==
Ndis802_11Encryption1Enabled) {
-   /* it means init value, or using wep,
-* ndisencryptstatus =
-*  Ndis802_11Encryption1Enabled,
-* then it needn't reset it;
-*/
-   break;
+   /* it means init value, or using wep,
+* ndisencryptstatus =
+*  Ndis802_11Encryption1Enabled,
+* then it needn't reset it;
+*/
+   break;
}
 
if (paramval) {
diff --git a/drivers/staging/rtl8712/rtl871x_security.c 
b/drivers/staging/rtl8712/rtl871x_security.c
index 4cea9bacb8e2..75d86998fd58 100644
--- a/drivers/staging/rtl8712/rtl871x_security.c
+++ b/drivers/staging/rtl8712/rtl871x_security.c
@@ -1069,16 +1069,16 @@ static sint aes_cipher(u8 *key, uinthdrlen,
if ((frtype == WIFI_DATA_CFACK) ||
 (frtype == WIFI_DATA_CFPOLL) ||
 (frtype == WIFI_DATA_CFACKPOLL)) {
-   qc_exists = 1;
-   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
-   hdrlen += 2;
+   qc_exists = 1;
+   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
+   hdrlen += 2;
} else if ((frsubtype == 0x08) ||
   (frsubtype == 0x09) ||
   (frsubtype == 0x0a) ||
   (frsubtype == 0x0b)) {
-   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
-   hdrlen += 2;
-   qc_exists = 1;
+   if (hdrlen !=  WLAN_HDR_A3_QOS_LEN)
+   hdrlen += 2;
+   qc_exists = 1;
} else {
qc_exists = 0;
}
diff --git a/drivers/staging/rtl8712/usb_ops_linux.c 
b/drivers/staging/rtl8712/usb_ops_linux.c
index 441e76b8959d..6d12a96fa65f 100644
--- a/drivers/staging/rtl8712/usb_ops_linux.c
+++ b/drivers/staging/rtl8712/usb_ops_linux.c
@@ -145,7 +145,7 @@ static unsigned int ffaddr2pipehdl(struct dvobj_priv 
*pdvobj, u32 addr)
break;
}
} else {
-  pipe = 0;
+   pipe = 0;
}
return pipe;
 }
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2 5/5] staging: rtl8712: style fix returned error code

2017-12-18 Thread Martin Homuth
This patch fixes a coding style issues in the rtl8712 module as noted
by checkpatch.pl regarding the returned error code.

It fixes the following checkpatch.pl warning:

WARNING: ENOSYS means 'invalid syscall nr' and nothing else

Signed-off-by: Martin Homuth 
---
 drivers/staging/rtl8712/rtl871x_ioctl_linux.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c 
b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
index 2c8b99d48f22..d17b16079778 100644
--- a/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
+++ b/drivers/staging/rtl8712/rtl871x_ioctl_linux.c
@@ -1856,7 +1856,7 @@ static int dummy(struct net_device *dev,
struct iw_request_info *a,
union iwreq_data *wrqu, char *b)
 {
-   return -ENOSYS;
+   return -EINVAL;
 }
 
 static int r8711_drvext_hdl(struct net_device *dev,
-- 
2.15.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] [RFC] staging/net: move AF_X25 into drivers/staging

2019-12-10 Thread Martin Schiller

On 2019-12-09 20:26, Arnd Bergmann wrote:
On Mon, Dec 9, 2019 at 7:29 PM David Miller  
wrote:


From: Arnd Bergmann 
Date: Mon,  9 Dec 2019 16:12:56 +0100

> syzbot keeps finding issues in the X.25 implementation that nobody is
> interested in fixing.  Given that all the x25 patches of the past years
> that are not global cleanups tend to fix user-triggered oopses, is it
> time to just retire the subsystem?

I have a bug fix that I'm currently applying to 'net' right now 
actually:


https://patchwork.ozlabs.org/patch/1205973/

So your proposal might be a bit premature.


Ok, makes sense. Looking back in the history, I also see other bugfixes
from the same author.

Adding Martin Schiller to Cc: for a few questions:

- What hardware are you using for X.25?


I would say that X.25 is (at least in Germany) not dead yet. For 
example, it is
still used in the railway network of the Deutsche Bahn AG in many 
different

areas. [1]

We deliver products for this and use the Linux X.25 stack with some 
bugfixes

and extensions that I would like to get upstream.

As hardware/interfaces we use X.21bis/G.703 adapters, which are 
connected via
HDLC_X25 and LAPB. Also for this there are extensions and bugfixes, 
which I

would like to include in the kernel.


- Would you be available to be listed in the MAINTAINERS file
  as a contact for net/x25?


Yes, you can add me to the MAINTAINERS file.
I have only limited time, but I will try to follow all requests 
concerning this

subsystem.


- Does your bug fix address the latest issue found by syzbot[1],
  or do you have an idea to fix it if not?


I don't have a direct solution for the concrete problem mentioned above, 
but at

first sight I would say that the commit 95d6ebd53c79 ("net/x25: fix
use-after-free in x25_device_event()") holds the wrong lock 
(&x25_list_lock).
Shouldn't this be the lock &x25_neigh_list_lock as in x25_get_neigh(), 
where

x25_neigh_hold() is called?



Arnd

[1]
https://lore.kernel.org/netdev/cak8p3a0ldf+aq1hnzrvkknbqaum0wqw1jyr7_eb+jriwyhw...@mail.gmail.com/


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH 4/4] [RFC] staging/net: move AF_X25 into drivers/staging

2019-12-10 Thread Martin Schiller

On 2019-12-10 14:51, Arnd Bergmann wrote:

On Tue, Dec 10, 2019 at 9:59 AM Martin Schiller  wrote:

On 2019-12-09 20:26, Arnd Bergmann wrote:
> On Mon, Dec 9, 2019 at 7:29 PM David Miller 
> wrote:
>>
>> From: Arnd Bergmann 
>> Date: Mon,  9 Dec 2019 16:12:56 +0100
>>
>> > syzbot keeps finding issues in the X.25 implementation that nobody is
>> > interested in fixing.  Given that all the x25 patches of the past years
>> > that are not global cleanups tend to fix user-triggered oopses, is it
>> > time to just retire the subsystem?
>>
>> I have a bug fix that I'm currently applying to 'net' right now
>> actually:
>>
>> https://patchwork.ozlabs.org/patch/1205973/
>>
>> So your proposal might be a bit premature.
>
> Ok, makes sense. Looking back in the history, I also see other bugfixes
> from the same author.
>
> Adding Martin Schiller to Cc: for a few questions:
>
> - What hardware are you using for X.25?

I would say that X.25 is (at least in Germany) not dead yet. For
example, it is still used in the railway network of the Deutsche Bahn 
AG

in many different areas. [1]

We deliver products for this and use the Linux X.25 stack with some
bugfixes and extensions that I would like to get upstream.


Right, when I looked for possible users, I found several examples
where X.25 is still relevant, my impression was just that none of those
were using the mainline Linux network stack.

Thank you for clarifying that.


As hardware/interfaces we use X.21bis/G.703 adapters, which are
connected via
HDLC_X25 and LAPB. Also for this there are extensions and bugfixes,
which I  would like to include in the kernel.



> - Would you be available to be listed in the MAINTAINERS file
>   as a contact for net/x25?

Yes, you can add me to the MAINTAINERS file.
I have only limited time, but I will try to follow all requests
concerning this subsystem.


Great! I don't expect there to be a lot of work, but it definitely 
helps

to have someone who can look at the occasional build failure or
code cleanup patch.

If this works for everyone, I'd submit the following patch:

commit b63caa9a8d86a5bfc64052bf9aab9b22181120fd (HEAD)
Author: Arnd Bergmann 
Date:   Tue Dec 10 14:28:39 2019 +0100

MAINTAINERS: add new X.25 maintainer

Martin Schiller is using the Linux X.25 stack on top of HDLC and
X.21 networks. He agreed to be listed as a maintainer to take
care of odd fixes.

Add him as the primary contact for net/x25 and net/lapb, as well
as a reviewer for drivers/net/wan, which contains the HDLC code.

Cc: Martin Schiller 
Cc: Andrew Hendry 
Cc: Krzysztof Halasa 
Link:
https://lore.kernel.org/netdev/407acd92c92c3ba04578da89b1a0f...@dev.tdt.de/
Signed-off-by: Arnd Bergmann 



ACK!

Acked-by: Martin Schiller 


diff --git a/MAINTAINERS b/MAINTAINERS
index 8e58410a799a..00b624b96103 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -6889,6 +6889,7 @@ F:
Documentation/i2c/muxes/i2c-mux-gpio.rst


 GENERIC HDLC (WAN) DRIVERS
 M: Krzysztof Halasa 
+R: Martin Schiller 
 W: http://www.kernel.org/pub/linux/utils/net/hdlc/
 S: Maintained
 F: drivers/net/wan/c101.c
@@ -9255,13 +9256,6 @@ S:   Maintained
 F: arch/mips/lantiq
 F: drivers/soc/lantiq

-LAPB module
-L: linux-...@vger.kernel.org
-S: Orphan
-F: Documentation/networking/lapb-module.txt
-F: include/*/lapb.h
-F: net/lapb/
-
 LASI 53c700 driver for PARISC
 M: "James E.J. Bottomley" 
 L: linux-s...@vger.kernel.org
@@ -17911,11 +17905,16 @@ S:Maintained
 N: axp[128]

 X.25 NETWORK LAYER
+M: Martin Schiller 
 M: Andrew Hendry 
 L: linux-...@vger.kernel.org
 S: Odd Fixes
 F: Documentation/networking/x25*
+F: Documentation/networking/lapb-module.txt
+F: include/linux/lapb.h
 F: include/net/x25*
+F: include/uapi/linux/x25.h
+F: net/lapb/
 F: net/x25/

 X86 ARCHITECTURE (32-BIT AND 64-BIT)

-

> - Does your bug fix address the latest issue found by syzbot[1],
>   or do you have an idea to fix it if not?

I don't have a direct solution for the concrete problem mentioned 
above,

but at
first sight I would say that the commit 95d6ebd53c79 ("net/x25: fix
use-after-free in x25_device_event()") holds the wrong lock
(&x25_list_lock).
Shouldn't this be the lock &x25_neigh_list_lock as in x25_get_neigh(),
where x25_neigh_hold() is called?


After looking at it again, my best guess is something else:
x25_wait_for_connection_establishment() calls 
release_sock()/lock_sock()

while waiting. At this point, a concurrent x25_connect() can
overwrite the x25->neighbour variable, which needs to be checked
again before calling x25_neigh_put().



That's a good point. I wonder why any further call to x25_

[PATCH] binder: fix log spam for existing debugfs file creation.

2020-01-10 Thread Martin Fuzzey
Since commit 43e23b6c0b01 ("debugfs: log errors when something goes wrong")
debugfs logs attempts to create existing files.

However binder attempts to create multiple debugfs files with
the same name when a single PID has multiple contexts, this leads
to log spamming during an Android boot (17 such messages during
boot on my system).

Fix this by checking if we already know the PID and only create
the debugfs entry for the first context per PID.

Do the same thing for binderfs for symmetry.

Signed-off-by: Martin Fuzzey 
---
 drivers/android/binder.c | 37 +++--
 1 file changed, 19 insertions(+), 18 deletions(-)

diff --git a/drivers/android/binder.c b/drivers/android/binder.c
index 976a694..254f87b 100644
--- a/drivers/android/binder.c
+++ b/drivers/android/binder.c
@@ -5203,10 +5203,11 @@ static int binder_mmap(struct file *filp, struct 
vm_area_struct *vma)
 
 static int binder_open(struct inode *nodp, struct file *filp)
 {
-   struct binder_proc *proc;
+   struct binder_proc *proc, *itr;
struct binder_device *binder_dev;
struct binderfs_info *info;
struct dentry *binder_binderfs_dir_entry_proc = NULL;
+   bool existing_pid = false;
 
binder_debug(BINDER_DEBUG_OPEN_CLOSE, "%s: %d:%d\n", __func__,
 current->group_leader->pid, current->pid);
@@ -5239,19 +5240,24 @@ static int binder_open(struct inode *nodp, struct file 
*filp)
filp->private_data = proc;
 
mutex_lock(&binder_procs_lock);
+   hlist_for_each_entry(itr, &binder_procs, proc_node) {
+   if (itr->pid == proc->pid) {
+   existing_pid = true;
+   break;
+   }
+   }
hlist_add_head(&proc->proc_node, &binder_procs);
mutex_unlock(&binder_procs_lock);
 
-   if (binder_debugfs_dir_entry_proc) {
+   if (binder_debugfs_dir_entry_proc && !existing_pid) {
char strbuf[11];
 
snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
/*
-* proc debug entries are shared between contexts, so
-* this will fail if the process tries to open the driver
-* again with a different context. The priting code will
-* anyway print all contexts that a given PID has, so this
-* is not a problem.
+* proc debug entries are shared between contexts.
+* Only create for the first PID to avoid debugfs log spamming
+* The printing code will anyway print all contexts for a given
+* PID so this is not a problem.
 */
proc->debugfs_entry = debugfs_create_file(strbuf, 0444,
binder_debugfs_dir_entry_proc,
@@ -5259,19 +5265,16 @@ static int binder_open(struct inode *nodp, struct file 
*filp)
&proc_fops);
}
 
-   if (binder_binderfs_dir_entry_proc) {
+   if (binder_binderfs_dir_entry_proc && !existing_pid) {
char strbuf[11];
struct dentry *binderfs_entry;
 
snprintf(strbuf, sizeof(strbuf), "%u", proc->pid);
/*
 * Similar to debugfs, the process specific log file is shared
-* between contexts. If the file has already been created for a
-* process, the following binderfs_create_file() call will
-* fail with error code EEXIST if another context of the same
-* process invoked binder_open(). This is ok since same as
-* debugfs, the log file will contain information on all
-* contexts of a given PID.
+* between contexts. Only create for the first PID.
+* This is ok since same as debugfs, the log file will contain
+* information on all contexts of a given PID.
 */
binderfs_entry = 
binderfs_create_file(binder_binderfs_dir_entry_proc,
strbuf, &proc_fops, (void *)(unsigned long)proc->pid);
@@ -5281,10 +5284,8 @@ static int binder_open(struct inode *nodp, struct file 
*filp)
int error;
 
error = PTR_ERR(binderfs_entry);
-   if (error != -EEXIST) {
-   pr_warn("Unable to create file %s in binderfs 
(error %d)\n",
-   strbuf, error);
-   }
+   pr_warn("Unable to create file %s in binderfs (error 
%d)\n",
+   strbuf, error);
}
}
 
-- 
1.9.1

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: r8188eu: default to "y" in Kconfig

2014-02-11 Thread Martin Walch
On Tuesday 11 February 2014 13:31:32 Paul Bolle wrote:
> This patch also deserves a
> Reported-by: Martin Walch 
> 
> line, but that apparently requires Martin's permission.

I would be happy. And I am sorry for not sending patches myself. As I expect
to find some more issues in Kconfig files soon, I wanted to gather all of
them before sending any patches. However, I did not expect this to take me
so long. Therefore I am glad you took the initiative and just created
some patches.
-- 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[RFC PATCH] staging: imx-drm: add suspend / resume

2014-03-20 Thread Martin Fuzzey
Currently i.MX53 boards with the imx-drm display driver active
fail an intensive suspend to ram / resume test.

After around 5 - 50 cycles it is no longer possible to resume
the board.

The culprit is the imx-drm driver which does not stop DMA
before suspending. Removing the driver "fixes" the problem.

This patch provides a minimal suspend / resume implementation
enabling the intensive test to work (500 cycles ok).

I am only sending this as RFC for the moment since I don't
really know the hardware or driver code well enough to be
sure this is the "right" way of doing it.

Signed-off-by: Martin Fuzzey 
---
 drivers/staging/imx-drm/ipu-v3/ipu-common.c |   47 +++
 drivers/staging/imx-drm/ipu-v3/ipu-prv.h|1 +
 2 files changed, 48 insertions(+)

diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-common.c 
b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
index 97ca692..484a90a 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-common.c
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-common.c
@@ -692,6 +692,8 @@ int ipu_idmac_enable_channel(struct ipuv3_channel *channel)
val |= idma_mask(channel->num);
ipu_idmac_write(ipu, val, IDMAC_CHA_EN(channel->num));
 
+   channel->enabled = true;
+
spin_unlock_irqrestore(&ipu->lock, flags);
 
return 0;
@@ -750,6 +752,8 @@ int ipu_idmac_disable_channel(struct ipuv3_channel *channel)
val &= ~idma_mask(channel->num);
ipu_cm_write(ipu, val, IPU_CHA_DB_MODE_SEL(channel->num));
 
+   channel->enabled = false;
+
spin_unlock_irqrestore(&ipu->lock, flags);
 
return 0;
@@ -1245,10 +1249,53 @@ static int ipu_remove(struct platform_device *pdev)
return 0;
 }
 
+#ifdef CONFIG_PM_SLEEP
+
+static int ipu_suspend(struct device *dev)
+{
+   struct ipu_soc *ipu = dev_get_drvdata(dev);
+   struct ipuv3_channel *channel;
+   int i;
+
+   channel = ipu->channel;
+   for (i = 0; i < ARRAY_SIZE(ipu->channel); i++, channel++) {
+   channel->suspended = false;
+   if (channel->enabled) {
+   if (ipu_idmac_wait_busy(channel, 50))
+   dev_warn(dev,
+   "%s: Timeout channel %d idle\n",
+   __func__, i);
+   ipu_idmac_disable_channel(channel);
+   channel->suspended = true;
+   }
+   }
+   return 0;
+}
+
+static int ipu_resume(struct device *dev)
+{
+   struct ipu_soc *ipu = dev_get_drvdata(dev);
+   struct ipuv3_channel *channel;
+   int i;
+
+   channel = ipu->channel;
+   for (i = 0; i < ARRAY_SIZE(ipu->channel); i++, channel++) {
+   if (channel->suspended) {
+   ipu_idmac_enable_channel(channel);
+   channel->suspended = false;
+   }
+   }
+   return 0;
+}
+#endif
+
+static SIMPLE_DEV_PM_OPS(ipu_pm_ops, ipu_suspend, ipu_resume);
+
 static struct platform_driver imx_ipu_driver = {
.driver = {
.name = "imx-ipuv3",
.of_match_table = imx_ipu_dt_ids,
+   .pm = &ipu_pm_ops,
},
.probe = ipu_probe,
.remove = ipu_remove,
diff --git a/drivers/staging/imx-drm/ipu-v3/ipu-prv.h 
b/drivers/staging/imx-drm/ipu-v3/ipu-prv.h
index 4df0050..233749a 100644
--- a/drivers/staging/imx-drm/ipu-v3/ipu-prv.h
+++ b/drivers/staging/imx-drm/ipu-v3/ipu-prv.h
@@ -144,6 +144,7 @@ struct ipuv3_channel {
 
bool enabled;
bool busy;
+   bool suspended;
 
struct ipu_soc *ipu;
 };

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [RFC PATCH] staging: imx-drm: add suspend / resume

2014-03-20 Thread Martin Fuzzey

Hi Fabio,
On 20/03/14 16:31, Fabio Estevam wrote:
Does this patch still cause the visual artifacts you mentioned 
earlier? Regards, Fabio Estevam 


No.

Since I switched from poking the registers to using the existing 
wrappers I have not observed any artifcats.


Regards,

Martin

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: xgifb: Coding style cleanup, newline added after declarations

2014-04-02 Thread Martin Berglund
Added newlines after declarations.

Signed-off-by: Martin Berglund 
---
 drivers/staging/xgifb/XGI_main_26.c | 2 ++
 drivers/staging/xgifb/vb_init.c | 2 ++
 drivers/staging/xgifb/vb_setmode.c  | 2 ++
 3 files changed, 6 insertions(+)

diff --git a/drivers/staging/xgifb/XGI_main_26.c 
b/drivers/staging/xgifb/XGI_main_26.c
index 46680468..a62d4dd 100644
--- a/drivers/staging/xgifb/XGI_main_26.c
+++ b/drivers/staging/xgifb/XGI_main_26.c
@@ -66,6 +66,7 @@ static int XGIfb_mode_rate_to_dclock(struct vb_device_info 
*XGI_Pr,
unsigned short ModeIdIndex = 0, ClockIndex = 0;
unsigned short RefreshRateTableIndex = 0;
int Clock;
+
InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
 
XGI_SearchModeID(ModeNo, &ModeIdIndex);
@@ -95,6 +96,7 @@ static int XGIfb_mode_rate_to_ddata(struct vb_device_info 
*XGI_Pr,
unsigned short HRE, HBE, HRS, HDE;
unsigned char sr_data, cr_data, cr_data2;
int B, C, D, F, temp, j;
+
InitTo330Pointer(HwDeviceExtension->jChipType, XGI_Pr);
if (!XGI_SearchModeID(ModeNo, &ModeIdIndex))
return 0;
diff --git a/drivers/staging/xgifb/vb_init.c b/drivers/staging/xgifb/vb_init.c
index 2154172..ff210dd 100644
--- a/drivers/staging/xgifb/vb_init.c
+++ b/drivers/staging/xgifb/vb_init.c
@@ -130,6 +130,7 @@ static void XGINew_DDRII_Bootup_XG27(
unsigned long P3c4, struct vb_device_info *pVBInfo)
 {
unsigned long P3d4 = P3c4 + 0x10;
+
pVBInfo->ram_type = XGINew_GetXG20DRAMType(HwDeviceExtension, pVBInfo);
XGINew_SetMemoryClock(pVBInfo);
 
@@ -389,6 +390,7 @@ static void XGI_SetDRAM_Helper(unsigned long P3d4, u8 seed, 
u8 temp2, u8 reg,
u8 shift_factor, u8 mask1, u8 mask2)
 {
u8 j;
+
for (j = 0; j < 4; j++) {
temp2 |= (((seed >> (2 * j)) & 0x03) << shift_factor);
xgifb_reg_set(P3d4, reg, temp2);
diff --git a/drivers/staging/xgifb/vb_setmode.c 
b/drivers/staging/xgifb/vb_setmode.c
index 400c726..c638c8f 100644
--- a/drivers/staging/xgifb/vb_setmode.c
+++ b/drivers/staging/xgifb/vb_setmode.c
@@ -49,6 +49,7 @@ void InitTo330Pointer(unsigned char ChipType, struct 
vb_device_info *pVBInfo)
 
if (ChipType == XG27) {
unsigned char temp;
+
pVBInfo->MCLKData = XGI27New_MCLKData;
pVBInfo->CR40 = XGI27_cr41;
pVBInfo->XGINew_CR97 = 0xc1;
@@ -5222,6 +5223,7 @@ void XGI_SenseCRT1(struct vb_device_info *pVBInfo)
unsigned short temp;
 
int i;
+
xgifb_reg_set(pVBInfo->P3c4, 0x05, 0x86);
 
/* to fix XG42 single LCD sense to CRT+LCD */
-- 
1.8.4.5

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8187se: fix pointer and return statement's syntax

2014-04-09 Thread Martin Kepplinger
Use the common kernel coding style.

Signed-off-by: Martin Kepplinger 
---
noise from the eudyptula challenge. applies to next-20140408 as well as
linus' current tree.

 drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c |6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
index 0dc5ae4..e6257b3 100644
--- a/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8187se/ieee80211/ieee80211_tx.c
@@ -180,7 +180,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 h_proto)
 int ieee80211_encrypt_fragment(struct ieee80211_device *ieee,
   struct sk_buff *frag, int hdr_len)
 {
-   struct ieee80211_crypt_data* crypt = ieee->crypt[ieee->tx_keyidx];
+   struct ieee80211_crypt_data *crypt = ieee->crypt[ieee->tx_keyidx];
int res;
 
/*
@@ -285,7 +285,7 @@ static int ieee80211_classify(struct sk_buff *skb,
 
if (!network->QoS_Enable) {
skb->priority = 0;
-   return(wme_UP);
+   return wme_UP;
}
 
if (eh->ether_type == __constant_htons(ETHERTYPE_IP)) {
@@ -304,7 +304,7 @@ static int ieee80211_classify(struct sk_buff *skb,
}
 
skb->priority = wme_UP;
-   return(wme_UP);
+   return wme_UP;
 }
 
 /* SKBs are added to the ieee->tx_queue. */
-- 
1.7.10.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: fix incorrect type in assignment in ieee80211_tx.c

2017-04-17 Thread Martin Karamihov
This patch fixes the following sparse warning:
ieee80211_tx.c:174:36: incorrect type in assignment (different base types)
ieee80211_tx.c:174:36: expected unsigned short [unsigned] [short] [usertype] 

ieee80211_tx.c:174:36: got restricted __be16 [usertype] 

by adding left side cast to __be16.

Signed-off-by: Martin Karamihov 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
index 7afdd05..bdb96a4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_tx.c
@@ -171,7 +171,7 @@ static inline int ieee80211_put_snap(u8 *data, u16 h_proto)
snap->oui[1] = oui[1];
snap->oui[2] = oui[2];
 
-   *(u16 *)(data + SNAP_SIZE) = htons(h_proto);
+   *(__be16 *)(data + SNAP_SIZE) = htons(h_proto);
 
return SNAP_SIZE + sizeof(u16);
 }
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: octeon-ethernet: fix TCP/UDP checksum calc

2015-12-21 Thread Hamish Martin
If the network portion of a frame is preceded by more than 14 bytes of
data, the checksum calculated in the HW is done over the wrong data and
is put in the wrong place.
In our use case an Octeon ethernet controller is connected to a Broadcom
switch chip. Extra data is included in the frame prior to egressing the
Octeon ethernet (i.e. 4 bytes of an 802.1Q tag, 4 bytes of a proprietary
BCM tag later stripped by the switch chip). This extra data causes the
checksum calculation to be incorrect.
The fix in this patch is to make use of the network header offset of the
skb. This enables the checksum to be calculated correctly.
This has been tested in both the configuration with the switch chip in
the egress path (as described above) and in a simple connection direct
to the wire.

Reviewed-by: Richard Laing 
Reviewed-by: Tim Beale 
Reviewed-by: Chris Packham 
Signed-off-by: Hamish Martin 
---
 drivers/staging/octeon/ethernet-tx.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/octeon/ethernet-tx.c 
b/drivers/staging/octeon/ethernet-tx.c
index c053c4a..5611a02 100644
--- a/drivers/staging/octeon/ethernet-tx.c
+++ b/drivers/staging/octeon/ethernet-tx.c
@@ -403,7 +403,7 @@ dont_put_skbuff_in_hw:
((ip_hdr(skb)->protocol == IPPROTO_TCP) ||
 (ip_hdr(skb)->protocol == IPPROTO_UDP))) {
/* Use hardware checksum calc */
-   pko_command.s.ipoffp1 = sizeof(struct ethhdr) + 1;
+   pko_command.s.ipoffp1 = skb_network_offset(skb) + 1;
}
 
if (USE_ASYNC_IOBDMA) {
-- 
2.6.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Important message..

2016-04-24 Thread Martin Cooper
American Red Cross wishes to inform interested and serious persons that our Job 
Employment Scheme continues.
Our primary target has ever been to reconstruct affected areas and provide 
relief to flood victims in the Philippine Typhoon areas.
 
Vacancies available are listed bellow:

-Electrical Engineer.
-Crane Operator.
-Dredging Crews.
-QC Engineer. (Electrical, Civil, Mechanical)
-Bulldozer Operator / Shovel Operator/ Loader Operator /
-Pipe Fitter / Fabricator / Piping Foreman / Charge Hand.
-Instrument Technician / Instrument Fitter
-Plumber / Plumber Foreman/ Steel Erector
-Safety Officer
-Welders
-Project Managers
-Required technician for repairing Refrigerator Washing machine and Ovans
-Registered Nurse


Interested Applicants should send their resume to ( 
recrui...@intlrecruitmentscheme.com ) 

Contact us below for more details.
 
Regards,

Mr. Martin Cooper
Coordinator
Flood dept.
American Red Cross,
Washington, DC 98148
E-mail: recrui...@intlrecruitmentscheme.com
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: checkpatch fixes: removed not necessary braces

2017-01-28 Thread Martin Karamihov
checkpatch fixes: removes not necessary braces 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: checkpatch fixes: removed not necessary braces {}

2017-01-28 Thread Martin Karamihov
Signed-off-by: Martin Karamihov 
---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c 
b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 134fa6c595a8..26e0ef224299 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
power_level_offset[11] = data;
if (regaddr == rTxAGC_B_Mcs11_Mcs08)
power_level_offset[12] = data;
-   if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+   if (regaddr == rTxAGC_B_Mcs15_Mcs12)
power_level_offset[13] = data;
-   }
 }
 
 static void rtl_addr_delay(struct adapter *adapt,
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8188eu: checkpatch fixes: removed not necessary braces {}

2017-01-28 Thread Martin Karamihov
Signed-off-by: Martin Karamihov 
---
checkpatch fixes: remove not necessary braces

 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c 
b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 134fa6c595a8..26e0ef224299 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
power_level_offset[11] = data;
if (regaddr == rTxAGC_B_Mcs11_Mcs08)
power_level_offset[12] = data;
-   if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+   if (regaddr == rTxAGC_B_Mcs15_Mcs12)
power_level_offset[13] = data;
-   }
 }
 
 static void rtl_addr_delay(struct adapter *adapt,
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

2017-01-31 Thread Martin Karamihov
This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

Signed-off-by: Martin Karamihov 
---
 drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c 
b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 134fa6c595a8..26e0ef224299 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
power_level_offset[11] = data;
if (regaddr == rTxAGC_B_Mcs11_Mcs08)
power_level_offset[12] = data;
-   if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+   if (regaddr == rTxAGC_B_Mcs15_Mcs12)
power_level_offset[13] = data;
-   }
 }
 
 static void rtl_addr_delay(struct adapter *adapt,
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

2017-02-01 Thread Martin Karamihov



On 02/01/2017 12:39 AM, Joe Perches wrote:

On Tue, 2017-01-31 at 21:24 +0200, Martin Karamihov wrote:

This is checkpatch fix for hal/bb_cfg.c file:
remove not necessary braces {}

Signed-off-by: Martin Karamihov 
---
  drivers/staging/rtl8188eu/hal/bb_cfg.c | 3 +--
  1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8188eu/hal/bb_cfg.c 
b/drivers/staging/rtl8188eu/hal/bb_cfg.c
index 134fa6c595a8..26e0ef224299 100644
--- a/drivers/staging/rtl8188eu/hal/bb_cfg.c
+++ b/drivers/staging/rtl8188eu/hal/bb_cfg.c
@@ -534,9 +534,8 @@ static void store_pwrindex_offset(struct adapter *adapter,
power_level_offset[11] = data;
if (regaddr == rTxAGC_B_Mcs11_Mcs08)
power_level_offset[12] = data;
-   if (regaddr == rTxAGC_B_Mcs15_Mcs12) {
+   if (regaddr == rTxAGC_B_Mcs15_Mcs12)
power_level_offset[13] = data;
-   }

presumably, this and the regaddr block above it
should be an else if or a switch/case.




I will prepare the patch if this code modification is needed right now. 
Is it?

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH v2] staging: rtl8188eu: remove not necessary braces {} (checkpatch fix)

2017-02-01 Thread Martin Karamihov

On 02/01/2017 08:11 PM, Joe Perches wrote:

...and clarifying the code for a
human reader is much more important than making a
file not have any checkpatch warnings.


I agree. I respect the developers' own coding style and believe that 
some things (>80 characters long lines, name conventions, etc) should be 
fixed by themselves (if they want to do that). I selected several TODOs 
with requests for code cleanups and chose a fix in attempt to accomplish 
my task with minimal inconvenience for the maintainers. I failed in my 
first attempts breaking some basic rules, sorry about that.


Martin
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Fix possible leak in vnt_download_firmware()

2015-02-12 Thread Martin Kepplinger
Am 2015-02-11 um 20:33 schrieb Christian Engelmayer:
> When failing to allocate buffer memory, function vnt_download_firmware() goes
> through the wrong exit path and fails to release the already requested
> firmware. Thus use the correct cleanup. Detected by Coverity CID 1269128.
> 
> Signed-off-by: Christian Engelmayer 
> ---
> Compile tested only. Applies against branch staging-next.
> ---
>  drivers/staging/vt6656/firmware.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/staging/vt6656/firmware.c 
> b/drivers/staging/vt6656/firmware.c
> index a177645af83e..d440f284bf18 100644
> --- a/drivers/staging/vt6656/firmware.c
> +++ b/drivers/staging/vt6656/firmware.c
> @@ -61,7 +61,7 @@ int vnt_download_firmware(struct vnt_private *priv)
>  
>   buffer = kmalloc(FIRMWARE_CHUNK_SIZE, GFP_KERNEL);
>   if (!buffer)
> - goto out;
> + goto free_fw;
>  
>   for (ii = 0; ii < fw->size; ii += FIRMWARE_CHUNK_SIZE) {
>   length = min_t(int, fw->size - ii, FIRMWARE_CHUNK_SIZE);
> 
looks good to me, although somebody else should review it too. feel free
to add

Reviewed-by: Martin Kepplinger 

if applicable.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v6] add support for Freescale's MMA8653FC 10 bit accelerometer

2015-03-27 Thread Martin Kepplinger
From: Martin Kepplinger 

The MMA8653FC is a low-power, three-axis, capacitive micromachined
accelerometer with 10 bits of resolution with flexible user-programmable
options.

Embedded interrupt functions enable overall power savings, by relieving the
host processor from continuously polling data, for example using the poll()
system call.

The device can be configured to generate wake-up interrupt signals from any
combination of the configurable embedded functions, enabling the MMA8653FC
to monitor events while remaining in a low-power mode during periods of
inactivity.

This driver provides devicetree properties to program the device's behaviour
and a simple, tested and documented sysfs interface. The data sheet and more
information is available on Freescale's website.

Signed-off-by: Martin Kepplinger 
Signed-off-by: Christoph Muellner 
---

patch revision history
..
v6 fix staging integration, base it on next-20150326 and change recipients
v5 clean up (suggested by Varka Bhadram) and move the driver to staging
v4 changes DT propery names, adds a missing interrupt source and removes
   the DT option to set interrupt line active high due to unsuccesful testing
v3 moves the driver from drivers/input/misc to drivers/misc
v2 corrects licensing and commit messages and adds appropriate recipients

 drivers/staging/Kconfig   |   2 +
 drivers/staging/Makefile  |   1 +
 drivers/staging/mma8653fc/Kconfig |  10 +
 drivers/staging/mma8653fc/Makefile|   1 +
 drivers/staging/mma8653fc/TODO| 146 ++
 drivers/staging/mma8653fc/mma8653fc.c | 864 ++
 6 files changed, 1024 insertions(+)
 create mode 100644 drivers/staging/mma8653fc/Kconfig
 create mode 100644 drivers/staging/mma8653fc/Makefile
 create mode 100644 drivers/staging/mma8653fc/TODO
 create mode 100644 drivers/staging/mma8653fc/mma8653fc.c

diff --git a/drivers/staging/Kconfig b/drivers/staging/Kconfig
index bfacf69..834d949 100644
--- a/drivers/staging/Kconfig
+++ b/drivers/staging/Kconfig
@@ -112,4 +112,6 @@ source "drivers/staging/i2o/Kconfig"
 
 source "drivers/staging/fsl-mc/Kconfig"
 
+source "drivers/staging/mma8653fc/Kconfig"
+
 endif # STAGING
diff --git a/drivers/staging/Makefile b/drivers/staging/Makefile
index 2bbd1bf..cfea86a 100644
--- a/drivers/staging/Makefile
+++ b/drivers/staging/Makefile
@@ -48,3 +48,4 @@ obj-$(CONFIG_COMMON_CLK_XLNX_CLKWZRD) += clocking-wizard/
 obj-$(CONFIG_FB_TFT)   += fbtft/
 obj-$(CONFIG_I2O)  += i2o/
 obj-$(CONFIG_FSL_MC_BUS)   += fsl-mc/
+obj-$(CONFIG_MMA8653FC)+= mma8653fc/
diff --git a/drivers/staging/mma8653fc/Kconfig 
b/drivers/staging/mma8653fc/Kconfig
new file mode 100644
index 000..988451b
--- /dev/null
+++ b/drivers/staging/mma8653fc/Kconfig
@@ -0,0 +1,10 @@
+config MMA8653FC
+tristate "MMA8653FC - Freescale's 3-Axis, 10-bit Digital Accelerometer"
+depends on I2C
+default n
+help
+  Say Y here if you want to support Freescale's MMA8653FC Accelerometer
+  through I2C interface.
+
+  To compile this driver as a module, choose M here: the
+  module will be called mma8653fc.
diff --git a/drivers/staging/mma8653fc/Makefile 
b/drivers/staging/mma8653fc/Makefile
new file mode 100644
index 000..9a245a3
--- /dev/null
+++ b/drivers/staging/mma8653fc/Makefile
@@ -0,0 +1 @@
+obj-$(CONFIG_MMA8653FC) += mma8653fc.o
diff --git a/drivers/staging/mma8653fc/TODO b/drivers/staging/mma8653fc/TODO
new file mode 100644
index 000..0a31225
--- /dev/null
+++ b/drivers/staging/mma8653fc/TODO
@@ -0,0 +1,146 @@
+- move to IIO device API. The current DT/sysfs interface is documented below
+
+Documentation/ABI/testing/...
+-
+What:  /sys/bus/i2c/drivers/mma8653fc/*/standby
+Date:  March 2015
+Contact:   Martin Kepplinger 
+Description:
+   Write 0 to this in order to turn on the device, and 1 to turn
+   it off. Read to see if it is turned on or off.
+
+
+What:  /sys/bus/i2c/drivers/mma8653fc/*/currentmode
+Date:  March 2015
+Contact:   Martin Kepplinger 
+Description:
+   Reading this provides the current state of the device, read
+   directly from a register. This can be "standby", "wake" or
+   "sleep".
+
+
+What:  /sys/bus/i2c/drivers/mma8653fc/*/position
+Date:  March 2015
+Contact:   Martin Kepplinger 
+Description:
+   Read only. Without interrupts enabled gets current position
+   values by reading. Poll "position" with interrupt conditions
+   set, to get notified; see Documentation/.../fsl,mma8653fc.txt
+
+   position file format:
+   "x y z [landscape/portrait status] [front/back status]"

Re: [PATCH] staging: skein: Remove extra blank lines

2016-09-26 Thread Martin Alonso
Ok Joe,
   Thanks and sorry for the annoyance.

On Mon, Sep 26, 2016 at 09:26:12AM -0700, Joe Perches wrote:
> On Mon, 2016-09-26 at 11:56 -0300, Martin wrote:
> > Fix coding style issue "multiple blank lines" 
> > detected by checkpatch.pl in threefish_block.c file.
> 
> This has been submitted and rejected a couple times already.
> The extra blank lines are to separate blocks.
> Whatever the blocks are, perhaps _adding_ a comment line 
> for each block might be better than removing a blank line.
> 
> > 

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-26 Thread Martin Alonso
Fix coding style issue "spaces preferred around '+'
detected by checkpatch.pl in dpc.c file.

Signed-off-by: Martin Alonso 
---
 drivers/staging/vt6656/dpc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 6019aac..900cd5c 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
 
skb_data = (u8 *)skb->data;
 
-   rx_sts = skb_data+4;
-   rx_rate = skb_data+5;
+   rx_sts = skb_data + 4;
+   rx_rate = skb_data + 5;
 
/* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
/* -8TSF - 4RSR - 4SQ3 - ?Padding */
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-27 Thread Martin Alonso
On Tue, Sep 27, 2016 at 01:10:04PM +0200, Greg KH wrote:
> On Mon, Sep 26, 2016 at 02:48:24PM -0300, Martin Alonso wrote:
> > Fix coding style issue "spaces preferred around '+'
> > detected by checkpatch.pl in dpc.c file.
> > 
> > Signed-off-by: Martin Alonso 
> > ---
> >  drivers/staging/vt6656/dpc.c | 4 ++--
> >  1 file changed, 2 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> > index 6019aac..900cd5c 100644
> > --- a/drivers/staging/vt6656/dpc.c
> > +++ b/drivers/staging/vt6656/dpc.c
> > @@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
> > *ptr_rcb,
> >  
> > skb_data = (u8 *)skb->data;
> >  
> > -   rx_sts = skb_data+4;
> > -   rx_rate = skb_data+5;
> > +   rx_sts = skb_data + 4;
> > +   rx_rate = skb_data + 5;
> >  
> > /* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
> > /* -8TSF - 4RSR - 4SQ3 - ?Padding */
> > -- 
> > 2.8.0
> > 
> 
> Doesn't apply to my tree, did someone do this before you?  You are
> working against linux-next, right?
> 
> thanks,
> 
> greg k-h
I wasn't working against linux-next as i though.
Sorry for the annoyance.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] staging: vt6656: Add spaces around '+' operator

2016-09-27 Thread Martin Alonso
On Mon, Sep 26, 2016 at 11:02:33AM -0700, Joe Perches wrote:
> On Mon, 2016-09-26 at 14:48 -0300, Martin Alonso wrote:
> > Fix coding style issue "spaces preferred around '+'
> > detected by checkpatch.pl in dpc.c file.
> []
> > diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
> []
> > @@ -75,8 +75,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
> > *ptr_rcb,
> >  
> > >   skb_data = (u8 *)skb->data;
> >  
> > -   rx_sts = skb_data+4;
> > -   rx_rate = skb_data+5;
> > +   rx_sts = skb_data + 4;
> > +   rx_rate = skb_data + 5;
> >  
> >     /* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
> >     /* -8TSF - 4RSR - 4SQ3 - ?Padding */
> 
> You might as well make rx_rate u8 instead of u8 *
> and change the uses of rx_rate.  rx_sts isn't used
> anywhere at all and could be removed.
> 
I'll send two patches to fix this issues.
Regards.

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 2/2] staging: vt6656: Make 'rx_rate' u8 instead of u8 *

2016-09-27 Thread Martin Alonso
Change the type and uses of rx_rate.

Signed-off-by: Martin Alonso 
---
 drivers/staging/vt6656/dpc.c | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index 655f000..782b7d7 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -46,7 +46,8 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
__le64 *tsf_time;
u32 frame_size;
int ii, r;
-   u8 *rx_rate, *sq, *sq_3;
+   u8 rx_rate;
+   u8 *sq, *sq_3;
u32 wbk_status;
u8 *skb_data;
u16 *pay_load_len;
@@ -75,7 +76,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
 
skb_data = (u8 *)skb->data;
 
-   rx_rate = skb_data + 5;
+   rx_rate = *(skb_data + 5);
 
/* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
/* -8TSF - 4RSR - 4SQ3 - ?Padding */
@@ -96,7 +97,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
sband = hw->wiphy->bands[hw->conf.chandef.chan->band];
 
for (r = RATE_1M; r < MAX_RATE; r++) {
-   if (*rx_rate == rate[r])
+   if (rx_rate == rate[r])
break;
}
 
@@ -110,7 +111,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
}
 
if (ii == sband->n_bitrates) {
-   dev_dbg(&priv->usb->dev, "Wrong RxRate %x\n", *rx_rate);
+   dev_dbg(&priv->usb->dev, "Wrong RxRate %x\n", rx_rate);
return false;
}
 
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] staging: vt6656: Remove unused variable 'rx_sts'

2016-09-27 Thread Martin Alonso
As suggested by Joe Perches, rx_sts is not
used anywhere and could be removed.

Signed-off-by: Martin Alonso 
---
 drivers/staging/vt6656/dpc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/drivers/staging/vt6656/dpc.c b/drivers/staging/vt6656/dpc.c
index c352c70..655f000 100644
--- a/drivers/staging/vt6656/dpc.c
+++ b/drivers/staging/vt6656/dpc.c
@@ -46,7 +46,7 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
__le64 *tsf_time;
u32 frame_size;
int ii, r;
-   u8 *rx_sts, *rx_rate, *sq, *sq_3;
+   u8 *rx_rate, *sq, *sq_3;
u32 wbk_status;
u8 *skb_data;
u16 *pay_load_len;
@@ -75,7 +75,6 @@ int vnt_rx_data(struct vnt_private *priv, struct vnt_rcb 
*ptr_rcb,
 
skb_data = (u8 *)skb->data;
 
-   rx_sts = skb_data + 4;
rx_rate = skb_data + 5;
 
/* real Frame Size = USBframe_size -4WbkStatus - 4RxStatus */
-- 
2.8.0


___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [lustre-devel] [patch] Staging: lustre: indent an if statement

2016-10-14 Thread Martin Hecht
On 10/14/2016 12:38 AM, James Simmons wrote:
>> This if statement wasn't intended.
just to be sure: in conjunction with the subject of the mail this should
read "indented" instead of "intended", right?
- otherwise this would result in a slightly different patch...


> Acked-by: James Simmons 
>  
>> Signed-off-by: Dan Carpenter 
>>
>> diff --git a/drivers/staging/lustre/lustre/obdclass/cl_object.c 
>> b/drivers/staging/lustre/lustre/obdclass/cl_object.c
>> index 3199dd4..a102c36 100644
>> --- a/drivers/staging/lustre/lustre/obdclass/cl_object.c
>> +++ b/drivers/staging/lustre/lustre/obdclass/cl_object.c
>> @@ -335,7 +335,7 @@ int cl_object_getstripe(const struct lu_env *env, struct 
>> cl_object *obj,
>>  if (obj->co_ops->coo_getstripe) {
>>  result = obj->co_ops->coo_getstripe(env, obj, uarg);
>>  if (result)
>> -break;
>> +break;
>>  }
>>  }
>>  return result;
>>
> ___
> lustre-devel mailing list
> lustre-de...@lists.lustre.org
> http://lists.lustre.org/listinfo.cgi/lustre-devel-lustre.org




smime.p7s
Description: S/MIME Cryptographic Signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: vboxvideo: Kconfig: Fix typos in help text

2017-07-23 Thread Martin Kepplinger
This fixes typos in vboxvideo's help text.

Signed-off-by: Martin Kepplinger 
---
 drivers/staging/vboxvideo/Kconfig | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/vboxvideo/Kconfig 
b/drivers/staging/vboxvideo/Kconfig
index a52746f9a670..2b058d573cf1 100644
--- a/drivers/staging/vboxvideo/Kconfig
+++ b/drivers/staging/vboxvideo/Kconfig
@@ -6,7 +6,7 @@ config DRM_VBOXVIDEO
  This is a KMS driver for the virtual Graphics Card used in
  Virtual Box virtual machines.
 
- Although it is possible to builtin this module, it is advised
+ Although it is possible to build in this module, it is advised
  to build this driver as a module, so that it can be updated
- independently of the kernel. Select M to built this driver as a
+ independently of the kernel. Select M to build this driver as a
  module and add support for these devices via drm/kms interfaces.
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] staging: vboxvideo: Kconfig: Fix typos in help text

2017-07-24 Thread Martin Kepplinger
This fixes typos in vboxvideo's help text. Most notably, "to builtin
this module" becomes "to build this driver built-in to the kernel".

Signed-off-by: Martin Kepplinger 
---

Thanks Dan. I actually also had the feeling that even though it's better,
it's not as clear as it could be. It's either a module or built-in; not both.

revision history

v2: Say "to build this driver built-in to the kernel" instead of "build in
this module".


 drivers/staging/vboxvideo/Kconfig | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vboxvideo/Kconfig 
b/drivers/staging/vboxvideo/Kconfig
index a52746f9a670..b8df8f60823a 100644
--- a/drivers/staging/vboxvideo/Kconfig
+++ b/drivers/staging/vboxvideo/Kconfig
@@ -6,7 +6,8 @@ config DRM_VBOXVIDEO
  This is a KMS driver for the virtual Graphics Card used in
  Virtual Box virtual machines.
 
- Although it is possible to builtin this module, it is advised
- to build this driver as a module, so that it can be updated
- independently of the kernel. Select M to built this driver as a
- module and add support for these devices via drm/kms interfaces.
+ Although it is possible to build this driver built-in to the
+ kernel, it is advised to build this driver as a module, so that
+ it can be updated independently of the kernel. Select M to build
+ this driver as a module and add support for these devices via
+ drm/kms interfaces.
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v3] staging: vboxvideo: Kconfig: Fix typos in help text

2017-07-24 Thread Martin Kepplinger
This fixes typos in vboxvideo's help text. Most notably, "to builtin
this module" becomes "to build this driver built-in to the kernel".

Signed-off-by: Martin Kepplinger 
---

revision history

v3: Avoid a repetition of "this driver".

v2: Say "to build this driver built-in to the kernel" instead of "build in
this module". - Thanks Dan.


 drivers/staging/vboxvideo/Kconfig | 9 +
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/vboxvideo/Kconfig 
b/drivers/staging/vboxvideo/Kconfig
index a52746f9a670..3200b6895178 100644
--- a/drivers/staging/vboxvideo/Kconfig
+++ b/drivers/staging/vboxvideo/Kconfig
@@ -6,7 +6,8 @@ config DRM_VBOXVIDEO
  This is a KMS driver for the virtual Graphics Card used in
  Virtual Box virtual machines.
 
- Although it is possible to builtin this module, it is advised
- to build this driver as a module, so that it can be updated
- independently of the kernel. Select M to built this driver as a
- module and add support for these devices via drm/kms interfaces.
+ Although it is possible to build this driver built-in to the
+ kernel, it is advised to build it as a module, so that it can
+ be updated independently of the kernel. Select M to build this
+ driver as a module and add support for these devices via drm/kms
+ interfaces.
-- 
2.11.0

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rdma: Fix braces around if/else

2015-10-03 Thread Martin Kletzander
Get rid of all ELSE_AFTER_BRACE type errors reported by checkpatch.pl.

Signed-off-by: Martin Kletzander 
---
There is one warning reported in this patch though.  That's because of
the multiline string and it's pre-existing.  Feel free to let me know
if that should be fixed too, I'd also remove the pointless '#' then.
On the other hand, it'll create more-than-80-columns long line.

 drivers/staging/rdma/ipath/ipath_driver.c| 19 ---
 drivers/staging/rdma/ipath/ipath_file_ops.c  | 12 ++--
 drivers/staging/rdma/ipath/ipath_iba6110.c   |  7 +++
 drivers/staging/rdma/ipath/ipath_init_chip.c | 10 +-
 drivers/staging/rdma/ipath/ipath_intr.c  |  7 +++
 drivers/staging/rdma/ipath/ipath_sysfs.c |  7 +++
 drivers/staging/rdma/ipath/ipath_verbs.c |  4 ++--
 7 files changed, 30 insertions(+), 36 deletions(-)

diff --git a/drivers/staging/rdma/ipath/ipath_driver.c 
b/drivers/staging/rdma/ipath/ipath_driver.c
index 871dbe56216a..46d98980d66a 100644
--- a/drivers/staging/rdma/ipath/ipath_driver.c
+++ b/drivers/staging/rdma/ipath/ipath_driver.c
@@ -490,8 +490,7 @@ static int ipath_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
"Unable to set DMA mask for unit %u: %d\n",
dd->ipath_unit, ret);
goto bail_regions;
-   }
-   else {
+   } else {
ipath_dbg("No 64bit DMA mask, used 32 bit mask\n");
ret = pci_set_consistent_dma_mask(pdev, 
DMA_BIT_MASK(32));
if (ret)
@@ -501,8 +500,7 @@ static int ipath_init_one(struct pci_dev *pdev, const 
struct pci_device_id *ent)
dd->ipath_unit, ret);

}
-   }
-   else {
+   } else {
ret = pci_set_consistent_dma_mask(pdev, DMA_BIT_MASK(64));
if (ret)
dev_info(&pdev->dev,
@@ -1229,11 +1227,10 @@ reloop:
ipath_cdbg(PKT, "typ %x, opcode %x (eager, "
   "qp=%x), len %x; ignored\n",
   etype, opcode, qp, tlen);
-   }
-   else if (etype == RCVHQ_RCV_TYPE_EXPECTED)
+   } else if (etype == RCVHQ_RCV_TYPE_EXPECTED) {
ipath_dbg("Bug: Expected TID, opcode %x; ignored\n",
  be32_to_cpu(hdr->bth[0]) >> 24);
-   else {
+   } else {
/*
 * error packet, type of error unknown.
 * Probably type 3, but we don't know, so don't
@@ -1270,8 +1267,9 @@ reloop:
pd->port_seq_cnt = 1;
if (seq != pd->port_seq_cnt)
last = 1;
-   } else if (l == hdrqtail)
+   } else if (l == hdrqtail) {
last = 1;
+   }
/*
 * update head regs on last packet, and every 16 packets.
 * Reduce bus traffic, while still trying to prevent
@@ -1821,15 +1819,14 @@ int ipath_create_rcvhdrq(struct ipath_devdata *dd,
   (unsigned long) pd->port_rcvhdrq_phys,
   (unsigned long) pd->port_rcvhdrq_size,
   pd->port_port);
-   }
-   else
+   } else {
ipath_cdbg(VERBOSE, "reuse port %d rcvhdrq @%p %llx phys; "
   "hdrtailaddr@%p %llx physical\n",
   pd->port_port, pd->port_rcvhdrq,
   (unsigned long long) pd->port_rcvhdrq_phys,
   pd->port_rcvhdrtail_kvaddr, (unsigned long long)
   pd->port_rcvhdrqtailaddr_phys);
-
+   }
/* clear for security and sanity on each use */
memset(pd->port_rcvhdrq, 0, pd->port_rcvhdrq_size);
if (pd->port_rcvhdrtail_kvaddr)
diff --git a/drivers/staging/rdma/ipath/ipath_file_ops.c 
b/drivers/staging/rdma/ipath/ipath_file_ops.c
index c11f6c58ce53..04fe2dc51fe2 100644
--- a/drivers/staging/rdma/ipath/ipath_file_ops.c
+++ b/drivers/staging/rdma/ipath/ipath_file_ops.c
@@ -825,13 +825,13 @@ static void ipath_clean_part_key(struct ipath_portdata 
*pd,
ipath_stats.sps_pkeys[j] =
dd->ipath_pkeys[j] = 0;
pchanged++;
+   } else {
+   ipath_cdbg(VERBOSE, "p%u key %x matches #%d, "
+  "but ref still %d\n", pd->port_port,
+ 

Re: [PATCH] staging: rdma: Fix braces around if/else

2015-10-04 Thread Martin Kletzander

On Sun, Oct 04, 2015 at 08:20:09AM +0100, Greg Kroah-Hartman wrote:

On Sun, Oct 04, 2015 at 09:47:52AM +0300, Or Gerlitz wrote:

On 10/3/2015 11:55 PM, Martin Kletzander wrote:
>Get rid of all ELSE_AFTER_BRACE type errors reported by checkpatch.pl.

Hi Greg,

Is there a way to signal people/tools that a certain driver parks in staging
on their way **out** of the kernel
and not the other way around? I guess you (nor Doug) don't want to spend
time on fixing such drivers, right?


I'm not spending the time :)

But no, there isn't a way to really show that that I know of, and it's
fine, we end up getting a number of "cleanup" patches for a kernel
release or two before the drivers get deleted.  It gets people involved
in kernel development which is the key thing here, it's not like they
are actually using these drivers...

So it's fine, I take the patches, the people writing the patches are
happy, and the code gets a bit nicer and feels better about itself
before we kick it out the door.



I didn't mean to waste anyone's time on this.  I'm just trying to get
more familiar with the patch submission process into the kernel.  And
I'm doing this in my free time despite the address used.  I probably
should've noted that below to commit message.

Martin


signature.asc
Description: PGP signature
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] Staging: sm7xxfb: fixed line break coding style issues

2013-09-27 Thread Martin Berglund
Fixed coding style issues.

Signed-off-by: Martin Berglund 
---
 drivers/staging/sm7xxfb/sm7xxfb.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c 
b/drivers/staging/sm7xxfb/sm7xxfb.c
index 8add64b..57d8145 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -259,8 +259,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
if (sfb->fb.var.bits_per_pixel == 16) {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
pal[regno] =
@@ -274,8 +273,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
} else {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
val =
@@ -508,9 +506,8 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
 
/* init SEQ register SR30 - SR75 */
for (i = 0; i < SIZE_SR30_SR75; i++)
-   if (((i + 0x30) != 0x62) \
-   && ((i + 0x30) != 0x6a) \
-   && ((i + 0x30) != 0x6b))
+   if (((i + 0x30) != 0x62) && ((i + 0x30) != 0x6a)
+   && ((i + 0x30) != 0x6b))
smtc_seqw(i + 0x30,
VGAMode[j].Init_SR30_SR75[i]);
 
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: sm7xxfb: fixed line break coding style issues

2013-09-27 Thread Martin Berglund
On Fri, Sep 27, 2013 at 03:27:29PM +0300, Dan Carpenter wrote:
> On Fri, Sep 27, 2013 at 02:08:07PM +0200, Martin Berglund wrote:
> > @@ -508,9 +506,8 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
> >  
> > /* init SEQ register SR30 - SR75 */
> > for (i = 0; i < SIZE_SR30_SR75; i++)
> > -   if (((i + 0x30) != 0x62) \
> > -   && ((i + 0x30) != 0x6a) \
> > -   && ((i + 0x30) != 0x6b))
> > +   if (((i + 0x30) != 0x62) && ((i + 0x30) != 0x6a)
> > +   && ((i + 0x30) != 0x6b))
> 
> The prefered way would be to align this like this:
> 
>   if ((i + 0x30) != 0x62 &&
>   (i + 0x30) != 0x6a &&
>   (i + 0x30) != 0x6b)
> 
> regards,
> dan carpenter
> 

New patch.

Signed-off-by: Martin Berglund 
---
 drivers/staging/sm7xxfb/sm7xxfb.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c 
b/drivers/staging/sm7xxfb/sm7xxfb.c
index 8add64b..8ba0097 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -259,8 +259,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
if (sfb->fb.var.bits_per_pixel == 16) {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
pal[regno] =
@@ -274,8 +273,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
} else {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
val =
@@ -508,9 +506,9 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
 
/* init SEQ register SR30 - SR75 */
for (i = 0; i < SIZE_SR30_SR75; i++)
-   if (((i + 0x30) != 0x62) \
-   && ((i + 0x30) != 0x6a) \
-   && ((i + 0x30) != 0x6b))
+   if ((i + 0x30) != 0x62 &&
+   (i + 0x30) != 0x6a &&
+   (i + 0x30) != 0x6b)
smtc_seqw(i + 0x30,
VGAMode[j].Init_SR30_SR75[i]);
 
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH v2] Staging: sm7xxfb: fixed line break coding style issues

2013-09-27 Thread Martin Berglund
Fixed coding style issues.

Signed-off-by: Martin Berglund 
---
v2: minor style change as suggested by Dan.
 drivers/staging/sm7xxfb/sm7xxfb.c | 12 +---
 1 file changed, 5 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/sm7xxfb/sm7xxfb.c 
b/drivers/staging/sm7xxfb/sm7xxfb.c
index 8add64b..8ba0097 100644
--- a/drivers/staging/sm7xxfb/sm7xxfb.c
+++ b/drivers/staging/sm7xxfb/sm7xxfb.c
@@ -259,8 +259,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
if (sfb->fb.var.bits_per_pixel == 16) {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
pal[regno] =
@@ -274,8 +273,7 @@ static int smtc_setcolreg(unsigned regno, unsigned red, 
unsigned green,
} else {
u32 *pal = sfb->fb.pseudo_palette;
val = chan_to_field(red, &sfb->fb.var.red);
-   val |= chan_to_field(green, \
-   &sfb->fb.var.green);
+   val |= chan_to_field(green, &sfb->fb.var.green);
val |= chan_to_field(blue, &sfb->fb.var.blue);
 #ifdef __BIG_ENDIAN
val =
@@ -508,9 +506,9 @@ static void sm7xx_set_timing(struct smtcfb_info *sfb)
 
/* init SEQ register SR30 - SR75 */
for (i = 0; i < SIZE_SR30_SR75; i++)
-   if (((i + 0x30) != 0x62) \
-   && ((i + 0x30) != 0x6a) \
-   && ((i + 0x30) != 0x6b))
+   if ((i + 0x30) != 0x62 &&
+   (i + 0x30) != 0x6a &&
+   (i + 0x30) != 0x6b)
smtc_seqw(i + 0x30,
VGAMode[j].Init_SR30_SR75[i]);
 
-- 
1.8.4

___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


  1   2   3   >