Re: [RFC PATCH 00/12] Ion cleanup in preparation for moving out of staging

2017-03-05 Thread Michal Hocko
On Fri 03-03-17 09:37:55, Laura Abbott wrote:
> On 03/03/2017 05:29 AM, Michal Hocko wrote:
> > On Thu 02-03-17 13:44:32, Laura Abbott wrote:
> >> Hi,
> >>
> >> There's been some recent discussions[1] about Ion-like frameworks. There's
> >> apparently interest in just keeping Ion since it works reasonablly well.
> >> This series does what should be the final clean ups for it to possibly be
> >> moved out of staging.
> >>
> >> This includes the following:
> >> - Some general clean up and removal of features that never got a lot of use
> >>   as far as I can tell.
> >> - Fixing up the caching. This is the series I proposed back in December[2]
> >>   but never heard any feedback on. It will certainly break existing
> >>   applications that rely on the implicit caching. I'd rather make an effort
> >>   to move to a model that isn't going directly against the establishement
> >>   though.
> >> - Fixing up the platform support. The devicetree approach was never well
> >>   recieved by DT maintainers. The proposal here is to think of Ion less as
> >>   specifying requirements and more of a framework for exposing memory to
> >>   userspace.
> >> - CMA allocations now happen without the need of a dummy device structure.
> >>   This fixes a bunch of the reasons why I attempted to add devicetree
> >>   support before.
> >>
> >> I've had problems getting feedback in the past so if I don't hear any major
> >> objections I'm going to send out with the RFC dropped to be picked up.
> >> The only reason there isn't a patch to come out of staging is to discuss 
> >> any
> >> other changes to the ABI people might want. Once this comes out of staging,
> >> I really don't want to mess with the ABI.
> > 
> > Could you recapitulate concerns preventing the code being merged
> > normally rather than through the staging tree and how they were
> > addressed?
> > 
> 
> Sorry, I'm really not understanding your question here, can you
> clarify?

There must have been a reason why this code ended up in the staging
tree, right? So my question is what those reasons were and how they were
handled in order to move the code from the staging subtree.
-- 
Michal Hocko
SUSE Labs
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [PATCH] Staging: wlan-ng: hfa384x.h: fixed a newline coding style issue

2017-03-05 Thread Greg KH
On Sun, Mar 05, 2017 at 09:09:12PM -0500, Mark Stenglein wrote:
> Fixed a coding style issue.

What issue would that be?

> Signed-off-by: Mark Stenglein 
> ---
>  drivers/staging/wlan-ng/hfa384x.h | 1 +
>  1 file changed, 1 insertion(+)
> 
> diff --git a/drivers/staging/wlan-ng/hfa384x.h 
> b/drivers/staging/wlan-ng/hfa384x.h
> index 5f1851c85f12..f19984747b1e 100644
> --- a/drivers/staging/wlan-ng/hfa384x.h
> +++ b/drivers/staging/wlan-ng/hfa384x.h
> @@ -1175,6 +1175,7 @@ struct hfa384x_usbctlx {
>   enum ctlx_state state;  /* Tracks running state */
>  
>   struct completion done;
> +
>   volatile int reapable;  /* Food for the reaper task */

What is wrong with the original code here?

Please don't blindly trust checkpatch.pl all the time, sometimes you
have to use your brain when reading the results.

thanks,

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


Re: [greybus-dev] [PATCH 2/3] staging: greybus: Replace "is is" with "is"

2017-03-05 Thread Viresh Kumar
On 04-03-17, 21:37, simran singhal wrote:
> This patch replace "is is " with "is". The replacement couldn't be
> automated because sometimes the first "is" was meant to be another
> word.
> 
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/greybus/uart.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

Acked-by: Viresh Kumar 

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


[PATCH] Staging: wlan-ng: hfa384x.h: fixed a newline coding style issue

2017-03-05 Thread Mark Stenglein
Fixed a coding style issue.

Signed-off-by: Mark Stenglein 
---
 drivers/staging/wlan-ng/hfa384x.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/staging/wlan-ng/hfa384x.h 
b/drivers/staging/wlan-ng/hfa384x.h
index 5f1851c85f12..f19984747b1e 100644
--- a/drivers/staging/wlan-ng/hfa384x.h
+++ b/drivers/staging/wlan-ng/hfa384x.h
@@ -1175,6 +1175,7 @@ struct hfa384x_usbctlx {
enum ctlx_state state;  /* Tracks running state */
 
struct completion done;
+
volatile int reapable;  /* Food for the reaper task */
 
ctlx_cmdcb_t cmdcb; /* Async command callback */
-- 
2.12.0


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


Assist

2017-03-05 Thread Sgt Swanson Dennis
Dear Sir/Madam,

I am Sgt Swanson Dennis, I have a good business proposal for you.
There are no risks involved and it is easy. Please reply for briefs
and procedures.

Best regards,

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


Assist

2017-03-05 Thread Sgt Swanson Dennis
Dear Sir/Madam,

I am Sgt Swanson Dennis, I have a good business proposal for you.
There are no risks involved and it is easy. Please reply for briefs
and procedures.

Best regards,

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


Assist

2017-03-05 Thread Sgt Swanson Dennis
Dear Sir/Madam,

I am Sgt Swanson Dennis, I have a good business proposal for you.
There are no risks involved and it is easy. Please reply for briefs
and procedures.

Best regards,

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


Re: [PATCH v4 13/36] [media] v4l2: add a frame timeout event

2017-03-05 Thread Russell King - ARM Linux
On Sat, Mar 04, 2017 at 04:37:43PM -0800, Steve Longerbeam wrote:
> 
> 
> On 03/04/2017 02:56 AM, Sakari Ailus wrote:
> >That's a bit of a special situation --- still there are alike conditions on
> >existing hardware. You should return the buffers to the user with the ERROR
> >flag set --- or return -EIO from VIDIOC_DQBUF, if the condition will
> >persist:
> 
> On i.MX an EOF timeout is not recoverable without a stream restart, so
> I decided to call vb2_queue_error() when the timeout occurs (instead
> of sending an event). The user will then get -EIO when it attempts to
> queue or dequeue further buffers.

I'm not sure that statement is entirely accurate.  With the IMX219
camera, I _could_ (with previous iterations of the iMX capture code)
stop it streaming, wait a while, and restart it, and everything
continues to work.

Are you sure that the problem you have here is caused by the iMX6
rather than the ADV718x CVBS decoder (your initial description said
it was the decoder.)

If it _is_ the decoder that's going wrong, that doesn't justify
cripping the rest of the driver for one instance of broken hardware
that _might_ be attached to it.

-- 
RMK's Patch system: http://www.armlinux.org.uk/developer/patches/
FTTC broadband for 0.8mile line: currently at 9.6Mbps down 400kbps up
according to speedtest.net.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 1/2] Formatting updates to remove checkpatch warnings in ks_wlan_ioctl.h.

2017-03-05 Thread Matthew Giassa
Implementing some minor formatting changes to remove checkpatch warnings.
Removing space-hardtab instances. Removing C++-style line comments in favor of
C-style equivalent. Re-aligning function prototype arguments to remove related
checkpatch warning.

Signed-off-by: Matthew Giassa 
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 16 
 1 file changed, 8 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/ks_wlan_ioctl.h
index 8e62b10..0e92495 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -1,6 +1,6 @@
 /*
  *   Driver for KeyStream 11b/g wireless LAN
- *   
+ *
  *   Copyright (c) 2005-2008 KeyStream Corp.
  *   Copyright (C) 2009 Renesas Technology Corp.
  *
@@ -20,8 +20,8 @@
 /* SIOCIWFIRSTPRIV + 2 */
 #define KS_WLAN_GET_FIRM_VERSION   SIOCIWFIRSTPRIV + 3
 #ifdef WPS
-#define KS_WLAN_SET_WPS_ENABLE SIOCIWFIRSTPRIV + 4
-#define KS_WLAN_GET_WPS_ENABLE SIOCIWFIRSTPRIV + 5
+#define KS_WLAN_SET_WPS_ENABLE SIOCIWFIRSTPRIV + 4
+#define KS_WLAN_GET_WPS_ENABLE SIOCIWFIRSTPRIV + 5
 #define KS_WLAN_SET_WPS_PROBE_REQ  SIOCIWFIRSTPRIV + 6
 #endif
 #define KS_WLAN_GET_EEPROM_CKSUM   SIOCIWFIRSTPRIV + 7
@@ -33,8 +33,8 @@
 #define KS_WLAN_GET_SCAN_TYPE  SIOCIWFIRSTPRIV + 13
 #define KS_WLAN_SET_RX_GAINSIOCIWFIRSTPRIV + 14
 #define KS_WLAN_GET_RX_GAINSIOCIWFIRSTPRIV + 15
-#define KS_WLAN_HOSTT  SIOCIWFIRSTPRIV + 16/* unused */
-//#define KS_WLAN_SET_REGIONSIOCIWFIRSTPRIV + 17
+#define KS_WLAN_HOSTT  SIOCIWFIRSTPRIV + 16 /* unused */
+/* #define KS_WLAN_SET_REGION  SIOCIWFIRSTPRIV + 17 */
 #define KS_WLAN_SET_BEACON_LOSTSIOCIWFIRSTPRIV + 18
 #define KS_WLAN_GET_BEACON_LOSTSIOCIWFIRSTPRIV + 19
 
@@ -48,8 +48,8 @@
 #define KS_WLAN_GET_CTS_MODE   SIOCIWFIRSTPRIV + 25
 /* SIOCIWFIRSTPRIV + 26 */
 /* SIOCIWFIRSTPRIV + 27 */
-#define KS_WLAN_SET_SLEEP_MODE SIOCIWFIRSTPRIV + 28/* sleep mode */
-#define KS_WLAN_GET_SLEEP_MODE SIOCIWFIRSTPRIV + 29/* sleep mode */
+#define KS_WLAN_SET_SLEEP_MODE SIOCIWFIRSTPRIV + 28 /* sleep mode */
+#define KS_WLAN_GET_SLEEP_MODE SIOCIWFIRSTPRIV + 29 /* sleep mode */
 /* SIOCIWFIRSTPRIV + 30 */
 /* SIOCIWFIRSTPRIV + 31 */
 
@@ -60,7 +60,7 @@
 
 int ks_wlan_read_config_file(struct ks_wlan_private *priv);
 int ks_wlan_setup_parameter(struct ks_wlan_private *priv,
-unsigned int commit_flag);
+   unsigned int commit_flag);
 
 #endif /* __KERNEL__ */
 
-- 
2.7.4

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


[PATCH 2/2] Formatting updates to resolve checkpatch errors in ks_wlan_ioctl.h.

2017-03-05 Thread Matthew Giassa
Updating macros to be wrapped in parentheses to accomodate checkpatch errors
throughout the header. This change, combined with the previous patch, resolves
all outstanding warnings/errors produce by checkpatch.

Signed-off-by: Matthew Giassa 
---
 drivers/staging/ks7010/ks_wlan_ioctl.h | 66 +-
 1 file changed, 32 insertions(+), 34 deletions(-)

diff --git a/drivers/staging/ks7010/ks_wlan_ioctl.h 
b/drivers/staging/ks7010/ks_wlan_ioctl.h
index 0e92495..bfb8555 100644
--- a/drivers/staging/ks7010/ks_wlan_ioctl.h
+++ b/drivers/staging/ks7010/ks_wlan_ioctl.h
@@ -15,43 +15,41 @@
 #include 
 /* The low order bit identify a SET (0) or a GET (1) ioctl.  */
 
-/* SIOCIWFIRSTPRIV + 0 */
-/* former KS_WLAN_GET_DRIVER_VERSION   SIOCIWFIRSTPRIV + 1 */
-/* SIOCIWFIRSTPRIV + 2 */
-#define KS_WLAN_GET_FIRM_VERSION   SIOCIWFIRSTPRIV + 3
+/* (SIOCIWFIRSTPRIV + 0) */
+/* former KS_WLAN_GET_DRIVER_VERSION   (SIOCIWFIRSTPRIV + 1) */
+/* (SIOCIWFIRSTPRIV + 2) */
+#define KS_WLAN_GET_FIRM_VERSION   (SIOCIWFIRSTPRIV + 3)
 #ifdef WPS
-#define KS_WLAN_SET_WPS_ENABLE SIOCIWFIRSTPRIV + 4
-#define KS_WLAN_GET_WPS_ENABLE SIOCIWFIRSTPRIV + 5
-#define KS_WLAN_SET_WPS_PROBE_REQ  SIOCIWFIRSTPRIV + 6
+#define KS_WLAN_SET_WPS_ENABLE (SIOCIWFIRSTPRIV + 4)
+#define KS_WLAN_GET_WPS_ENABLE (SIOCIWFIRSTPRIV + 5)
+#define KS_WLAN_SET_WPS_PROBE_REQ  (SIOCIWFIRSTPRIV + 6)
 #endif
-#define KS_WLAN_GET_EEPROM_CKSUM   SIOCIWFIRSTPRIV + 7
-#define KS_WLAN_SET_PREAMBLE   SIOCIWFIRSTPRIV + 8
-#define KS_WLAN_GET_PREAMBLE   SIOCIWFIRSTPRIV + 9
-#define KS_WLAN_SET_POWER_SAVE SIOCIWFIRSTPRIV + 10
-#define KS_WLAN_GET_POWER_SAVE SIOCIWFIRSTPRIV + 11
-#define KS_WLAN_SET_SCAN_TYPE  SIOCIWFIRSTPRIV + 12
-#define KS_WLAN_GET_SCAN_TYPE  SIOCIWFIRSTPRIV + 13
-#define KS_WLAN_SET_RX_GAINSIOCIWFIRSTPRIV + 14
-#define KS_WLAN_GET_RX_GAINSIOCIWFIRSTPRIV + 15
-#define KS_WLAN_HOSTT  SIOCIWFIRSTPRIV + 16 /* unused */
-/* #define KS_WLAN_SET_REGION  SIOCIWFIRSTPRIV + 17 */
-#define KS_WLAN_SET_BEACON_LOSTSIOCIWFIRSTPRIV + 18
-#define KS_WLAN_GET_BEACON_LOSTSIOCIWFIRSTPRIV + 19
-
-#define KS_WLAN_SET_TX_GAINSIOCIWFIRSTPRIV + 20
-#define KS_WLAN_GET_TX_GAINSIOCIWFIRSTPRIV + 21
-
+#define KS_WLAN_GET_EEPROM_CKSUM   (SIOCIWFIRSTPRIV + 7)
+#define KS_WLAN_SET_PREAMBLE   (SIOCIWFIRSTPRIV + 8)
+#define KS_WLAN_GET_PREAMBLE   (SIOCIWFIRSTPRIV + 9)
+#define KS_WLAN_SET_POWER_SAVE (SIOCIWFIRSTPRIV + 10)
+#define KS_WLAN_GET_POWER_SAVE (SIOCIWFIRSTPRIV + 11)
+#define KS_WLAN_SET_SCAN_TYPE  (SIOCIWFIRSTPRIV + 12)
+#define KS_WLAN_GET_SCAN_TYPE  (SIOCIWFIRSTPRIV + 13)
+#define KS_WLAN_SET_RX_GAIN(SIOCIWFIRSTPRIV + 14)
+#define KS_WLAN_GET_RX_GAIN(SIOCIWFIRSTPRIV + 15)
+#define KS_WLAN_HOSTT  (SIOCIWFIRSTPRIV + 16) /* unused */
+/* #define KS_WLAN_SET_REGION  (SIOCIWFIRSTPRIV + 17) */
+#define KS_WLAN_SET_BEACON_LOST(SIOCIWFIRSTPRIV + 18)
+#define KS_WLAN_GET_BEACON_LOST(SIOCIWFIRSTPRIV + 19)
+#define KS_WLAN_SET_TX_GAIN(SIOCIWFIRSTPRIV + 20)
+#define KS_WLAN_GET_TX_GAIN(SIOCIWFIRSTPRIV + 21)
 /* for KS7010 */
-#define KS_WLAN_SET_PHY_TYPE   SIOCIWFIRSTPRIV + 22
-#define KS_WLAN_GET_PHY_TYPE   SIOCIWFIRSTPRIV + 23
-#define KS_WLAN_SET_CTS_MODE   SIOCIWFIRSTPRIV + 24
-#define KS_WLAN_GET_CTS_MODE   SIOCIWFIRSTPRIV + 25
-/* SIOCIWFIRSTPRIV + 26 */
-/* SIOCIWFIRSTPRIV + 27 */
-#define KS_WLAN_SET_SLEEP_MODE SIOCIWFIRSTPRIV + 28 /* sleep mode */
-#define KS_WLAN_GET_SLEEP_MODE SIOCIWFIRSTPRIV + 29 /* sleep mode */
-/* SIOCIWFIRSTPRIV + 30 */
-/* SIOCIWFIRSTPRIV + 31 */
+#define KS_WLAN_SET_PHY_TYPE   (SIOCIWFIRSTPRIV + 22)
+#define KS_WLAN_GET_PHY_TYPE   (SIOCIWFIRSTPRIV + 23)
+#define KS_WLAN_SET_CTS_MODE   (SIOCIWFIRSTPRIV + 24)
+#define KS_WLAN_GET_CTS_MODE   (SIOCIWFIRSTPRIV + 25)
+/* (SIOCIWFIRSTPRIV + 26) */
+/* (SIOCIWFIRSTPRIV + 27) */
+#define KS_WLAN_SET_SLEEP_MODE (SIOCIWFIRSTPRIV + 28) /* sleep mode */
+#define KS_WLAN_GET_SLEEP_MODE (SIOCIWFIRSTPRIV + 29) /* sleep mode */
+/* (SIOCIWFIRSTPRIV + 30) */
+/* (SIOCIWFIRSTPRIV + 31) */
 
 #ifdef __KERNEL__
 
-- 
2.7.4

___
devel mailing list

Re: [PATCH v4 13/36] [media] v4l2: add a frame timeout event

2017-03-05 Thread Sakari Ailus
On Sat, Mar 04, 2017 at 04:37:43PM -0800, Steve Longerbeam wrote:
> 
> 
> On 03/04/2017 02:56 AM, Sakari Ailus wrote:
> >Hi Steve,
> >
> >On Fri, Mar 03, 2017 at 02:43:51PM -0800, Steve Longerbeam wrote:
> >>
> >>
> >>On 03/03/2017 03:45 AM, Sakari Ailus wrote:
> >>>On Thu, Mar 02, 2017 at 03:07:21PM -0800, Steve Longerbeam wrote:
> 
> 
> On 03/02/2017 07:53 AM, Sakari Ailus wrote:
> >Hi Steve,
> >
> >On Wed, Feb 15, 2017 at 06:19:15PM -0800, Steve Longerbeam wrote:
> >>Add a new FRAME_TIMEOUT event to signal that a video capture or
> >>output device has timed out waiting for reception or transmit
> >>completion of a video frame.
> >>
> >>Signed-off-by: Steve Longerbeam 
> >>---
> >>Documentation/media/uapi/v4l/vidioc-dqevent.rst | 5 +
> >>Documentation/media/videodev2.h.rst.exceptions  | 1 +
> >>include/uapi/linux/videodev2.h  | 1 +
> >>3 files changed, 7 insertions(+)
> >>
> >>diff --git a/Documentation/media/uapi/v4l/vidioc-dqevent.rst 
> >>b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> >>index 8d663a7..dd77d9b 100644
> >>--- a/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> >>+++ b/Documentation/media/uapi/v4l/vidioc-dqevent.rst
> >>@@ -197,6 +197,11 @@ call.
> >>the regions changes. This event has a struct
> >>:c:type:`v4l2_event_motion_det`
> >>associated with it.
> >>+* - ``V4L2_EVENT_FRAME_TIMEOUT``
> >>+  - 7
> >>+  - This event is triggered when the video capture or output device
> >>+   has timed out waiting for the reception or transmit completion 
> >>of
> >>+   a frame of video.
> >
> >As you're adding a new interface, I suppose you have an implementation
> >around. How do you determine what that timeout should be?
> 
> The imx-media driver sets the timeout to 1 second, or 30 frame
> periods at 30 fps.
> >>>
> >>>The frame rate is not necessarily constant during streaming. It may well
> >>>change as a result of lighting conditions.
> >>
> >>I think you mean that would be a _temporary_ change in frame rate, but
> >>yes I agree the data rate can temporarily fluctuate. Although I doubt
> >>lighting conditions would cause a sensor to pause data transmission
> >>for a full 1 second.
> >
> >Likely not, at least not in typical conditions. The exposure time is still
> >quite specific to applications: it could be minutes if you take photos e.g.
> >of the night sky.
> >
> >What I'm saying here is that any static value is likely not both reasonable
> >and workable in all potential situations all the time. Still there are cases
> >(as yours below) that may happen in relatively common cases on some hardware
> >(more common than taking long exposure photos of the night sky with the said
> >hardware :)).
> 
> I doubt night photography will ever be a use-case for i.MX. The most
> common use-case for this driver will be used in automotive applications
> such as rear-view or 360 degree view cameras.

Ack.

> 
> 
> >
> >>
> >>
> >>>I wouldn't add an event for this:
> >>>this is unreliable and 30 times the frame period is an arbitrary value
> >>>anyway. No other drivers do this either.
> >>
> >>If no other drivers do this I don't mind removing it. It is really meant
> >>to deal with the ADV718x CVBS decoder, which often simply stops sending
> >>data on the BT.656 bus if there is an interruption in the input analog
> >>signal. But I agree that user space could detect this timeout instead.
> >>Unless I hear from someone else that they would like to keep this
> >>feature I'll remove it in version 5.
> >
> >That's a bit of a special situation --- still there are alike conditions on
> >existing hardware. You should return the buffers to the user with the ERROR
> >flag set --- or return -EIO from VIDIOC_DQBUF, if the condition will
> >persist:
> 
> On i.MX an EOF timeout is not recoverable without a stream restart, so
> I decided to call vb2_queue_error() when the timeout occurs (instead
> of sending an event). The user will then get -EIO when it attempts to
> queue or dequeue further buffers.

It believe that's the correct thing to do.

> 
> 
> >
> >
> >
> >Do you already obtain the frame rate from the image source (e.g. tuner,
> >sensor, decoder) and multiply the frame time by some number in the current
> >implementation?
> 
> No the timeout is a constant value, regardless of the source frame
> rate. Should the timeout be based on a constant time, or based on a
> constant # of frames? I really don't think it matters much, what matters
> is that it be long enough to be reasonably sure no data is forthcoming,
> for most use-cases.

That should be fine. If there is a use case that requires something else,
then the implementation can be changed: it's not visible to the user space
anyway.

-- 

Re: [Outreachy kernel] [PATCH] staging: media: Remove unnecessary function and its call

2017-03-05 Thread Joe Perches
On Sun, 2017-03-05 at 10:14 -0800, Alison Schofield wrote:
> On Sun, Mar 05, 2017 at 12:17:21PM +0530, simran singhal wrote:
> > The function atomisp_set_stop_timeout on being called, simply returns
> > back. The function hasn't been mentioned in the TODO and doesn't have
> > FIXME code around. Hence, atomisp_set_stop_timeout and its calls have been
> > removed.
> > 
> > Signed-off-by: simran singhal 
> > ---
> 
> Hi Simran,
> 
> It's helpful to state right in the subject line what you removed.
> ie.  remove unused function atomisp_set_stop_timeout()
> 
> If you do that, scan's or grep'ing the git log pretty oneline's can 
> easily see this without having to dig into the log.
> 
> (gitpretty='git log --pretty=oneline --abbrev-commit')
> 
> Can you share to Outreachy group how you found this?  By inspection
> or otherwise??

At least for the rtl8192u patch submitted:

It's also helpful to read the comment you remove
and determine if what you are doing is the correct
thing to do and explain why it's OK in the commit
message. (fractured english below notwithstanding)

 /* These function were added to load crypte module autoly */
-   ieee80211_tkip_null();
 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH] staging: media: Remove unnecessary function and its call

2017-03-05 Thread Alison Schofield
On Sun, Mar 05, 2017 at 12:17:21PM +0530, simran singhal wrote:
> The function atomisp_set_stop_timeout on being called, simply returns
> back. The function hasn't been mentioned in the TODO and doesn't have
> FIXME code around. Hence, atomisp_set_stop_timeout and its calls have been
> removed.
> 
> Signed-off-by: simran singhal 
> ---

Hi Simran,

It's helpful to state right in the subject line what you removed.
ie.  remove unused function atomisp_set_stop_timeout()

If you do that, scan's or grep'ing the git log pretty oneline's can 
easily see this without having to dig into the log.

(gitpretty='git log --pretty=oneline --abbrev-commit')

Can you share to Outreachy group how you found this?  By inspection
or otherwise??

Thanks,
alisons


alisons


>  drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c  | 1 -
>  drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h   | 1 -
>  drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c | 5 -
>  3 files changed, 7 deletions(-)
> 
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> index e99f7b8..66299dd 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_cmd.c
> @@ -1700,7 +1700,6 @@ void atomisp_wdt_work(struct work_struct *work)
>   }
>   }
>  #endif
> - atomisp_set_stop_timeout(ATOMISP_CSS_STOP_TIMEOUT_US);
>   dev_err(isp->dev, "timeout recovery handling done\n");
>   atomic_set(>wdt_work_queued, 0);
>  
> diff --git a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h 
> b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
> index 5a404e4..0b9ced5 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat.h
> @@ -660,7 +660,6 @@ int atomisp_css_set_acc_parameters(struct atomisp_acc_fw 
> *acc_fw);
>  int atomisp_css_isr_thread(struct atomisp_device *isp,
>  bool *frame_done_found,
>  bool *css_pipe_done);
> -void atomisp_set_stop_timeout(unsigned int timeout);
>  
>  bool atomisp_css_valid_sof(struct atomisp_device *isp);
>  
> diff --git 
> a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c 
> b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
> index 6697d72..cfa0ad4 100644
> --- a/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
> +++ b/drivers/staging/media/atomisp/pci/atomisp2/atomisp_compat_css20.c
> @@ -4699,11 +4699,6 @@ int atomisp_css_isr_thread(struct atomisp_device *isp,
>   return 0;
>  }
>  
> -void atomisp_set_stop_timeout(unsigned int timeout)
> -{
> - return;
> -}
> -
>  bool atomisp_css_valid_sof(struct atomisp_device *isp)
>  {
>   unsigned int i, j;
> -- 
> 2.7.4
> 
> -- 
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/20170305064721.GA22548%40singhal-Inspiron-5558.
> For more options, visit https://groups.google.com/d/optout.
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, SIMRAN SINGHAL wrote:

> On Sun, Mar 5, 2017 at 11:18 PM, Julia Lawall  wrote:
> >
> >
> > On Sun, 5 Mar 2017, SIMRAN SINGHAL wrote:
> >
> >> On Sun, Mar 5, 2017 at 10:47 PM, Julia Lawall  wrote:
> >> > By the way, the above subject line is not correct.  Normally one does not
> >> > put .c/.h in the subject line.  Indeed, there is not really any
> >> > deterministic algorithm for choosing the subject line.  You need to run
> >> > git log --oneline filename to see what others have done.
> >>
> >> So this would be fine Subject:-
> >> staging: lustre: osc_page: Use list_for_each_entry_safe
> >
> > Looking at the result of git log --oneline, I would say:
> >
> > staging: lustre: osc:
> >
> > For example that it what is used by 86df598, which also only changes the
> > file modified by this patch.
> >
> Actually, I can't use this as its already subject of one of a patch of
> this patch
> series.

OK, then what you suggested would be ok.

julia

>
> > julia
> >
> >>
> >> >
> >> > julia
> >> >
> >> > On Sun, 5 Mar 2017, simran singhal wrote:
> >> >
> >> >> Doubly linked lists which are  iterated  using list_empty
> >> >> and list_entry macros have been replaced with list_for_each_entry_safe
> >> >> macro.
> >> >> This makes the iteration simpler and more readable.
> >> >>
> >> >> This patch replaces the while loop containing list_empty and list_entry
> >> >> with list_for_each_entry_safe.
> >> >>
> >> >> This was done with Coccinelle.
> >> >>
> >> >> @@
> >> >> expression E1;
> >> >> identifier I1, I2;
> >> >> type T;
> >> >> iterator name list_for_each_entry_safe;
> >> >> @@
> >> >>
> >> >> T *I1;
> >> >> + T *tmp;
> >> >> ...
> >> >> - while (list_empty() == 0)
> >> >> + list_for_each_entry_safe (I1, tmp, , I2)
> >> >> {
> >> >> ...when != T *I1;
> >> >> - I1 = list_entry(E1.next, T, I2);
> >> >> ...
> >> >> }
> >> >>
> >> >> Signed-off-by: simran singhal 
> >> >> ---
> >> >>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
> >> >>  1 file changed, 4 insertions(+), 7 deletions(-)
> >> >>
> >> >> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
> >> >> b/drivers/staging/lustre/lustre/osc/osc_page.c
> >> >> index ed8a0dc..e8b974f 100644
> >> >> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> >> >> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> >> >> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, 
> >> >> struct client_obd *cli,
> >> >>   struct cl_object *clobj = NULL;
> >> >>   struct cl_page **pvec;
> >> >>   struct osc_page *opg;
> >> >> + struct osc_page *tmp;
> >> >>   int maxscan = 0;
> >> >>   long count = 0;
> >> >>   int index = 0;
> >> >> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, 
> >> >> struct client_obd *cli,
> >> >>   if (force)
> >> >>   cli->cl_lru_reclaim++;
> >> >>   maxscan = min(target << 1, 
> >> >> atomic_long_read(>cl_lru_in_list));
> >> >> - while (!list_empty(>cl_lru_list)) {
> >> >> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
> >> >>   struct cl_page *page;
> >> >>   bool will_free = false;
> >> >>
> >> >> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, 
> >> >> struct client_obd *cli,
> >> >>   if (--maxscan < 0)
> >> >>   break;
> >> >>
> >> >> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
> >> >> -  ops_lru);
> >> >>   page = opg->ops_cl.cpl_page;
> >> >>   if (lru_page_busy(cli, page)) {
> >> >>   list_move_tail(>ops_lru, >cl_lru_list);
> >> >> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct 
> >> >> shrinker *sk,
> >> >>  {
> >> >>   struct client_obd *stop_anchor = NULL;
> >> >>   struct client_obd *cli;
> >> >> + struct client_obd *tmp;
> >> >>   struct lu_env *env;
> >> >>   long shrank = 0;
> >> >>   u16 refcheck;
> >> >> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct 
> >> >> shrinker *sk,
> >> >>   return SHRINK_STOP;
> >> >>
> >> >>   spin_lock(_shrink_lock);
> >> >> - while (!list_empty(_shrink_list)) {
> >> >> - cli = list_entry(osc_shrink_list.next, struct client_obd,
> >> >> -  cl_shrink_list);
> >> >> -
> >> >> + list_for_each_entry_safe(cli, tmp, _shrink_list, 
> >> >> cl_shrink_list) {
> >> >>   if (!stop_anchor)
> >> >>   stop_anchor = cli;
> >> >>   else if (cli == stop_anchor)
> >> >> --
> >> >> 2.7.4
> >> >>
> >> >> --
> >> >> You received this message because you are subscribed to the Google 
> >> >> Groups "outreachy-kernel" group.
> >> >> To unsubscribe from this group and stop receiving emails from it, send 
> >> >> an email to outreachy-kernel+unsubscr...@googlegroups.com.
> >> >> To post 

Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread SIMRAN SINGHAL
On Sun, Mar 5, 2017 at 11:18 PM, Julia Lawall  wrote:
>
>
> On Sun, 5 Mar 2017, SIMRAN SINGHAL wrote:
>
>> On Sun, Mar 5, 2017 at 10:47 PM, Julia Lawall  wrote:
>> > By the way, the above subject line is not correct.  Normally one does not
>> > put .c/.h in the subject line.  Indeed, there is not really any
>> > deterministic algorithm for choosing the subject line.  You need to run
>> > git log --oneline filename to see what others have done.
>>
>> So this would be fine Subject:-
>> staging: lustre: osc_page: Use list_for_each_entry_safe
>
> Looking at the result of git log --oneline, I would say:
>
> staging: lustre: osc:
>
> For example that it what is used by 86df598, which also only changes the
> file modified by this patch.
>
Actually, I can't use this as its already subject of one of a patch of
this patch
series.

> julia
>
>>
>> >
>> > julia
>> >
>> > On Sun, 5 Mar 2017, simran singhal wrote:
>> >
>> >> Doubly linked lists which are  iterated  using list_empty
>> >> and list_entry macros have been replaced with list_for_each_entry_safe
>> >> macro.
>> >> This makes the iteration simpler and more readable.
>> >>
>> >> This patch replaces the while loop containing list_empty and list_entry
>> >> with list_for_each_entry_safe.
>> >>
>> >> This was done with Coccinelle.
>> >>
>> >> @@
>> >> expression E1;
>> >> identifier I1, I2;
>> >> type T;
>> >> iterator name list_for_each_entry_safe;
>> >> @@
>> >>
>> >> T *I1;
>> >> + T *tmp;
>> >> ...
>> >> - while (list_empty() == 0)
>> >> + list_for_each_entry_safe (I1, tmp, , I2)
>> >> {
>> >> ...when != T *I1;
>> >> - I1 = list_entry(E1.next, T, I2);
>> >> ...
>> >> }
>> >>
>> >> Signed-off-by: simran singhal 
>> >> ---
>> >>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
>> >>  1 file changed, 4 insertions(+), 7 deletions(-)
>> >>
>> >> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
>> >> b/drivers/staging/lustre/lustre/osc/osc_page.c
>> >> index ed8a0dc..e8b974f 100644
>> >> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
>> >> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
>> >> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> >> client_obd *cli,
>> >>   struct cl_object *clobj = NULL;
>> >>   struct cl_page **pvec;
>> >>   struct osc_page *opg;
>> >> + struct osc_page *tmp;
>> >>   int maxscan = 0;
>> >>   long count = 0;
>> >>   int index = 0;
>> >> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> >> client_obd *cli,
>> >>   if (force)
>> >>   cli->cl_lru_reclaim++;
>> >>   maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
>> >> - while (!list_empty(>cl_lru_list)) {
>> >> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
>> >>   struct cl_page *page;
>> >>   bool will_free = false;
>> >>
>> >> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> >> client_obd *cli,
>> >>   if (--maxscan < 0)
>> >>   break;
>> >>
>> >> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
>> >> -  ops_lru);
>> >>   page = opg->ops_cl.cpl_page;
>> >>   if (lru_page_busy(cli, page)) {
>> >>   list_move_tail(>ops_lru, >cl_lru_list);
>> >> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
>> >> *sk,
>> >>  {
>> >>   struct client_obd *stop_anchor = NULL;
>> >>   struct client_obd *cli;
>> >> + struct client_obd *tmp;
>> >>   struct lu_env *env;
>> >>   long shrank = 0;
>> >>   u16 refcheck;
>> >> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct 
>> >> shrinker *sk,
>> >>   return SHRINK_STOP;
>> >>
>> >>   spin_lock(_shrink_lock);
>> >> - while (!list_empty(_shrink_list)) {
>> >> - cli = list_entry(osc_shrink_list.next, struct client_obd,
>> >> -  cl_shrink_list);
>> >> -
>> >> + list_for_each_entry_safe(cli, tmp, _shrink_list, 
>> >> cl_shrink_list) {
>> >>   if (!stop_anchor)
>> >>   stop_anchor = cli;
>> >>   else if (cli == stop_anchor)
>> >> --
>> >> 2.7.4
>> >>
>> >> --
>> >> You received this message because you are subscribed to the Google Groups 
>> >> "outreachy-kernel" group.
>> >> To unsubscribe from this group and stop receiving emails from it, send an 
>> >> email to outreachy-kernel+unsubscr...@googlegroups.com.
>> >> To post to this group, send email to outreachy-ker...@googlegroups.com.
>> >> To view this discussion on the web visit 
>> >> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
>> >> For more options, visit https://groups.google.com/d/optout.
>> >>
>>
___
devel 

Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, SIMRAN SINGHAL wrote:

> On Sun, Mar 5, 2017 at 10:47 PM, Julia Lawall  wrote:
> > By the way, the above subject line is not correct.  Normally one does not
> > put .c/.h in the subject line.  Indeed, there is not really any
> > deterministic algorithm for choosing the subject line.  You need to run
> > git log --oneline filename to see what others have done.
>
> So this would be fine Subject:-
> staging: lustre: osc_page: Use list_for_each_entry_safe

Looking at the result of git log --oneline, I would say:

staging: lustre: osc:

For example that it what is used by 86df598, which also only changes the
file modified by this patch.

julia

>
> >
> > julia
> >
> > On Sun, 5 Mar 2017, simran singhal wrote:
> >
> >> Doubly linked lists which are  iterated  using list_empty
> >> and list_entry macros have been replaced with list_for_each_entry_safe
> >> macro.
> >> This makes the iteration simpler and more readable.
> >>
> >> This patch replaces the while loop containing list_empty and list_entry
> >> with list_for_each_entry_safe.
> >>
> >> This was done with Coccinelle.
> >>
> >> @@
> >> expression E1;
> >> identifier I1, I2;
> >> type T;
> >> iterator name list_for_each_entry_safe;
> >> @@
> >>
> >> T *I1;
> >> + T *tmp;
> >> ...
> >> - while (list_empty() == 0)
> >> + list_for_each_entry_safe (I1, tmp, , I2)
> >> {
> >> ...when != T *I1;
> >> - I1 = list_entry(E1.next, T, I2);
> >> ...
> >> }
> >>
> >> Signed-off-by: simran singhal 
> >> ---
> >>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
> >>  1 file changed, 4 insertions(+), 7 deletions(-)
> >>
> >> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
> >> b/drivers/staging/lustre/lustre/osc/osc_page.c
> >> index ed8a0dc..e8b974f 100644
> >> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> >> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> >> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> >> client_obd *cli,
> >>   struct cl_object *clobj = NULL;
> >>   struct cl_page **pvec;
> >>   struct osc_page *opg;
> >> + struct osc_page *tmp;
> >>   int maxscan = 0;
> >>   long count = 0;
> >>   int index = 0;
> >> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> >> client_obd *cli,
> >>   if (force)
> >>   cli->cl_lru_reclaim++;
> >>   maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
> >> - while (!list_empty(>cl_lru_list)) {
> >> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
> >>   struct cl_page *page;
> >>   bool will_free = false;
> >>
> >> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> >> client_obd *cli,
> >>   if (--maxscan < 0)
> >>   break;
> >>
> >> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
> >> -  ops_lru);
> >>   page = opg->ops_cl.cpl_page;
> >>   if (lru_page_busy(cli, page)) {
> >>   list_move_tail(>ops_lru, >cl_lru_list);
> >> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> >> *sk,
> >>  {
> >>   struct client_obd *stop_anchor = NULL;
> >>   struct client_obd *cli;
> >> + struct client_obd *tmp;
> >>   struct lu_env *env;
> >>   long shrank = 0;
> >>   u16 refcheck;
> >> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> >> *sk,
> >>   return SHRINK_STOP;
> >>
> >>   spin_lock(_shrink_lock);
> >> - while (!list_empty(_shrink_list)) {
> >> - cli = list_entry(osc_shrink_list.next, struct client_obd,
> >> -  cl_shrink_list);
> >> -
> >> + list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) 
> >> {
> >>   if (!stop_anchor)
> >>   stop_anchor = cli;
> >>   else if (cli == stop_anchor)
> >> --
> >> 2.7.4
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to outreachy-kernel+unsubscr...@googlegroups.com.
> >> To post to this group, send email to outreachy-ker...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread SIMRAN SINGHAL
On Sun, Mar 5, 2017 at 10:47 PM, Julia Lawall  wrote:
> By the way, the above subject line is not correct.  Normally one does not
> put .c/.h in the subject line.  Indeed, there is not really any
> deterministic algorithm for choosing the subject line.  You need to run
> git log --oneline filename to see what others have done.

So this would be fine Subject:-
staging: lustre: osc_page: Use list_for_each_entry_safe

>
> julia
>
> On Sun, 5 Mar 2017, simran singhal wrote:
>
>> Doubly linked lists which are  iterated  using list_empty
>> and list_entry macros have been replaced with list_for_each_entry_safe
>> macro.
>> This makes the iteration simpler and more readable.
>>
>> This patch replaces the while loop containing list_empty and list_entry
>> with list_for_each_entry_safe.
>>
>> This was done with Coccinelle.
>>
>> @@
>> expression E1;
>> identifier I1, I2;
>> type T;
>> iterator name list_for_each_entry_safe;
>> @@
>>
>> T *I1;
>> + T *tmp;
>> ...
>> - while (list_empty() == 0)
>> + list_for_each_entry_safe (I1, tmp, , I2)
>> {
>> ...when != T *I1;
>> - I1 = list_entry(E1.next, T, I2);
>> ...
>> }
>>
>> Signed-off-by: simran singhal 
>> ---
>>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
>>  1 file changed, 4 insertions(+), 7 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
>> b/drivers/staging/lustre/lustre/osc/osc_page.c
>> index ed8a0dc..e8b974f 100644
>> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
>> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
>> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> client_obd *cli,
>>   struct cl_object *clobj = NULL;
>>   struct cl_page **pvec;
>>   struct osc_page *opg;
>> + struct osc_page *tmp;
>>   int maxscan = 0;
>>   long count = 0;
>>   int index = 0;
>> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> client_obd *cli,
>>   if (force)
>>   cli->cl_lru_reclaim++;
>>   maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
>> - while (!list_empty(>cl_lru_list)) {
>> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
>>   struct cl_page *page;
>>   bool will_free = false;
>>
>> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
>> client_obd *cli,
>>   if (--maxscan < 0)
>>   break;
>>
>> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
>> -  ops_lru);
>>   page = opg->ops_cl.cpl_page;
>>   if (lru_page_busy(cli, page)) {
>>   list_move_tail(>ops_lru, >cl_lru_list);
>> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
>> *sk,
>>  {
>>   struct client_obd *stop_anchor = NULL;
>>   struct client_obd *cli;
>> + struct client_obd *tmp;
>>   struct lu_env *env;
>>   long shrank = 0;
>>   u16 refcheck;
>> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
>> *sk,
>>   return SHRINK_STOP;
>>
>>   spin_lock(_shrink_lock);
>> - while (!list_empty(_shrink_list)) {
>> - cli = list_entry(osc_shrink_list.next, struct client_obd,
>> -  cl_shrink_list);
>> -
>> + list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) {
>>   if (!stop_anchor)
>>   stop_anchor = cli;
>>   else if (cli == stop_anchor)
>> --
>> 2.7.4
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to outreachy-kernel+unsubscr...@googlegroups.com.
>> To post to this group, send email to outreachy-ker...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 2/5] staging: lustre: ptlrpc: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, SIMRAN SINGHAL wrote:

> On Sun, Mar 5, 2017 at 11:09 PM, Julia Lawall  wrote:
> >
> >
> > On Sun, 5 Mar 2017, simran singhal wrote:
> >
> >> Doubly linked lists which are  iterated  using list_empty
> >> and list_entry macros have been replaced with list_for_each_entry_safe
> >> macro.
> >> This makes the iteration simpler and more readable.
> >>
> >> This patch replaces the while loop containing list_empty and list_entry
> >> with list_for_each_entry_safe.
> >>
> >> This was done with Coccinelle.
> >>
> >> @@
> >> expression E1;
> >> identifier I1, I2;
> >> type T;
> >> iterator name list_for_each_entry_safe;
> >> @@
> >>
> >> T *I1;
> >> + T *tmp;
> >> ...
> >> - while (list_empty() == 0)
> >> + list_for_each_entry_safe (I1, tmp, , I2)
> >> {
> >> ...when != T *I1;
> >> - I1 = list_entry(E1.next, T, I2);
> >> ...
> >> }
> >>
> >> Signed-off-by: simran singhal 
> >> ---
> >>  drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 5 ++---
> >>  1 file changed, 2 insertions(+), 3 deletions(-)
> >>
> >> diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c 
> >> b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> >> index 8ffd000..fe1c0af 100644
> >> --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> >> +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> >> @@ -98,12 +98,11 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
> >>  static void sec_process_ctx_list(void)
> >>  {
> >>   struct ptlrpc_cli_ctx *ctx;
> >> + struct ptlrpc_cli_ctx *tmp;
> >
> > Another improvement would be to define both variables at once:
> >
> > T *I1
> > + , *tmp
> >   ;
> >
> This is particulary for this patch or for all the patches of this 
> patch-series.

All, I would guess.  Unless the line gets too long.

julia

>
> > julia
> >
> >>
> >>   spin_lock(_gc_ctx_list_lock);
> >>
> >> - while (!list_empty(_gc_ctx_list)) {
> >> - ctx = list_entry(sec_gc_ctx_list.next,
> >> -  struct ptlrpc_cli_ctx, cc_gc_chain);
> >> + list_for_each_entry_safe(ctx, tmp, _gc_ctx_list, cc_gc_chain) {
> >>   list_del_init(>cc_gc_chain);
> >>   spin_unlock(_gc_ctx_list_lock);
> >>
> >> --
> >> 2.7.4
> >>
> >> --
> >> You received this message because you are subscribed to the Google Groups 
> >> "outreachy-kernel" group.
> >> To unsubscribe from this group and stop receiving emails from it, send an 
> >> email to outreachy-kernel+unsubscr...@googlegroups.com.
> >> To post to this group, send email to outreachy-ker...@googlegroups.com.
> >> To view this discussion on the web visit 
> >> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-3-git-send-email-singhalsimran0%40gmail.com.
> >> For more options, visit https://groups.google.com/d/optout.
> >>
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 2/5] staging: lustre: ptlrpc: Use list_for_each_entry_safe

2017-03-05 Thread SIMRAN SINGHAL
On Sun, Mar 5, 2017 at 11:09 PM, Julia Lawall  wrote:
>
>
> On Sun, 5 Mar 2017, simran singhal wrote:
>
>> Doubly linked lists which are  iterated  using list_empty
>> and list_entry macros have been replaced with list_for_each_entry_safe
>> macro.
>> This makes the iteration simpler and more readable.
>>
>> This patch replaces the while loop containing list_empty and list_entry
>> with list_for_each_entry_safe.
>>
>> This was done with Coccinelle.
>>
>> @@
>> expression E1;
>> identifier I1, I2;
>> type T;
>> iterator name list_for_each_entry_safe;
>> @@
>>
>> T *I1;
>> + T *tmp;
>> ...
>> - while (list_empty() == 0)
>> + list_for_each_entry_safe (I1, tmp, , I2)
>> {
>> ...when != T *I1;
>> - I1 = list_entry(E1.next, T, I2);
>> ...
>> }
>>
>> Signed-off-by: simran singhal 
>> ---
>>  drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 5 ++---
>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>
>> diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c 
>> b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
>> index 8ffd000..fe1c0af 100644
>> --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
>> +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
>> @@ -98,12 +98,11 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
>>  static void sec_process_ctx_list(void)
>>  {
>>   struct ptlrpc_cli_ctx *ctx;
>> + struct ptlrpc_cli_ctx *tmp;
>
> Another improvement would be to define both variables at once:
>
> T *I1
> + , *tmp
>   ;
>
This is particulary for this patch or for all the patches of this patch-series.

> julia
>
>>
>>   spin_lock(_gc_ctx_list_lock);
>>
>> - while (!list_empty(_gc_ctx_list)) {
>> - ctx = list_entry(sec_gc_ctx_list.next,
>> -  struct ptlrpc_cli_ctx, cc_gc_chain);
>> + list_for_each_entry_safe(ctx, tmp, _gc_ctx_list, cc_gc_chain) {
>>   list_del_init(>cc_gc_chain);
>>   spin_unlock(_gc_ctx_list_lock);
>>
>> --
>> 2.7.4
>>
>> --
>> You received this message because you are subscribed to the Google Groups 
>> "outreachy-kernel" group.
>> To unsubscribe from this group and stop receiving emails from it, send an 
>> email to outreachy-kernel+unsubscr...@googlegroups.com.
>> To post to this group, send email to outreachy-ker...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-3-git-send-email-singhalsimran0%40gmail.com.
>> For more options, visit https://groups.google.com/d/optout.
>>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 2/5] staging: lustre: ptlrpc: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, simran singhal wrote:

> Doubly linked lists which are  iterated  using list_empty
> and list_entry macros have been replaced with list_for_each_entry_safe
> macro.
> This makes the iteration simpler and more readable.
>
> This patch replaces the while loop containing list_empty and list_entry
> with list_for_each_entry_safe.
>
> This was done with Coccinelle.
>
> @@
> expression E1;
> identifier I1, I2;
> type T;
> iterator name list_for_each_entry_safe;
> @@
>
> T *I1;
> + T *tmp;
> ...
> - while (list_empty() == 0)
> + list_for_each_entry_safe (I1, tmp, , I2)
> {
> ...when != T *I1;
> - I1 = list_entry(E1.next, T, I2);
> ...
> }
>
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c 
> b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> index 8ffd000..fe1c0af 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
> @@ -98,12 +98,11 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
>  static void sec_process_ctx_list(void)
>  {
>   struct ptlrpc_cli_ctx *ctx;
> + struct ptlrpc_cli_ctx *tmp;

Another improvement would be to define both variables at once:

T *I1
+ , *tmp
  ;

julia

>
>   spin_lock(_gc_ctx_list_lock);
>
> - while (!list_empty(_gc_ctx_list)) {
> - ctx = list_entry(sec_gc_ctx_list.next,
> -  struct ptlrpc_cli_ctx, cc_gc_chain);
> + list_for_each_entry_safe(ctx, tmp, _gc_ctx_list, cc_gc_chain) {
>   list_del_init(>cc_gc_chain);
>   spin_unlock(_gc_ctx_list_lock);
>
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-3-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 1/5] staging: lustre: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, simran singhal wrote:

> Doubly linked lists which are  iterated  using list_empty
> and list_entry macros have been replaced with list_for_each_entry_safe
> macro.
> This makes the iteration simpler and more readable.
>
> This patch replaces the while loop containing list_empty and list_entry
> with list_for_each_entry_safe.
>
> This was done with Coccinelle.
>
> @@
> expression E1;
> identifier I1, I2;
> type T;
> iterator name list_for_each_entry_safe;
> @@
>
> T *I1;
> + T *tmp;
> ...

The function that is modified in this patch actually has another
opportunity.  That doesn't get transformed because with ... Coccinelle
matches the shortest path between what comes before and what comes after,
and so it only matches the first while loop.

You could sort of fix the problem by putting when any on the ...  That
allows anything in the path, including other while loops.

That though will mean that you will try to add two instances of the tmp
declaration after the declaration of I1.  Coccinelle allows adding only
one thing, unless the + is replaced by ++.  But if you do that, you will
get two decarations of tmp.

So either make the second change by hand, or let Coccinelle do it an
remove the second declaration of tmp by hand.

julia

> - while (list_empty() == 0)
> + list_for_each_entry_safe (I1, tmp, , I2)
> {
> ...when != T *I1;
> - I1 = list_entry(E1.next, T, I2);
> ...
> }
>
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/lustre/lustre/ptlrpc/service.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
> b/drivers/staging/lustre/lustre/ptlrpc/service.c
> index b8091c1..4e7dc1d 100644
> --- a/drivers/staging/lustre/lustre/ptlrpc/service.c
> +++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
> @@ -2314,6 +2314,7 @@ static void ptlrpc_svcpt_stop_threads(struct 
> ptlrpc_service_part *svcpt)
>  {
>   struct l_wait_info lwi = { 0 };
>   struct ptlrpc_thread *thread;
> + struct ptlrpc_thread *tmp;
>   LIST_HEAD(zombie);
>
>   CDEBUG(D_INFO, "Stopping threads for service %s\n",
> @@ -2329,9 +2330,7 @@ static void ptlrpc_svcpt_stop_threads(struct 
> ptlrpc_service_part *svcpt)
>
>   wake_up_all(>scp_waitq);
>
> - while (!list_empty(>scp_threads)) {
> - thread = list_entry(svcpt->scp_threads.next,
> - struct ptlrpc_thread, t_link);
> + list_for_each_entry_safe(thread, tmp, >scp_threads, t_link) {
>   if (thread_is_stopped(thread)) {
>   list_del(>t_link);
>   list_add(>t_link, );
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-2-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, Julia Lawall wrote:

>
>
> On Sun, 5 Mar 2017, simran singhal wrote:
>
> > Doubly linked lists which are  iterated  using list_empty
> > and list_entry macros have been replaced with list_for_each_entry_safe
> > macro.
> > This makes the iteration simpler and more readable.
> >
> > This patch replaces the while loop containing list_empty and list_entry
> > with list_for_each_entry_safe.
>
> list_for_each_entry_safe is only needed when the current element is
> removed from the list within the loop body.  If that is not the case, you
> can just use list_for_each_entry.

Sorry, my comment was likely completely off the mark here.  I was thinking
that the original code was using list_for_each.  With the while
(!list_empty pattern, the safe version is definitely needed.

julia

>
> julia
>
>
> >
> > This was done with Coccinelle.
> >
> > @@
> > expression E1;
> > identifier I1, I2;
> > type T;
> > iterator name list_for_each_entry_safe;
> > @@
> >
> > T *I1;
> > + T *tmp;
> > ...
> > - while (list_empty() == 0)
> > + list_for_each_entry_safe (I1, tmp, , I2)
> > {
> > ...when != T *I1;
> > - I1 = list_entry(E1.next, T, I2);
> > ...
> > }
> >
> > Signed-off-by: simran singhal 
> > ---
> >  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
> >  1 file changed, 4 insertions(+), 7 deletions(-)
> >
> > diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
> > b/drivers/staging/lustre/lustre/osc/osc_page.c
> > index ed8a0dc..e8b974f 100644
> > --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> > +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> > @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> > client_obd *cli,
> > struct cl_object *clobj = NULL;
> > struct cl_page **pvec;
> > struct osc_page *opg;
> > +   struct osc_page *tmp;
> > int maxscan = 0;
> > long count = 0;
> > int index = 0;
> > @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> > client_obd *cli,
> > if (force)
> > cli->cl_lru_reclaim++;
> > maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
> > -   while (!list_empty(>cl_lru_list)) {
> > +   list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
> > struct cl_page *page;
> > bool will_free = false;
> >
> > @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> > client_obd *cli,
> > if (--maxscan < 0)
> > break;
> >
> > -   opg = list_entry(cli->cl_lru_list.next, struct osc_page,
> > -ops_lru);
> > page = opg->ops_cl.cpl_page;
> > if (lru_page_busy(cli, page)) {
> > list_move_tail(>ops_lru, >cl_lru_list);
> > @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> > *sk,
> >  {
> > struct client_obd *stop_anchor = NULL;
> > struct client_obd *cli;
> > +   struct client_obd *tmp;
> > struct lu_env *env;
> > long shrank = 0;
> > u16 refcheck;
> > @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> > *sk,
> > return SHRINK_STOP;
> >
> > spin_lock(_shrink_lock);
> > -   while (!list_empty(_shrink_list)) {
> > -   cli = list_entry(osc_shrink_list.next, struct client_obd,
> > -cl_shrink_list);
> > -
> > +   list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) {
> > if (!stop_anchor)
> > stop_anchor = cli;
> > else if (cli == stop_anchor)
> > --
> > 2.7.4
> >
> > --
> > You received this message because you are subscribed to the Google Groups 
> > "outreachy-kernel" group.
> > To unsubscribe from this group and stop receiving emails from it, send an 
> > email to outreachy-kernel+unsubscr...@googlegroups.com.
> > To post to this group, send email to outreachy-ker...@googlegroups.com.
> > To view this discussion on the web visit 
> > https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
> > For more options, visit https://groups.google.com/d/optout.
> >
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall
By the way, the above subject line is not correct.  Normally one does not
put .c/.h in the subject line.  Indeed, there is not really any
deterministic algorithm for choosing the subject line.  You need to run
git log --oneline filename to see what others have done.

julia

On Sun, 5 Mar 2017, simran singhal wrote:

> Doubly linked lists which are  iterated  using list_empty
> and list_entry macros have been replaced with list_for_each_entry_safe
> macro.
> This makes the iteration simpler and more readable.
>
> This patch replaces the while loop containing list_empty and list_entry
> with list_for_each_entry_safe.
>
> This was done with Coccinelle.
>
> @@
> expression E1;
> identifier I1, I2;
> type T;
> iterator name list_for_each_entry_safe;
> @@
>
> T *I1;
> + T *tmp;
> ...
> - while (list_empty() == 0)
> + list_for_each_entry_safe (I1, tmp, , I2)
> {
> ...when != T *I1;
> - I1 = list_entry(E1.next, T, I2);
> ...
> }
>
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
> b/drivers/staging/lustre/lustre/osc/osc_page.c
> index ed8a0dc..e8b974f 100644
> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   struct cl_object *clobj = NULL;
>   struct cl_page **pvec;
>   struct osc_page *opg;
> + struct osc_page *tmp;
>   int maxscan = 0;
>   long count = 0;
>   int index = 0;
> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   if (force)
>   cli->cl_lru_reclaim++;
>   maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
> - while (!list_empty(>cl_lru_list)) {
> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
>   struct cl_page *page;
>   bool will_free = false;
>
> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   if (--maxscan < 0)
>   break;
>
> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
> -  ops_lru);
>   page = opg->ops_cl.cpl_page;
>   if (lru_page_busy(cli, page)) {
>   list_move_tail(>ops_lru, >cl_lru_list);
> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker *sk,
>  {
>   struct client_obd *stop_anchor = NULL;
>   struct client_obd *cli;
> + struct client_obd *tmp;
>   struct lu_env *env;
>   long shrank = 0;
>   u16 refcheck;
> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> *sk,
>   return SHRINK_STOP;
>
>   spin_lock(_shrink_lock);
> - while (!list_empty(_shrink_list)) {
> - cli = list_entry(osc_shrink_list.next, struct client_obd,
> -  cl_shrink_list);
> -
> + list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) {
>   if (!stop_anchor)
>   stop_anchor = cli;
>   else if (cli == stop_anchor)
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


Re: [Outreachy kernel] [PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread Julia Lawall


On Sun, 5 Mar 2017, simran singhal wrote:

> Doubly linked lists which are  iterated  using list_empty
> and list_entry macros have been replaced with list_for_each_entry_safe
> macro.
> This makes the iteration simpler and more readable.
>
> This patch replaces the while loop containing list_empty and list_entry
> with list_for_each_entry_safe.

list_for_each_entry_safe is only needed when the current element is
removed from the list within the loop body.  If that is not the case, you
can just use list_for_each_entry.

julia


>
> This was done with Coccinelle.
>
> @@
> expression E1;
> identifier I1, I2;
> type T;
> iterator name list_for_each_entry_safe;
> @@
>
> T *I1;
> + T *tmp;
> ...
> - while (list_empty() == 0)
> + list_for_each_entry_safe (I1, tmp, , I2)
> {
> ...when != T *I1;
> - I1 = list_entry(E1.next, T, I2);
> ...
> }
>
> Signed-off-by: simran singhal 
> ---
>  drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
>  1 file changed, 4 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
> b/drivers/staging/lustre/lustre/osc/osc_page.c
> index ed8a0dc..e8b974f 100644
> --- a/drivers/staging/lustre/lustre/osc/osc_page.c
> +++ b/drivers/staging/lustre/lustre/osc/osc_page.c
> @@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   struct cl_object *clobj = NULL;
>   struct cl_page **pvec;
>   struct osc_page *opg;
> + struct osc_page *tmp;
>   int maxscan = 0;
>   long count = 0;
>   int index = 0;
> @@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   if (force)
>   cli->cl_lru_reclaim++;
>   maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
> - while (!list_empty(>cl_lru_list)) {
> + list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
>   struct cl_page *page;
>   bool will_free = false;
>
> @@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
> client_obd *cli,
>   if (--maxscan < 0)
>   break;
>
> - opg = list_entry(cli->cl_lru_list.next, struct osc_page,
> -  ops_lru);
>   page = opg->ops_cl.cpl_page;
>   if (lru_page_busy(cli, page)) {
>   list_move_tail(>ops_lru, >cl_lru_list);
> @@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker *sk,
>  {
>   struct client_obd *stop_anchor = NULL;
>   struct client_obd *cli;
> + struct client_obd *tmp;
>   struct lu_env *env;
>   long shrank = 0;
>   u16 refcheck;
> @@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker 
> *sk,
>   return SHRINK_STOP;
>
>   spin_lock(_shrink_lock);
> - while (!list_empty(_shrink_list)) {
> - cli = list_entry(osc_shrink_list.next, struct client_obd,
> -  cl_shrink_list);
> -
> + list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) {
>   if (!stop_anchor)
>   stop_anchor = cli;
>   else if (cli == stop_anchor)
> --
> 2.7.4
>
> --
> You received this message because you are subscribed to the Google Groups 
> "outreachy-kernel" group.
> To unsubscribe from this group and stop receiving emails from it, send an 
> email to outreachy-kernel+unsubscr...@googlegroups.com.
> To post to this group, send email to outreachy-ker...@googlegroups.com.
> To view this discussion on the web visit 
> https://groups.google.com/d/msgid/outreachy-kernel/1488733610-22289-6-git-send-email-singhalsimran0%40gmail.com.
> For more options, visit https://groups.google.com/d/optout.
>
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 4/5] staging: lustre: llite: Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty() == 0)
+ list_for_each_entry_safe (I1, tmp, , I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/llite/statahead.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/llite/statahead.c 
b/drivers/staging/lustre/lustre/llite/statahead.c
index fb7c315..d1287b2 100644
--- a/drivers/staging/lustre/lustre/llite/statahead.c
+++ b/drivers/staging/lustre/lustre/llite/statahead.c
@@ -860,6 +860,7 @@ static int ll_agl_thread(void *arg)
struct inode *dir= d_inode(parent);
struct ll_inode_info *plli   = ll_i2info(dir);
struct ll_inode_info *clli;
+   struct ll_inode_info *tmp;
struct ll_sb_info   *sbi= ll_i2sbi(dir);
struct ll_statahead_info *sai;
struct ptlrpc_thread *thread;
@@ -909,9 +910,7 @@ static int ll_agl_thread(void *arg)
 
spin_lock(>lli_agl_lock);
sai->sai_agl_valid = 0;
-   while (!list_empty(>sai_agls)) {
-   clli = list_entry(sai->sai_agls.next,
- struct ll_inode_info, lli_agl_list);
+   list_for_each_entry_safe(clli, tmp, >sai_agls, lli_agl_list) {
list_del_init(>lli_agl_list);
spin_unlock(>lli_agl_lock);
clli->lli_agl_index = 0;
-- 
2.7.4

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


[PATCH 0/5] Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
This patch-series replaces the while loop containing list_empty and 
list_entry with list_for_each_entry_safe.

simran singhal (5):
  staging: lustre: Use list_for_each_entry_safe
  staging: lustre: ptlrpc: Use list_for_each_entry_safe
  staging: lustre: osc: Use list_for_each_entry_safe
  staging: lustre: llite: Use list_for_each_entry_safe
  staging: lustre: osc_page.c:  Use list_for_each_entry_safe

 drivers/staging/lustre/lustre/llite/statahead.c |  5 ++---
 drivers/staging/lustre/lustre/osc/osc_cache.c   |  5 ++---
 drivers/staging/lustre/lustre/osc/osc_page.c| 11 ---
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c   |  5 ++---
 drivers/staging/lustre/lustre/ptlrpc/service.c  |  5 ++---
 5 files changed, 12 insertions(+), 19 deletions(-)

-- 
2.7.4

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


[PATCH 2/5] staging: lustre: ptlrpc: Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty() == 0)
+ list_for_each_entry_safe (I1, tmp, , I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/ptlrpc/sec_gc.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c 
b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
index 8ffd000..fe1c0af 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/sec_gc.c
@@ -98,12 +98,11 @@ void sptlrpc_gc_del_sec(struct ptlrpc_sec *sec)
 static void sec_process_ctx_list(void)
 {
struct ptlrpc_cli_ctx *ctx;
+   struct ptlrpc_cli_ctx *tmp;
 
spin_lock(_gc_ctx_list_lock);
 
-   while (!list_empty(_gc_ctx_list)) {
-   ctx = list_entry(sec_gc_ctx_list.next,
-struct ptlrpc_cli_ctx, cc_gc_chain);
+   list_for_each_entry_safe(ctx, tmp, _gc_ctx_list, cc_gc_chain) {
list_del_init(>cc_gc_chain);
spin_unlock(_gc_ctx_list_lock);
 
-- 
2.7.4

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


[PATCH 5/5] staging: lustre: osc_page.c: Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty() == 0)
+ list_for_each_entry_safe (I1, tmp, , I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/osc/osc_page.c | 11 ---
 1 file changed, 4 insertions(+), 7 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_page.c 
b/drivers/staging/lustre/lustre/osc/osc_page.c
index ed8a0dc..e8b974f 100644
--- a/drivers/staging/lustre/lustre/osc/osc_page.c
+++ b/drivers/staging/lustre/lustre/osc/osc_page.c
@@ -542,6 +542,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
client_obd *cli,
struct cl_object *clobj = NULL;
struct cl_page **pvec;
struct osc_page *opg;
+   struct osc_page *tmp;
int maxscan = 0;
long count = 0;
int index = 0;
@@ -572,7 +573,7 @@ long osc_lru_shrink(const struct lu_env *env, struct 
client_obd *cli,
if (force)
cli->cl_lru_reclaim++;
maxscan = min(target << 1, atomic_long_read(>cl_lru_in_list));
-   while (!list_empty(>cl_lru_list)) {
+   list_for_each_entry_safe(opg, tmp, >cl_lru_list, ops_lru) {
struct cl_page *page;
bool will_free = false;
 
@@ -582,8 +583,6 @@ long osc_lru_shrink(const struct lu_env *env, struct 
client_obd *cli,
if (--maxscan < 0)
break;
 
-   opg = list_entry(cli->cl_lru_list.next, struct osc_page,
-ops_lru);
page = opg->ops_cl.cpl_page;
if (lru_page_busy(cli, page)) {
list_move_tail(>ops_lru, >cl_lru_list);
@@ -1043,6 +1042,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker *sk,
 {
struct client_obd *stop_anchor = NULL;
struct client_obd *cli;
+   struct client_obd *tmp;
struct lu_env *env;
long shrank = 0;
u16 refcheck;
@@ -1059,10 +1059,7 @@ unsigned long osc_cache_shrink_scan(struct shrinker *sk,
return SHRINK_STOP;
 
spin_lock(_shrink_lock);
-   while (!list_empty(_shrink_list)) {
-   cli = list_entry(osc_shrink_list.next, struct client_obd,
-cl_shrink_list);
-
+   list_for_each_entry_safe(cli, tmp, _shrink_list, cl_shrink_list) {
if (!stop_anchor)
stop_anchor = cli;
else if (cli == stop_anchor)
-- 
2.7.4

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


[PATCH 1/5] staging: lustre: Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty() == 0)
+ list_for_each_entry_safe (I1, tmp, , I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/ptlrpc/service.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/ptlrpc/service.c 
b/drivers/staging/lustre/lustre/ptlrpc/service.c
index b8091c1..4e7dc1d 100644
--- a/drivers/staging/lustre/lustre/ptlrpc/service.c
+++ b/drivers/staging/lustre/lustre/ptlrpc/service.c
@@ -2314,6 +2314,7 @@ static void ptlrpc_svcpt_stop_threads(struct 
ptlrpc_service_part *svcpt)
 {
struct l_wait_info lwi = { 0 };
struct ptlrpc_thread *thread;
+   struct ptlrpc_thread *tmp;
LIST_HEAD(zombie);
 
CDEBUG(D_INFO, "Stopping threads for service %s\n",
@@ -2329,9 +2330,7 @@ static void ptlrpc_svcpt_stop_threads(struct 
ptlrpc_service_part *svcpt)
 
wake_up_all(>scp_waitq);
 
-   while (!list_empty(>scp_threads)) {
-   thread = list_entry(svcpt->scp_threads.next,
-   struct ptlrpc_thread, t_link);
+   list_for_each_entry_safe(thread, tmp, >scp_threads, t_link) {
if (thread_is_stopped(thread)) {
list_del(>t_link);
list_add(>t_link, );
-- 
2.7.4

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


[PATCH 3/5] staging: lustre: osc: Use list_for_each_entry_safe

2017-03-05 Thread simran singhal
Doubly linked lists which are  iterated  using list_empty
and list_entry macros have been replaced with list_for_each_entry_safe
macro.
This makes the iteration simpler and more readable.

This patch replaces the while loop containing list_empty and list_entry
with list_for_each_entry_safe.

This was done with Coccinelle.

@@
expression E1;
identifier I1, I2;
type T;
iterator name list_for_each_entry_safe;
@@

T *I1;
+ T *tmp;
...
- while (list_empty() == 0)
+ list_for_each_entry_safe (I1, tmp, , I2)
{
...when != T *I1;
- I1 = list_entry(E1.next, T, I2);
...
}

Signed-off-by: simran singhal 
---
 drivers/staging/lustre/lustre/osc/osc_cache.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/lustre/lustre/osc/osc_cache.c 
b/drivers/staging/lustre/lustre/osc/osc_cache.c
index f8c5fc0..caa5fec 100644
--- a/drivers/staging/lustre/lustre/osc/osc_cache.c
+++ b/drivers/staging/lustre/lustre/osc/osc_cache.c
@@ -1996,6 +1996,7 @@ static unsigned int get_write_extents(struct osc_object 
*obj,
 {
struct client_obd *cli = osc_cli(obj);
struct osc_extent *ext;
+   struct osc_extent *tmp;
struct osc_extent *temp;
struct extent_rpc_data data = {
.erd_rpc_list = rpclist,
@@ -2014,9 +2015,7 @@ static unsigned int get_write_extents(struct osc_object 
*obj,
if (data.erd_page_count == data.erd_max_pages)
return data.erd_page_count;
 
-   while (!list_empty(>oo_urgent_exts)) {
-   ext = list_entry(obj->oo_urgent_exts.next,
-struct osc_extent, oe_link);
+   list_for_each_entry_safe(ext, tmp, >oo_urgent_exts, oe_link) {
if (!try_to_add_extent_for_io(cli, ext, ))
return data.erd_page_count;
 
-- 
2.7.4

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


Re: [PATCH 0/3] multiple checkpatch issues

2017-03-05 Thread Joe Perches
On Sun, 2017-03-05 at 16:54 +0530, Arushi Singhal wrote:
> Improve readability by fixing multiple checkpatch.pl
> issues in sm750fb driver. 

Remember to prefix the subject of the 0/n patch with the subsystem.

> Arushi Singhal (3):
>   staging: sm750fb: fixes add blank line after function/struct/union/enum 
> declarations
>   staging: sm750fb: function prototype argument should have an identifier name
>   staging: sm750fb: Alignment should match open parenthesis
> 
>  drivers/staging/sm750fb/ddk750_display.h |  3 +-
>  drivers/staging/sm750fb/ddk750_mode.c| 69 
> 
>  drivers/staging/sm750fb/ddk750_mode.h|  4 +-
>  drivers/staging/sm750fb/ddk750_power.h   |  3 +-
>  drivers/staging/sm750fb/sm750.h  |  2 +-
>  drivers/staging/sm750fb/sm750_cursor.c   |  3 ++
>  6 files changed, 45 insertions(+), 39 deletions(-)
> 
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH] staging: rtl8192u: Remove unnecessary function and its call

2017-03-05 Thread simran singhal
The function ieee80211_tkip_null on being called, simply returns
back. The function hasn't been mentioned in the TODO and doesn't have
FIXME code around. Hence, ieee80211_tkip_null and its calls have
been removed.

This was done using Coccinelle.

@@
identifier f;
@@

void f(...) {

-return;

}

Signed-off-by: simran singhal 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211.h| 3 ---
 drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c | 5 -
 drivers/staging/rtl8192u/ieee80211/ieee80211_module.c | 1 -
 3 files changed, 9 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211.h 
b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
index 176083e..1babc37 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211.h
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211.h
@@ -236,8 +236,6 @@ struct cb_desc {
 
 #define ieee80211_ccmp_nullieee80211_ccmp_null_rsl
 
-#define ieee80211_tkip_nullieee80211_tkip_null_rsl
-
 #define free_ieee80211 free_ieee80211_rsl
 #define alloc_ieee80211alloc_ieee80211_rsl
 
@@ -2266,7 +2264,6 @@ void ieee80211_ps_tx_ack(struct ieee80211_device *ieee, 
short success);
 void softmac_mgmt_xmit(struct sk_buff *skb, struct ieee80211_device *ieee);
 
 /* ieee80211_crypt_ccmp */
-void ieee80211_tkip_null(void);
 
 int ieee80211_crypto_init(void);
 void ieee80211_crypto_deinit(void);
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index df94021..54ca69e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -785,8 +785,3 @@ void __exit ieee80211_crypto_tkip_exit(void)
ieee80211_unregister_crypto_ops(_crypt_tkip);
 }
 
-void ieee80211_tkip_null(void)
-{
-//printk(">%s()\n", __func__);
-   return;
-}
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
index a791175..bb52eee 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_module.c
@@ -176,7 +176,6 @@ struct net_device *alloc_ieee80211(int sizeof_priv)
}
 
 /* These function were added to load crypte module autoly */
-   ieee80211_tkip_null();
 
return dev;
 
-- 
2.7.4

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


[PATCH 1/3] staging: sm750fb: fixes add blank line after function/struct/union/enum declarations

2017-03-05 Thread Arushi Singhal
This patch fixes the warnings reported by checkpatch.pl
for please use a blank line after function/struct/union/enum
declarations.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/sm750fb/ddk750_display.h | 1 +
 drivers/staging/sm750fb/ddk750_mode.h| 2 ++
 drivers/staging/sm750fb/ddk750_power.h   | 1 +
 drivers/staging/sm750fb/sm750_cursor.c   | 3 +++
 4 files changed, 7 insertions(+)

diff --git a/drivers/staging/sm750fb/ddk750_display.h 
b/drivers/staging/sm750fb/ddk750_display.h
index e2a3f84ca4c5..8bf22e4f0d8b 100644
--- a/drivers/staging/sm750fb/ddk750_display.h
+++ b/drivers/staging/sm750fb/ddk750_display.h
@@ -100,6 +100,7 @@ typedef enum _disp_output_t {
do_CRT_PRI = CRT_2_PRI | PRI_TP_ON | DPMS_ON | DAC_ON,
do_CRT_SEC = CRT_2_SEC | SEC_TP_ON | DPMS_ON | DAC_ON,
 }
+
 disp_output_t;
 
 void ddk750_setLogicalDispOut(disp_output_t);
diff --git a/drivers/staging/sm750fb/ddk750_mode.h 
b/drivers/staging/sm750fb/ddk750_mode.h
index 2183e664cf4b..b4cd90a5d2bc 100644
--- a/drivers/staging/sm750fb/ddk750_mode.h
+++ b/drivers/staging/sm750fb/ddk750_mode.h
@@ -7,6 +7,7 @@ typedef enum _spolarity_t {
POS = 0, /* positive */
NEG, /* negative */
 }
+
 spolarity_t;
 
 typedef struct _mode_parameter_t {
@@ -32,6 +33,7 @@ typedef struct _mode_parameter_t {
/* Clock Phase. This clock phase only applies to Panel. */
spolarity_t clock_phase_polarity;
 }
+
 mode_parameter_t;
 
 int ddk750_setModeTiming(mode_parameter_t *, clock_type_t);
diff --git a/drivers/staging/sm750fb/ddk750_power.h 
b/drivers/staging/sm750fb/ddk750_power.h
index ec0b99d6a7ad..1f22a67493af 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -7,6 +7,7 @@ typedef enum _DPMS_t {
crtDPMS_SUSPEND = 0x2,
crtDPMS_OFF = 0x3,
 }
+
 DPMS_t;
 
 #define setDAC(off) {  \
diff --git a/drivers/staging/sm750fb/sm750_cursor.c 
b/drivers/staging/sm750fb/sm750_cursor.c
index aa232c31b312..1e29a0f0a53d 100644
--- a/drivers/staging/sm750fb/sm750_cursor.c
+++ b/drivers/staging/sm750fb/sm750_cursor.c
@@ -54,6 +54,7 @@ void sm750_hw_cursor_enable(struct lynx_cursor *cursor)
reg = (cursor->offset & HWC_ADDRESS_ADDRESS_MASK) | HWC_ADDRESS_ENABLE;
poke32(HWC_ADDRESS, reg);
 }
+
 void sm750_hw_cursor_disable(struct lynx_cursor *cursor)
 {
poke32(HWC_ADDRESS, 0);
@@ -65,6 +66,7 @@ void sm750_hw_cursor_setSize(struct lynx_cursor *cursor,
cursor->w = w;
cursor->h = h;
 }
+
 void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
int x, int y)
 {
@@ -74,6 +76,7 @@ void sm750_hw_cursor_setPos(struct lynx_cursor *cursor,
(x & HWC_LOCATION_X_MASK));
poke32(HWC_LOCATION, reg);
 }
+
 void sm750_hw_cursor_setColor(struct lynx_cursor *cursor,
u32 fg, u32 bg)
 {
-- 
2.11.0

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


[PATCH 3/3] staging: sm750fb: Alignment should match open parenthesis

2017-03-05 Thread Arushi Singhal
Fix checkpatch issues: "CHECK: Alignment should match open parenthesis".

Signed-off-by: Arushi Singhal 
---
 drivers/staging/sm750fb/ddk750_mode.c | 69 +--
 1 file changed, 34 insertions(+), 35 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_mode.c 
b/drivers/staging/sm750fb/ddk750_mode.c
index 45af806c8d55..77dfac3ba041 100644
--- a/drivers/staging/sm750fb/ddk750_mode.c
+++ b/drivers/staging/sm750fb/ddk750_mode.c
@@ -28,9 +28,9 @@ static unsigned long 
displayControlAdjust_SM750LE(mode_parameter_t *pModeParam,
poke32(CRT_AUTO_CENTERING_TL, 0);
 
poke32(CRT_AUTO_CENTERING_BR,
-   (((y - 1) << CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT) &
-   CRT_AUTO_CENTERING_BR_BOTTOM_MASK) |
-   ((x - 1) & CRT_AUTO_CENTERING_BR_RIGHT_MASK));
+  (((y - 1) << CRT_AUTO_CENTERING_BR_BOTTOM_SHIFT) &
+   CRT_AUTO_CENTERING_BR_BOTTOM_MASK) |
+  ((x - 1) & CRT_AUTO_CENTERING_BR_RIGHT_MASK));
 
/*
 * Assume common fields in dispControl have been properly set before
@@ -72,8 +72,7 @@ static unsigned long 
displayControlAdjust_SM750LE(mode_parameter_t *pModeParam,
 }
 
 /* only timing related registers will be  programed */
-static int programModeRegisters(mode_parameter_t *pModeParam,
-   struct pll_value *pll)
+static int programModeRegisters(mode_parameter_t *pModeParam, struct pll_value 
*pll)
 {
int ret = 0;
int cnt = 0;
@@ -83,32 +82,32 @@ static int programModeRegisters(mode_parameter_t 
*pModeParam,
/* programe secondary pixel clock */
poke32(CRT_PLL_CTRL, sm750_format_pll_reg(pll));
poke32(CRT_HORIZONTAL_TOTAL,
-   (((pModeParam->horizontal_total - 1) <<
-   CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
-   CRT_HORIZONTAL_TOTAL_TOTAL_MASK) |
-   ((pModeParam->horizontal_display_end - 1) &
-   CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK));
+  (((pModeParam->horizontal_total - 1) <<
+CRT_HORIZONTAL_TOTAL_TOTAL_SHIFT) &
+   CRT_HORIZONTAL_TOTAL_TOTAL_MASK) |
+  ((pModeParam->horizontal_display_end - 1) &
+   CRT_HORIZONTAL_TOTAL_DISPLAY_END_MASK));
 
poke32(CRT_HORIZONTAL_SYNC,
-   ((pModeParam->horizontal_sync_width <<
-   CRT_HORIZONTAL_SYNC_WIDTH_SHIFT) &
-   CRT_HORIZONTAL_SYNC_WIDTH_MASK) |
-   ((pModeParam->horizontal_sync_start - 1) &
-   CRT_HORIZONTAL_SYNC_START_MASK));
+  ((pModeParam->horizontal_sync_width <<
+CRT_HORIZONTAL_SYNC_WIDTH_SHIFT) &
+   CRT_HORIZONTAL_SYNC_WIDTH_MASK) |
+  ((pModeParam->horizontal_sync_start - 1) &
+   CRT_HORIZONTAL_SYNC_START_MASK));
 
poke32(CRT_VERTICAL_TOTAL,
-   (((pModeParam->vertical_total - 1) <<
-   CRT_VERTICAL_TOTAL_TOTAL_SHIFT) &
-   CRT_VERTICAL_TOTAL_TOTAL_MASK) |
-   ((pModeParam->vertical_display_end - 1) &
-   CRT_VERTICAL_TOTAL_DISPLAY_END_MASK));
+  (((pModeParam->vertical_total - 1) <<
+CRT_VERTICAL_TOTAL_TOTAL_SHIFT) &
+   CRT_VERTICAL_TOTAL_TOTAL_MASK) |
+  ((pModeParam->vertical_display_end - 1) &
+   CRT_VERTICAL_TOTAL_DISPLAY_END_MASK));
 
poke32(CRT_VERTICAL_SYNC,
-   ((pModeParam->vertical_sync_height <<
-   CRT_VERTICAL_SYNC_HEIGHT_SHIFT) &
-   CRT_VERTICAL_SYNC_HEIGHT_MASK) |
-   ((pModeParam->vertical_sync_start - 1) &
-   CRT_VERTICAL_SYNC_START_MASK));
+  ((pModeParam->vertical_sync_height <<
+CRT_VERTICAL_SYNC_HEIGHT_SHIFT) &
+   CRT_VERTICAL_SYNC_HEIGHT_MASK) |
+  ((pModeParam->vertical_sync_start - 1) &
+   CRT_VERTICAL_SYNC_START_MASK));
 
tmp = DISPLAY_CTRL_TIMING | DISPLAY_CTRL_PLANE;
if (pModeParam->vertical_sync_polarity)
@@ -147,18 +146,18 @@ static int programModeRegisters(mode_parameter_t 
*pModeParam,
PANEL_HORIZONTAL_SYNC_START_MASK));
 
poke32(PANEL_VERTICAL_TOTAL,
-   (((pModeParam->vertical_total - 1) <<
-   PANEL_VERTICAL_TOTAL_TOTAL_SHIFT) &
-   

[PATCH 2/3] staging: sm750fb: function prototype argument should have an identifier name

2017-03-05 Thread Arushi Singhal
function prototype arguments like 'struct vb_device_info *','unsigned
long' etc. should have an identifier name.

Signed-off-by: Arushi Singhal 
---
 drivers/staging/sm750fb/ddk750_display.h | 2 +-
 drivers/staging/sm750fb/ddk750_mode.h| 2 +-
 drivers/staging/sm750fb/ddk750_power.h   | 2 +-
 drivers/staging/sm750fb/sm750.h  | 2 +-
 4 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/staging/sm750fb/ddk750_display.h 
b/drivers/staging/sm750fb/ddk750_display.h
index 8bf22e4f0d8b..369f1740a42b 100644
--- a/drivers/staging/sm750fb/ddk750_display.h
+++ b/drivers/staging/sm750fb/ddk750_display.h
@@ -103,6 +103,6 @@ typedef enum _disp_output_t {
 
 disp_output_t;
 
-void ddk750_setLogicalDispOut(disp_output_t);
+void ddk750_setLogicalDispOut(disp_output_t output);
 
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_mode.h 
b/drivers/staging/sm750fb/ddk750_mode.h
index b4cd90a5d2bc..0292d87aa98b 100644
--- a/drivers/staging/sm750fb/ddk750_mode.h
+++ b/drivers/staging/sm750fb/ddk750_mode.h
@@ -36,6 +36,6 @@ typedef struct _mode_parameter_t {
 
 mode_parameter_t;
 
-int ddk750_setModeTiming(mode_parameter_t *, clock_type_t);
+int ddk750_setModeTiming(mode_parameter_t *parm, clock_type_t clock);
 
 #endif
diff --git a/drivers/staging/sm750fb/ddk750_power.h 
b/drivers/staging/sm750fb/ddk750_power.h
index 1f22a67493af..d2948a7f0cdc 100644
--- a/drivers/staging/sm750fb/ddk750_power.h
+++ b/drivers/staging/sm750fb/ddk750_power.h
@@ -15,7 +15,7 @@ DPMS_t;
   (peek32(MISC_CTRL) & ~MISC_CTRL_DAC_POWER_OFF) | (off)); \
 }
 
-void ddk750_set_dpms(DPMS_t);
+void ddk750_set_dpms(DPMS_t state);
 void sm750_set_power_mode(unsigned int powerMode);
 void sm750_set_current_gate(unsigned int gate);
 
diff --git a/drivers/staging/sm750fb/sm750.h b/drivers/staging/sm750fb/sm750.h
index 306711ed55f9..5ea455dee949 100644
--- a/drivers/staging/sm750fb/sm750.h
+++ b/drivers/staging/sm750fb/sm750.h
@@ -184,7 +184,7 @@ static inline unsigned long ps_to_hz(unsigned int psvalue)
 }
 
 int hw_sm750_map(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
-int hw_sm750_inithw(struct sm750_dev*, struct pci_dev *);
+int hw_sm750_inithw(struct sm750_dev *sm750_dev, struct pci_dev *pdev);
 void hw_sm750_initAccel(struct sm750_dev *);
 int hw_sm750_deWait(void);
 int hw_sm750le_deWait(void);
-- 
2.11.0

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


[PATCH 0/3] multiple checkpatch issues

2017-03-05 Thread Arushi Singhal
Improve readability by fixing multiple checkpatch.pl
issues in sm750fb driver. 

Arushi Singhal (3):
  staging: sm750fb: fixes add blank line after function/struct/union/enum 
declarations
  staging: sm750fb: function prototype argument should have an identifier name
  staging: sm750fb: Alignment should match open parenthesis

 drivers/staging/sm750fb/ddk750_display.h |  3 +-
 drivers/staging/sm750fb/ddk750_mode.c| 69 
 drivers/staging/sm750fb/ddk750_mode.h|  4 +-
 drivers/staging/sm750fb/ddk750_power.h   |  3 +-
 drivers/staging/sm750fb/sm750.h  |  2 +-
 drivers/staging/sm750fb/sm750_cursor.c   |  3 ++
 6 files changed, 45 insertions(+), 39 deletions(-)

-- 
2.11.0

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


Re: [PATCH] Staging: iio: addac - fixed octal file permissions

2017-03-05 Thread Jonathan Cameron
On 05/03/17 06:59, Derek Robson wrote:
> Changed file permission to octal style.
> Found using checkpatch
> 
> Signed-off-by: Derek Robson 
Hi Derek,

I've already applied a similar patch to the iio.git tree.  It just hasn't made
it to the main staging tree quite yet.

Thanks,

Joanthan
> ---
>  drivers/staging/iio/addac/adt7316.c | 108 
> ++--
>  1 file changed, 54 insertions(+), 54 deletions(-)
> 
> diff --git a/drivers/staging/iio/addac/adt7316.c 
> b/drivers/staging/iio/addac/adt7316.c
> index 6054c7298fce..aa251c245981 100644
> --- a/drivers/staging/iio/addac/adt7316.c
> +++ b/drivers/staging/iio/addac/adt7316.c
> @@ -267,7 +267,7 @@ static ssize_t adt7316_store_enabled(struct device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(enabled, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(enabled, 0644,
>   adt7316_show_enabled,
>   adt7316_store_enabled,
>   0);
> @@ -311,7 +311,7 @@ static ssize_t adt7316_store_select_ex_temp(struct device 
> *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(select_ex_temp, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(select_ex_temp, 0644,
>   adt7316_show_select_ex_temp,
>   adt7316_store_select_ex_temp,
>   0);
> @@ -352,7 +352,7 @@ static ssize_t adt7316_store_mode(struct device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(mode, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(mode, 0644,
>   adt7316_show_mode,
>   adt7316_store_mode,
>   0);
> @@ -364,7 +364,7 @@ static ssize_t adt7316_show_all_modes(struct device *dev,
>   return sprintf(buf, "single_channel\nround_robin\n");
>  }
>  
> -static IIO_DEVICE_ATTR(all_modes, S_IRUGO, adt7316_show_all_modes, NULL, 0);
> +static IIO_DEVICE_ATTR(all_modes, 0444, adt7316_show_all_modes, NULL, 0);
>  
>  static ssize_t adt7316_show_ad_channel(struct device *dev,
>   struct device_attribute *attr,
> @@ -446,7 +446,7 @@ static ssize_t adt7316_store_ad_channel(struct device 
> *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(ad_channel, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(ad_channel, 0644,
>   adt7316_show_ad_channel,
>   adt7316_store_ad_channel,
>   0);
> @@ -469,7 +469,7 @@ static ssize_t adt7316_show_all_ad_channels(struct device 
> *dev,
>   "2 - External Temperature\n");
>  }
>  
> -static IIO_DEVICE_ATTR(all_ad_channels, S_IRUGO,
> +static IIO_DEVICE_ATTR(all_ad_channels, 0444,
>   adt7316_show_all_ad_channels, NULL, 0);
>  
>  static ssize_t adt7316_show_disable_averaging(struct device *dev,
> @@ -506,7 +506,7 @@ static ssize_t adt7316_store_disable_averaging(struct 
> device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(disable_averaging, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(disable_averaging, 0644,
>   adt7316_show_disable_averaging,
>   adt7316_store_disable_averaging,
>   0);
> @@ -545,7 +545,7 @@ static ssize_t adt7316_store_enable_smbus_timeout(struct 
> device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(enable_smbus_timeout, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(enable_smbus_timeout, 0644,
>   adt7316_show_enable_smbus_timeout,
>   adt7316_store_enable_smbus_timeout,
>   0);
> @@ -583,7 +583,7 @@ static ssize_t adt7316_store_powerdown(struct device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(powerdown, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(powerdown, 0644,
>   adt7316_show_powerdown,
>   adt7316_store_powerdown,
>   0);
> @@ -621,7 +621,7 @@ static ssize_t adt7316_store_fast_ad_clock(struct device 
> *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(fast_ad_clock, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(fast_ad_clock, 0644,
>   adt7316_show_fast_ad_clock,
>   adt7316_store_fast_ad_clock,
>   0);
> @@ -674,7 +674,7 @@ static ssize_t adt7316_store_da_high_resolution(struct 
> device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(da_high_resolution, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(da_high_resolution, 0644,
>   adt7316_show_da_high_resolution,
>   adt7316_store_da_high_resolution,
>   0);
> @@ -720,7 +720,7 @@ static ssize_t adt7316_store_AIN_internal_Vref(struct 
> device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(AIN_internal_Vref, S_IRUGO | S_IWUSR,
> +static IIO_DEVICE_ATTR(AIN_internal_Vref, 0644,
>   adt7316_show_AIN_internal_Vref,
>   adt7316_store_AIN_internal_Vref,
>   0);
> @@ -760,7 +760,7 @@ static ssize_t adt7316_store_enable_prop_DACA(struct 
> device *dev,
>   return len;
>  }
>  
> -static IIO_DEVICE_ATTR(enable_proportion_DACA, S_IRUGO | S_IWUSR,
> +static