[PATCH 37/42] staging: unisys: visorbus: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrectly styled function definitions in visorbus/visorchipset.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 153 +++---
 1 file changed, 62 insertions(+), 91 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 279c4d4..af02ad0 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -269,8 +269,7 @@ static ssize_t remaining_steps_store(struct device *dev,
 }
 static DEVICE_ATTR_RW(remaining_steps);
 
-static uuid_le
-parser_id_get(struct parser_context *ctx)
+static uuid_le parser_id_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -284,8 +283,7 @@ static void parser_done(struct parser_context *ctx)
kfree(ctx);
 }
 
-static void *
-parser_string_get(struct parser_context *ctx)
+static void *parser_string_get(struct parser_context *ctx)
 {
u8 *pscan;
unsigned long nscan;
@@ -318,8 +316,7 @@ parser_string_get(struct parser_context *ctx)
return value;
 }
 
-static void *
-parser_name_get(struct parser_context *ctx)
+static void *parser_name_get(struct parser_context *ctx)
 {
struct visor_controlvm_parameters_header *phdr = NULL;
 
@@ -372,9 +369,9 @@ struct visor_device *visorbus_get_device_by_id(u32 bus_no, 
u32 dev_no,
return vdev;
 }
 
-static void
-controlvm_init_response(struct controlvm_message *msg,
-   struct controlvm_message_header *msg_hdr, int response)
+static void controlvm_init_response(struct controlvm_message *msg,
+   struct controlvm_message_header *msg_hdr,
+   int response)
 {
memset(msg, 0, sizeof(struct controlvm_message));
memcpy(>hdr, msg_hdr, sizeof(struct controlvm_message_header));
@@ -387,10 +384,10 @@ controlvm_init_response(struct controlvm_message *msg,
}
 }
 
-static int
-controlvm_respond_chipset_init(struct controlvm_message_header *msg_hdr,
-  int response,
-  enum visor_chipset_feature features)
+static int controlvm_respond_chipset_init(
+   struct controlvm_message_header *msg_hdr,
+   int response,
+   enum visor_chipset_feature features)
 {
struct controlvm_message outmsg;
 
@@ -400,8 +397,7 @@ controlvm_respond_chipset_init(struct 
controlvm_message_header *msg_hdr,
 CONTROLVM_QUEUE_REQUEST, );
 }
 
-static int
-chipset_init(struct controlvm_message *inmsg)
+static int chipset_init(struct controlvm_message *inmsg)
 {
static int chipset_inited;
enum visor_chipset_feature features = 0;
@@ -435,9 +431,9 @@ chipset_init(struct controlvm_message *inmsg)
return res;
 }
 
-static int
-controlvm_respond(struct controlvm_message_header *msg_hdr, int response,
- struct visor_segment_state *state)
+static int controlvm_respond(struct controlvm_message_header *msg_hdr,
+int response,
+struct visor_segment_state *state)
 {
struct controlvm_message outmsg;
 
@@ -459,8 +455,8 @@ enum crash_obj_type {
CRASH_BUS,
 };
 
-static int
-save_crash_message(struct controlvm_message *msg, enum crash_obj_type cr_type)
+static int save_crash_message(struct controlvm_message *msg,
+ enum crash_obj_type cr_type)
 {
u32 local_crash_msg_offset;
u16 local_crash_msg_count;
@@ -524,10 +520,9 @@ save_crash_message(struct controlvm_message *msg, enum 
crash_obj_type cr_type)
return 0;
 }
 
-static int
-controlvm_responder(enum controlvm_id cmd_id,
-   struct controlvm_message_header *pending_msg_hdr,
-   int response)
+static int controlvm_responder(enum controlvm_id cmd_id,
+  struct controlvm_message_header *pending_msg_hdr,
+  int response)
 {
if (!pending_msg_hdr)
return -EIO;
@@ -538,10 +533,10 @@ controlvm_responder(enum controlvm_id cmd_id,
return controlvm_respond(pending_msg_hdr, response, NULL);
 }
 
-static int
-device_changestate_responder(enum controlvm_id cmd_id,
-struct visor_device *p, int response,
-struct visor_segment_state response_state)
+static int device_changestate_responder(
+   enum controlvm_id cmd_id,
+   struct visor_device *p, int response,
+

[PATCH 38/42] staging: unisys: visorbus: visorchannel.c: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function definition style in visorbus/visorchannel.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchannel.c | 101 +++---
 1 file changed, 44 insertions(+), 57 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchannel.c 
b/drivers/staging/unisys/visorbus/visorchannel.c
index fcff231..c7eea65 100644
--- a/drivers/staging/unisys/visorbus/visorchannel.c
+++ b/drivers/staging/unisys/visorbus/visorchannel.c
@@ -54,8 +54,7 @@ struct visorchannel {
uuid_le inst;
 };
 
-void
-visorchannel_destroy(struct visorchannel *channel)
+void visorchannel_destroy(struct visorchannel *channel)
 {
if (!channel)
return;
@@ -67,46 +66,39 @@ visorchannel_destroy(struct visorchannel *channel)
kfree(channel);
 }
 
-u64
-visorchannel_get_physaddr(struct visorchannel *channel)
+u64 visorchannel_get_physaddr(struct visorchannel *channel)
 {
return channel->physaddr;
 }
 
-ulong
-visorchannel_get_nbytes(struct visorchannel *channel)
+ulong visorchannel_get_nbytes(struct visorchannel *channel)
 {
return channel->nbytes;
 }
 
-char *
-visorchannel_uuid_id(uuid_le *guid, char *s)
+char *visorchannel_uuid_id(uuid_le *guid, char *s)
 {
sprintf(s, "%pUL", guid);
return s;
 }
 
-char *
-visorchannel_id(struct visorchannel *channel, char *s)
+char *visorchannel_id(struct visorchannel *channel, char *s)
 {
return visorchannel_uuid_id(>guid, s);
 }
 
-char *
-visorchannel_zoneid(struct visorchannel *channel, char *s)
+char *visorchannel_zoneid(struct visorchannel *channel, char *s)
 {
return visorchannel_uuid_id(>chan_hdr.zone_uuid, s);
 }
 
-u64
-visorchannel_get_clientpartition(struct visorchannel *channel)
+u64 visorchannel_get_clientpartition(struct visorchannel *channel)
 {
return channel->chan_hdr.partition_handle;
 }
 
-int
-visorchannel_set_clientpartition(struct visorchannel *channel,
-u64 partition_handle)
+int visorchannel_set_clientpartition(struct visorchannel *channel,
+u64 partition_handle)
 {
channel->chan_hdr.partition_handle = partition_handle;
return 0;
@@ -118,16 +110,14 @@ visorchannel_set_clientpartition(struct visorchannel 
*channel,
  *
  * Return: the UUID of the provided channel
  */
-uuid_le
-visorchannel_get_uuid(struct visorchannel *channel)
+uuid_le visorchannel_get_uuid(struct visorchannel *channel)
 {
return channel->guid;
 }
 EXPORT_SYMBOL_GPL(visorchannel_get_uuid);
 
-int
-visorchannel_read(struct visorchannel *channel, ulong offset,
- void *dest, ulong nbytes)
+int visorchannel_read(struct visorchannel *channel, ulong offset, void *dest,
+ ulong nbytes)
 {
if (offset + nbytes > channel->nbytes)
return -EIO;
@@ -137,9 +127,8 @@ visorchannel_read(struct visorchannel *channel, ulong 
offset,
return 0;
 }
 
-int
-visorchannel_write(struct visorchannel *channel, ulong offset,
-  void *dest, ulong nbytes)
+int visorchannel_write(struct visorchannel *channel, ulong offset, void *dest,
+  ulong nbytes)
 {
size_t chdr_size = sizeof(struct channel_header);
size_t copy_size;
@@ -158,8 +147,7 @@ visorchannel_write(struct visorchannel *channel, ulong 
offset,
return 0;
 }
 
-void *
-visorchannel_get_header(struct visorchannel *channel)
+void *visorchannel_get_header(struct visorchannel *channel)
 {
return >chan_hdr;
 }
@@ -191,9 +179,8 @@ visorchannel_get_header(struct visorchannel *channel)
   &((sig_hdr)->FIELD), \
   sizeof((sig_hdr)->FIELD))
 
-static int
-sig_read_header(struct visorchannel *channel, u32 queue,
-   struct signal_queue_header *sig_hdr)
+static int sig_read_header(struct visorchannel *channel, u32 queue,
+  struct signal_queue_header *sig_hdr)
 {
if (channel->chan_hdr.ch_space_offset < sizeof(struct channel_header))
return -EINVAL;
@@ -204,9 +191,9 @@ sig_read_header(struct visorchannel *channel, u32 queue,
 sig_hdr, sizeof(struct signal_queue_header));
 }
 
-static int
-sig_read_data(struct visorchannel *channel, u32 queue,
- struct signal_queue_header *sig_hdr, u32 slot, void *data)
+static int sig_read_data(struct visorchannel *channel, u32 queue,
+struct signal_queue_header *sig_hdr, u32 slot,
+void *data)
 {
int signal_data_offset = SIG_DATA_OFFSET(>chan_hdr, queue,
 sig_hdr, slot);
@@ -215,9 +202,9 @@ 

[PATCH 34/42] staging: unisys: visorbus: cleaned up include block of visorchipset.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed 4 unneeded includes netdevice, nls, fs, and ctype.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorchipset.c | 4 
 1 file changed, 4 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 6d77160..e694797 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -16,11 +16,7 @@
  */
 
 #include 
-#include 
-#include 
 #include 
-#include 
-#include 
 #include 
 #include 
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 39/42] staging: unisys: visorhba: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function definition style in visorhba/visorhba_main.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorhba/visorhba_main.c | 36 --
 1 file changed, 17 insertions(+), 19 deletions(-)

diff --git a/drivers/staging/unisys/visorhba/visorhba_main.c 
b/drivers/staging/unisys/visorhba/visorhba_main.c
index 1b4b338..178d022 100644
--- a/drivers/staging/unisys/visorhba/visorhba_main.c
+++ b/drivers/staging/unisys/visorhba/visorhba_main.c
@@ -122,8 +122,8 @@ struct visorhba_devices_open {
  * Return: The task_struct * denoting the thread on success,
  *or NULL on failure
  */
-static struct task_struct *visor_thread_start
-(int (*threadfn)(void *), void *thrcontext, char *name)
+static struct task_struct *visor_thread_start(int (*threadfn)(void *),
+ void *thrcontext, char *name)
 {
struct task_struct *task;
 
@@ -198,8 +198,7 @@ static int add_scsipending_entry(struct visorhba_devdata 
*devdata,
  *
  * Return: The scsipending entry pointed to on success, NULL on failure
  */
-static void *del_scsipending_ent(struct visorhba_devdata *devdata,
-int del)
+static void *del_scsipending_ent(struct visorhba_devdata *devdata, int del)
 {
unsigned long flags;
void *sent;
@@ -460,8 +459,7 @@ static int visorhba_bus_reset_handler(struct scsi_cmnd 
*scsicmd)
  *
  * Return: Not supported, return SUCCESS
  */
-static int
-visorhba_host_reset_handler(struct scsi_cmnd *scsicmd)
+static int visorhba_host_reset_handler(struct scsi_cmnd *scsicmd)
 {
/* issue TASK_MGMT_TARGET_RESET for each target on each bus for host */
return SUCCESS;
@@ -490,9 +488,9 @@ static const char *visorhba_get_info(struct Scsi_Host *shp)
  * Return: 0 if successfully queued to the Service Partition, otherwise
  *error code
  */
-static int
-visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
-  void (*visorhba_cmnd_done)(struct scsi_cmnd *))
+static int visorhba_queue_command_lck(struct scsi_cmnd *scsicmd,
+ void (*visorhba_cmnd_done)
+  (struct scsi_cmnd *))
 {
struct uiscmdrsp *cmdrsp;
struct scsi_device *scsidev = scsicmd->device;
@@ -798,8 +796,8 @@ static int visorhba_serverdown(struct visorhba_devdata 
*devdata)
  *
  * Don't log errors for disk-not-present inquiries.
  */
-static void
-do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void do_scsi_linuxstat(struct uiscmdrsp *cmdrsp,
+ struct scsi_cmnd *scsicmd)
 {
struct visorhba_devdata *devdata;
struct visordisk_info *vdisk;
@@ -823,8 +821,8 @@ do_scsi_linuxstat(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
}
 }
 
-static int set_no_disk_inquiry_result(unsigned char *buf,
- size_t len, bool is_lun0)
+static int set_no_disk_inquiry_result(unsigned char *buf, size_t len,
+ bool is_lun0)
 {
if (len < NO_DISK_INQUIRY_RESULT_LEN)
return -EINVAL;
@@ -848,8 +846,8 @@ static int set_no_disk_inquiry_result(unsigned char *buf,
  *
  * Handle response when no linuxstat was returned.
  */
-static void
-do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp,
+   struct scsi_cmnd *scsicmd)
 {
struct scsi_device *scsidev;
unsigned char *buf;
@@ -915,8 +913,8 @@ do_scsi_nolinuxstat(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
  * Response was returned by the Service Partition. Finish it and send
  * completion to the scsi midlayer.
  */
-static void
-complete_scsi_command(struct uiscmdrsp *cmdrsp, struct scsi_cmnd *scsicmd)
+static void complete_scsi_command(struct uiscmdrsp *cmdrsp,
+ struct scsi_cmnd *scsicmd)
 {
/* take what we need out of cmdrsp and complete the scsicmd */
scsicmd->result = cmdrsp->scsi.linuxstat;
@@ -935,8 +933,8 @@ complete_scsi_command(struct uiscmdrsp *cmdrsp, struct 
scsi_cmnd *scsicmd)
  *
  * Pulls responses out of the iochannel and process the responses.
  */
-static void
-drain_queue(struct uiscmdrsp *cmdrsp, struct visorhba_devdata *devdata)
+static void drain_queue(struct uiscmdrsp *cmdrsp,
+   struct visorhba_devdata *devdata)
 {
struct scsi_cmnd *scsicmd;
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 41/42] staging: unisys: visornic: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function declaration style in visornic/visornic_main.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visornic/visornic_main.c | 101 +++--
 1 file changed, 43 insertions(+), 58 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 5ae8401..0b39676 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -155,9 +155,9 @@ struct visornic_devdata {
 };
 
 /* Returns next non-zero index on success or 0 on failure (i.e. out of room). 
*/
-static u16
-add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len, u16 index,
-u16 max_pi_arr_entries, struct phys_info pi_arr[])
+static u16 add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 inp_len,
+   u16 index, u16 max_pi_arr_entries,
+   struct phys_info pi_arr[])
 {
u32 len;
u16 i, firstlen;
@@ -203,10 +203,10 @@ add_physinfo_entries(u64 inp_pfn, u16 inp_off, u32 
inp_len, u16 index,
  * Return value indicates number of entries filled in frags
  * Negative values indicate an error.
  */
-static int
-visor_copy_fragsinfo_from_skb(struct sk_buff *skb, unsigned int firstfraglen,
- unsigned int frags_max,
- struct phys_info frags[])
+static int visor_copy_fragsinfo_from_skb(struct sk_buff *skb,
+unsigned int firstfraglen,
+unsigned int frags_max,
+struct phys_info frags[])
 {
unsigned int count = 0, frag, size, offset = 0, numfrags;
unsigned int total_count;
@@ -309,8 +309,7 @@ static const struct file_operations 
debugfs_enable_ints_fops = {
  * being down.
  * Returns void.
  */
-static void
-visornic_serverdown_complete(struct visornic_devdata *devdata)
+static void visornic_serverdown_complete(struct visornic_devdata *devdata)
 {
struct net_device *netdev = devdata->netdev;
 
@@ -341,9 +340,8 @@ visornic_serverdown_complete(struct visornic_devdata 
*devdata)
  * sure we haven't already handled the server change state event.
  * Returns 0 if we scheduled the work, -EINVAL on error.
  */
-static int
-visornic_serverdown(struct visornic_devdata *devdata,
-   visorbus_state_complete_func complete_func)
+static int visornic_serverdown(struct visornic_devdata *devdata,
+  visorbus_state_complete_func complete_func)
 {
unsigned long flags;
int err;
@@ -388,8 +386,7 @@ visornic_serverdown(struct visornic_devdata *devdata,
  * so that it can write rcv data into our memory space.
  * Return pointer to sk_buff
  */
-static struct sk_buff *
-alloc_rcv_buf(struct net_device *netdev)
+static struct sk_buff *alloc_rcv_buf(struct net_device *netdev)
 {
struct sk_buff *skb;
 
@@ -420,9 +417,8 @@ alloc_rcv_buf(struct net_device *netdev)
  * Send the skb to the IO Partition.
  * Returns 0 or error
  */
-static int
-post_skb(struct uiscmdrsp *cmdrsp,
-struct visornic_devdata *devdata, struct sk_buff *skb)
+static int post_skb(struct uiscmdrsp *cmdrsp, struct visornic_devdata *devdata,
+   struct sk_buff *skb)
 {
int err;
 
@@ -461,9 +457,8 @@ post_skb(struct uiscmdrsp *cmdrsp,
  * Send the enable/disable message to the IO Partition.
  * Returns 0 or error
  */
-static int
-send_enbdis(struct net_device *netdev, int state,
-   struct visornic_devdata *devdata)
+static int send_enbdis(struct net_device *netdev, int state,
+  struct visornic_devdata *devdata)
 {
int err;
 
@@ -490,8 +485,8 @@ send_enbdis(struct net_device *netdev, int state,
  * Returns 0 on success, negative for failure of IO Partition
  * responding.
  */
-static int
-visornic_disable_with_timeout(struct net_device *netdev, const int timeout)
+static int visornic_disable_with_timeout(struct net_device *netdev,
+const int timeout)
 {
struct visornic_devdata *devdata = netdev_priv(netdev);
int i;
@@ -578,8 +573,8 @@ visornic_disable_with_timeout(struct net_device *netdev, 
const int timeout)
  * Allocate rcv buffers and post them to the IO Partition.
  * Return 0 for success, and negative for failure.
  */
-static int
-init_rcv_bufs(struct net_device *netdev, struct visornic_devdata *devdata)
+static int init_rcv_bufs(struct net_device *netdev,
+struct visornic_devdata *devdata)
 {
int i, j, count, err;
 
@@ -645,8 +640,8 @@ 

[PATCH 42/42] staging: unisys: visornic: update the struct viosrnic_devdata to have kernel-doc like comments

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

Cleaned up the in-line comments in the structure and added a
kernel-doc like comment for the structure.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visornic/visornic_main.c | 86 --
 1 file changed, 61 insertions(+), 25 deletions(-)

diff --git a/drivers/staging/unisys/visornic/visornic_main.c 
b/drivers/staging/unisys/visornic/visornic_main.c
index 0b39676..90d9d03 100644
--- a/drivers/staging/unisys/visornic/visornic_main.c
+++ b/drivers/staging/unisys/visornic/visornic_main.c
@@ -68,10 +68,68 @@ struct chanstat {
unsigned long extra_rcvbufs_sent;
 };
 
+/* struct visornic_devdata
+ *
+ * @enabled:0 disabled 1 enabled to receive.
+ * @enab_dis_acked: NET_RCV_ENABLE/DISABLE acked by IOPART.
+ * @struct *dev:
+ * @struct *netdev:
+ * @struct net_stats:
+ * @interrupt_rcvd:
+ * @rsp_queue:
+ * @struct **rcvbuf:
+ * @incarnation_id: incarnation_id lets IOPART know about
+ *  re-birth.
+ * @old_flags:  flags as they were prior to
+ *  set_multicast_list.
+ * @usage:  count of users.
+ * @num_rcv_bufs:   number of rcv buffers the vnic will post.
+ * @num_rcv_bufs_could_not_alloc:
+ * @num_rcvbuf_in_iovm:
+ * @alloc_failed_in_if_needed_cnt:
+ * @alloc_failed_in_repost_rtn_cnt:
+ * @max_outstanding_net_xmits:  absolute max number of outstanding xmits
+ *  - should never hit this.
+ * @upper_threshold_net_xmits:  high water mark for calling
+ *  netif_stop_queue().
+ * @lower_threshold_net_xmits:  high water mark for calling
+ *  netif_wake_queue().
+ * @struct xmitbufhead: xmitbufhead - head of the xmit buffer list
+ *  sent to the IOPART end.
+ * @server_down_complete_func:
+ * @struct timeout_reset:
+ * @struct *cmdrsp_rcv: cmdrsp_rcv is used for posting/unposting 
rcv
+ *  buffers.
+ * @struct *xmit_cmdrsp:xmit_cmdrsp - issues NET_XMIT - only one
+ *  active xmit at a time.
+ * @server_down:IOPART is down.
+ * @server_change_state:Processing SERVER_CHANGESTATE msg.
+ * @going_away: device is being torn down.
+ * @struct *eth_debugfs_dir:
+ * @interrupts_rcvd:
+ * @interrupts_notme:
+ * @interrupts_disabled:
+ * @busy_cnt:
+ * @priv_lock:  spinlock to access devdata structures.
+ * @flow_control_upper_hits:
+ * @flow_control_lower_hits:
+ * @n_rcv0: # rcvs of 0 buffers.
+ * @n_rcv1: # rcvs of 1 buffers.
+ * @n_rcv2: # rcvs of 2 buffers.
+ * @n_rcvx: # rcvs of >2 buffers.
+ * @found_repost_rcvbuf_cnt:# repost_rcvbuf_cnt.
+ * @repost_found_skb_cnt:   # of found the skb.
+ * @n_repost_deficit:   # of lost rcv buffers.
+ * @bad_rcv_buf:# of unknown rcv skb not freed.
+ * @n_rcv_packets_not_accepted: # bogs rcv packets.
+ * @queuefullmsg_logged:
+ * @struct chstat:
+ * @struct irq_poll_timer:
+ * @struct napi:
+ * @struct cmdrsp:
+ */
 struct visornic_devdata {
-   /* 0 disabled 1 enabled to receive */
unsigned short enabled;
-   /* NET_RCV_ENABLE/DISABLE acked by IOPART */
unsigned short enab_dis_acked;
 
struct visor_device *dev;
@@ -80,47 +138,34 @@ struct visornic_devdata {
atomic_t interrupt_rcvd;
wait_queue_head_t rsp_queue;
struct sk_buff **rcvbuf;
-   /* incarnation_id lets IOPART know about re-birth */
u64 incarnation_id;
-   /* flags as they were prior to set_multicast_list */
unsigned short old_flags;
-   /* count of users */
atomic_t usage;
 
-   /* number of rcv buffers the vnic will post */
int num_rcv_bufs;
int num_rcv_bufs_could_not_alloc;
atomic_t num_rcvbuf_in_iovm;
unsigned long alloc_failed_in_if_needed_cnt;
unsigned long alloc_failed_in_repost_rtn_cnt;
 
-   /* absolute max number of outstanding xmits - should never hit this */
unsigned long max_outstanding_net_xmits;
-   /* high water mark for calling netif_stop_queue() */
unsigned long upper_threshold_net_xmits;
-   /* high water mark for calling netif_wake_queue() */
unsigned long lower_threshold_net_xmits;
-   /* xmitbufhead - head of the xmit buffer list sent to the IOPART end */
struct sk_buff_head xmitbufhead;
 
visorbus_state_complete_func server_down_complete_func;
struct 

[PATCH 33/42] staging: unisys: visorbus: Removed unused define from visorbus_main.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed unused #define CURRENT_FILE_PC.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 97524b0..9012cc1 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -23,7 +23,6 @@
 
 /* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
-#define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_NORMALCHANNEL 10
 
 /* stores whether bus_registration was successful */
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 32/42] staging: unisys: visorbus: removed blank line in viorbus_main.c

2017-07-17 Thread David Kershner
From: Mark Foresta 

Removed blank line between #defines.

Signed-off-by: Mark Foresta 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 1 -
 1 file changed, 1 deletion(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index b5c6017..97524b0 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -23,7 +23,6 @@
 
 /* Display string that is guaranteed to be no longer the 99 characters */
 #define LINESIZE 99
-
 #define CURRENT_FILE_PC VISOR_BUS_PC_visorbus_main_c
 #define POLLJIFFIES_NORMALCHANNEL 10
 
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 16/42] staging: unisys: visorbus: visorbus_main.c: remove extra checks for dev->visorchannel

2017-07-17 Thread David Kershner
From: Sameer Wadgaonkar 

Removed checks for dev->visorchannel in visorbus_release_device()
and visorbus_remove_instance() since it is also checked in the
visorchannel_destroy() function.

Signed-off-by: Sameer Wadgaonkar 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 10 ++
 1 file changed, 2 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1a212ec..bdebd58 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -156,10 +156,7 @@ visorbus_release_device(struct device *xdev)
 {
struct visor_device *dev = to_visor_device(xdev);
 
-   if (dev->visorchannel) {
-   visorchannel_destroy(dev->visorchannel);
-   dev->visorchannel = NULL;
-   }
+   visorchannel_destroy(dev->visorchannel);
kfree(dev);
 }
 
@@ -1058,10 +1055,7 @@ visorbus_remove_instance(struct visor_device *dev)
 * successfully been able to trace thru the code to see where/how
 * release() gets called.  But I know it does.
 */
-   if (dev->visorchannel) {
-   visorchannel_destroy(dev->visorchannel);
-   dev->visorchannel = NULL;
-   }
+   visorchannel_destroy(dev->visorchannel);
kfree(dev->vbus_hdr_info);
list_del(>list_all);
device_unregister(>device);
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[PATCH 40/42] staging: unisys: visorinput: fix multi-line function definition

2017-07-17 Thread David Kershner
From: Charles Daniels 

Fixed incorrect function declaration style in visorinput/visorinput.c
by placing the function names on the same line as the return.

Signed-off-by: Charles Daniels 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorinput/visorinput.c | 52 +++
 1 file changed, 20 insertions(+), 32 deletions(-)

diff --git a/drivers/staging/unisys/visorinput/visorinput.c 
b/drivers/staging/unisys/visorinput/visorinput.c
index 761e56b..65060e9 100644
--- a/drivers/staging/unisys/visorinput/visorinput.c
+++ b/drivers/staging/unisys/visorinput/visorinput.c
@@ -276,9 +276,8 @@ static void visorinput_close(struct input_dev 
*visorinput_dev)
  * we can use to deliver keyboard inputs to Linux.  We of course do this when
  * we see keyboard inputs coming in on a keyboard channel.
  */
-static struct input_dev *
-setup_client_keyboard(void *devdata,  /* opaque on purpose */
- unsigned char *keycode_table)
+static struct input_dev *setup_client_keyboard(void *devdata,
+  unsigned char *keycode_table)
 
 {
int i;
@@ -319,8 +318,7 @@ setup_client_keyboard(void *devdata,  /* opaque on purpose 
*/
return visorinput_dev;
 }
 
-static struct input_dev *
-setup_client_mouse(void *devdata /* opaque on purpose */)
+static struct input_dev *setup_client_mouse(void *devdata)
 {
int xres, yres;
struct fb_info *fb0;
@@ -361,8 +359,9 @@ setup_client_mouse(void *devdata /* opaque on purpose */)
return visorinput_dev;
 }
 
-static struct visorinput_devdata *
-devdata_create(struct visor_device *dev, enum visorinput_device_type devtype)
+static struct visorinput_devdata *devdata_create(
+   struct visor_device *dev,
+   enum visorinput_device_type devtype)
 {
struct visorinput_devdata *devdata = NULL;
unsigned int extra_bytes = 0;
@@ -447,8 +446,7 @@ devdata_create(struct visor_device *dev, enum 
visorinput_device_type devtype)
return NULL;
 }
 
-static int
-visorinput_probe(struct visor_device *dev)
+static int visorinput_probe(struct visor_device *dev)
 {
uuid_le guid;
enum visorinput_device_type devtype;
@@ -466,15 +464,13 @@ visorinput_probe(struct visor_device *dev)
return 0;
 }
 
-static void
-unregister_client_input(struct input_dev *visorinput_dev)
+static void unregister_client_input(struct input_dev *visorinput_dev)
 {
if (visorinput_dev)
input_unregister_device(visorinput_dev);
 }
 
-static void
-visorinput_remove(struct visor_device *dev)
+static void visorinput_remove(struct visor_device *dev)
 {
struct visorinput_devdata *devdata = dev_get_drvdata(>device);
 
@@ -500,9 +496,8 @@ visorinput_remove(struct visor_device *dev)
  * Make it so the current locking state of the locking key indicated by
  *  is as indicated by  (1=locked, 0=unlocked).
  */
-static void
-handle_locking_key(struct input_dev *visorinput_dev,
-  int keycode, int desired_state)
+static void handle_locking_key(struct input_dev *visorinput_dev, int keycode,
+  int desired_state)
 {
int led;
 
@@ -534,8 +529,7 @@ handle_locking_key(struct input_dev *visorinput_dev,
  * with 0xE0 in the low byte and the extended scancode value in the next
  * higher byte.
  */
-static int
-scancode_to_keycode(int scancode)
+static int scancode_to_keycode(int scancode)
 {
if (scancode > 0xff)
return visorkbd_ext_keycode[(scancode >> 8) & 0xff];
@@ -543,8 +537,7 @@ scancode_to_keycode(int scancode)
return visorkbd_keycode[scancode];
 }
 
-static int
-calc_button(int x)
+static int calc_button(int x)
 {
switch (x) {
case 1:
@@ -563,8 +556,7 @@ calc_button(int x)
  * client guest partition.  It is called periodically so we can obtain inputs
  * from the channel, and deliver them to the guest OS.
  */
-static void
-visorinput_channel_interrupt(struct visor_device *dev)
+static void visorinput_channel_interrupt(struct visor_device *dev)
 {
struct visor_inputreport r;
int scancode, keycode;
@@ -656,9 +648,8 @@ visorinput_channel_interrupt(struct visor_device *dev)
}
 }
 
-static int
-visorinput_pause(struct visor_device *dev,
-visorbus_state_complete_func complete_func)
+static int visorinput_pause(struct visor_device *dev,
+   visorbus_state_complete_func complete_func)
 {
int rc;
struct visorinput_devdata *devdata = dev_get_drvdata(>device);
@@ -689,9 +680,8 @@ visorinput_pause(struct visor_device *dev,
return rc;
 }
 
-static int
-visorinput_resume(struct visor_device *dev,
- visorbus_state_complete_func complete_func)
+static int visorinput_resume(struct 

[PATCH 27/42] staging: unisys: visorbus: rename fix_vbus_dev_info

2017-07-17 Thread David Kershner
From: Erik Arfvidson 

Rename fix_vbus_dev_info to something clearer: publish_vbus_dev_info.

Signed-off-by: Erik Arfvidson 
Signed-off-by: David Kershner 
Reviewed-by: David Binder 
---
 drivers/staging/unisys/visorbus/visorbus_main.c | 15 +++
 1 file changed, 7 insertions(+), 8 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 8c633e2..b5c6017 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -849,13 +849,13 @@ static void bus_device_info_init(
 }
 
 /*
- * fix_vbus_dev_info() - for a child device just created on a client bus, fill
- *   in information about the driver that is controlling
- *   this device into the appropriate slot within the
- *   vbus channel of the bus instance
+ * publish_vbus_dev_info() - for a child device just created on a client bus,
+ *  fill in information about the driver that is
+ *  controlling this device into the appropriate slot
+ *  within the vbus channel of the bus instance
  * @visordev: struct visor_device for the desired device
  */
-static void fix_vbus_dev_info(struct visor_device *visordev)
+static void publish_vbus_dev_info(struct visor_device *visordev)
 {
int i;
struct visor_device *bdev;
@@ -930,7 +930,7 @@ static int visordriver_probe_device(struct device *xdev)
if (res >= 0) {
/* success: reference kept via unmatched get_device() */
get_device(>device);
-   fix_vbus_dev_info(dev);
+   publish_vbus_dev_info(dev);
}
 
mutex_unlock(>visordriver_callback_lock);
@@ -1229,8 +1229,7 @@ static int 
visorchipset_initiate_device_pause_resume(struct visor_device *dev,
 * The vbus_dev_info structure in the channel was been cleared,
 * make sure it is valid.
 */
-   fix_vbus_dev_info(dev);
-
+   publish_vbus_dev_info(dev);
dev->resuming = true;
err = drv->resume(dev, resume_state_change_complete);
}
-- 
git-series 0.9.1
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


[patch v2 2/3] staging: speakup: use tty_kopen instead of tty_open_by_driver

2017-07-17 Thread Okash Khawaja
This patch replaces call to tty_open_by_driver with a tty_kopen.

Signed-off-by: Okash Khawaja 

---
 drivers/staging/speakup/spk_ttyio.c |2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/staging/speakup/spk_ttyio.c
+++ b/drivers/staging/speakup/spk_ttyio.c
@@ -158,7 +158,7 @@ static int spk_ttyio_initialise_ldisc(st
if (ret)
return ret;
 
-   tty = tty_open_by_driver(dev, NULL, NULL);
+   tty = tty_kopen(dev);
if (IS_ERR(tty))
return PTR_ERR(tty);
 

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


[patch v2 1/3] tty: resolve tty contention between kernel and user space

2017-07-17 Thread Okash Khawaja
The commit 12e84c71b7d4ee (tty: export tty_open_by_driver) exports
tty_open_by_device to allow tty to be opened from inside kernel which
works fine except that it doesn't handle contention with user space or
another kernel-space open of the same tty. For example, opening a tty
from user space while it is kernel opened results in failure and a
kernel log message about mismatch between tty->count and tty's file
open count.

This patch makes kernel access to tty exclusive, so that if a user
process or kernel opens a kernel opened tty, it gets -EBUSY. It does
this by adding TTY_KOPENED flag to tty->flags. When this flag is set,
tty_open_by_driver returns -EBUSY. Instead of overlaoding
tty_open_by_driver for both kernel and user space, this
patch creates a separate function tty_kopen which closely follows
tty_open_by_driver.

To address the mismatch between tty->count and #fd's, this patch adds
#kopen's to the count before comparing it with tty->count. That way
check_tty_count reflects correct usage count. 

Returning -EBUSY on tty open is a change in the interface. I have
tested this with minicom, picocom and commands like "echo foo >
/dev/ttyS0". They all correctly report "Device or resource busy" when
the tty is already kernel opened.

Signed-off-by: Okash Khawaja 

---
 drivers/tty/tty_io.c |   66 +++
 include/linux/tty.h  |4 +++
 2 files changed, 65 insertions(+), 5 deletions(-)

--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -280,7 +280,7 @@ static int check_tty_count(struct tty_st
 {
 #ifdef CHECK_TTY_COUNT
struct list_head *p;
-   int count = 0;
+   int count = 0, kopen_count = 0;
 
spin_lock(>files_lock);
list_for_each(p, >tty_files) {
@@ -291,10 +291,12 @@ static int check_tty_count(struct tty_st
tty->driver->subtype == PTY_TYPE_SLAVE &&
tty->link && tty->link->count)
count++;
-   if (tty->count != count) {
-   tty_warn(tty, "%s: tty->count(%d) != #fd's(%d)\n",
-routine, tty->count, count);
-   return count;
+   if (test_bit(TTY_KOPENED, >flags))
+   kopen_count++;
+   if (tty->count != (count + kopen_count)) {
+   tty_warn(tty, "%s: tty->count(%d) != (#fd's(%d) + 
#kopen's(%d)\n",
+routine, tty->count, count, kopen_count);
+   return (count + kopen_count);
}
 #endif
return 0;
@@ -1786,6 +1788,54 @@ static struct tty_driver *tty_lookup_dri
 }
 
 /**
+ * tty_kopen   -   open a tty device for kernel
+ * @device: dev_t of device to open
+ *
+ * Opens tty exclusively for kernel. Performs the driver lookup,
+ * makes sure it's not already opened and performs the first-time
+ * tty initialization.
+ *
+ * Returns the locked initialized _struct
+ *
+ * Claims the global tty_mutex to serialize:
+ *   - concurrent first-time tty initialization
+ *   - concurrent tty driver removal w/ lookup
+ *   - concurrent tty removal from driver table
+ */
+struct tty_struct *tty_kopen(dev_t device)
+{
+   struct tty_struct *tty;
+   struct tty_driver *driver = NULL;
+   int index = -1;
+
+   mutex_lock(_mutex);
+   driver = tty_lookup_driver(device, NULL, );
+   if (IS_ERR(driver)) {
+   mutex_unlock(_mutex);
+   return ERR_CAST(driver);
+   }
+
+   /* check whether we're reopening an existing tty */
+   tty = tty_driver_lookup_tty(driver, NULL, index);
+   if (IS_ERR(tty))
+   goto out;
+
+   if (tty) {
+   /* drop kref from tty_driver_lookup_tty() */
+   tty_kref_put(tty);
+   tty = ERR_PTR(-EBUSY);
+   } else { /* tty_init_dev returns tty with the tty_lock held */
+   tty = tty_init_dev(driver, index);
+   set_bit(TTY_KOPENED, >flags);
+   }
+out:
+   mutex_unlock(_mutex);
+   tty_driver_kref_put(driver);
+   return tty;
+}
+EXPORT_SYMBOL_GPL(tty_kopen);
+
+/**
  * tty_open_by_driver  -   open a tty device
  * @device: dev_t of device to open
  * @inode: inode of device file
@@ -1824,6 +1874,12 @@ struct tty_struct *tty_open_by_driver(de
}
 
if (tty) {
+   if (test_bit(TTY_KOPENED, >flags)) {
+   tty_kref_put(tty);
+   mutex_unlock(_mutex);
+   tty = ERR_PTR(-EBUSY);
+   goto out;
+   }
mutex_unlock(_mutex);
retval = tty_lock_interruptible(tty);
tty_kref_put(tty);  /* drop kref from tty_driver_lookup_tty() */
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -362,6 +362,7 @@ struct tty_file_private {
 #define TTY_NO_WRITE_SPLIT 17  /* Preserve write boundaries to driver 
*/
 #define TTY_HUPPED 18  /* Post 

[patch v2 3/3] tty: undo export of tty_open_by_driver

2017-07-17 Thread Okash Khawaja
Since we have tty_kopen, we no longer need to export tty_open_by_driver.
This patch makes this function static.

Signed-off-by: Okash Khawaja 

---
 drivers/tty/tty_io.c |3 +--
 include/linux/tty.h  |5 -
 2 files changed, 1 insertion(+), 7 deletions(-)

--- a/drivers/tty/tty_io.c
+++ b/drivers/tty/tty_io.c
@@ -1851,7 +1851,7 @@ EXPORT_SYMBOL_GPL(tty_kopen);
  *   - concurrent tty driver removal w/ lookup
  *   - concurrent tty removal from driver table
  */
-struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode,
+static struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode,
 struct file *filp)
 {
struct tty_struct *tty;
@@ -1902,7 +1902,6 @@ out:
tty_driver_kref_put(driver);
return tty;
 }
-EXPORT_SYMBOL_GPL(tty_open_by_driver);
 
 /**
  * tty_open-   open a tty device
--- a/include/linux/tty.h
+++ b/include/linux/tty.h
@@ -400,8 +400,6 @@ extern struct tty_struct *get_current_tt
 /* tty_io.c */
 extern int __init tty_init(void);
 extern const char *tty_name(const struct tty_struct *tty);
-extern struct tty_struct *tty_open_by_driver(dev_t device, struct inode *inode,
-   struct file *filp);
 extern struct tty_struct *tty_kopen(dev_t device);
 extern int tty_dev_name_to_number(const char *name, dev_t *number);
 #else
@@ -424,9 +422,6 @@ static inline int __init tty_init(void)
 { return 0; }
 static inline const char *tty_name(const struct tty_struct *tty)
 { return "(none)"; }
-static inline struct tty_struct *tty_open_by_driver(dev_t device,
-   struct inode *inode, struct file *filp)
-{ return NULL; }
 static inline struct tty_struct *tty_kopen(dev_t device)
 { return ERR_PTR(-ENODEV); }
 static inline int tty_dev_name_to_number(const char *name, dev_t *number)

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


[patch v2 0/3] tty contention resulting from tty_open_by_driver export

2017-07-17 Thread Okash Khawaja
Hi,

I have reworked the previous patch set. These are the changes:

1. Patch 1 fixes tty->count mismatch reported by check_tty_count when a
tty is kopened.
2. Patch 1 incorporates patch 4 in the previous patch set - it returns
-ENODEV when tty is not configured.

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


Re: [PATCH] staging: gs_fpgaboot: add buffer overflow checks

2017-07-17 Thread Jacob von Chorus
On Mon, Jul 17, 2017 at 10:53:25PM +0300, Dan Carpenter wrote:
> > +   if (len + 1 > n) {
> 
> It's more idiomatic to say "if (len >= n)".  Plus that's a good habbit

My reasoning behind using "((len + 1) > n)" is that len represents the length of
the string without null-termination. "buf" is required to store a
null-terminator on top of len. Using "len + 1" shows this requirement
more clearly; I will add brackets around "len + 1" for emphasis.

Thanks for the feedback, I will send a v2.

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


Re: [PATCH 1/3] staging: ccree: Replace kzalloc with devm_kzalloc

2017-07-17 Thread Suniel Mahesh
On Monday 17 July 2017 06:03 PM, Greg KH wrote:
> On Sat, Jul 15, 2017 at 01:21:54PM +0530, suni...@techveda.org wrote:
>> From: Suniel Mahesh 
>>
>> It is recommended to use managed function devm_kzalloc, which
>> simplifies driver cleanup paths and driver code.
>> This patch does the following:
>> (a) replace kzalloc with devm_kzalloc.
>> (b) drop kfree(), because memory allocated with devm_kzalloc() is
>> automatically freed on driver detach, otherwise it leads to a double
>> free.
>> (c) remove unnecessary blank lines.
>>
>> Signed-off-by: Suniel Mahesh 
>> ---
>> Note:
>> - Patch was tested and built(ARCH=arm) on next-20170714.
>>   No build issues reported, however it was not tested on
>>   real hardware.
>> ---
>>  drivers/staging/ccree/ssi_driver.c | 10 --
>>  1 file changed, 4 insertions(+), 6 deletions(-)
>>
>> diff --git a/drivers/staging/ccree/ssi_driver.c 
>> b/drivers/staging/ccree/ssi_driver.c
>> index 78709b92..f231ecf 100644
>> --- a/drivers/staging/ccree/ssi_driver.c
>> +++ b/drivers/staging/ccree/ssi_driver.c
>> @@ -224,13 +224,15 @@ static int init_cc_resources(struct platform_device 
>> *plat_dev)
>>  struct resource *req_mem_cc_regs = NULL;
>>  void __iomem *cc_base = NULL;
>>  bool irq_registered = false;
>> -struct ssi_drvdata *new_drvdata = kzalloc(sizeof(struct ssi_drvdata), 
>> GFP_KERNEL);
>> +struct ssi_drvdata *new_drvdata;
>>  struct device *dev = _dev->dev;
>>  struct device_node *np = dev->of_node;
>>  u32 signature_val;
>>  int rc = 0;
>>  
>> -if (unlikely(!new_drvdata)) {
>> +new_drvdata = devm_kzalloc(_dev->dev, sizeof(struct ssi_drvdata),
> 
> sizeof(*new_drvdata), right?
> 
Yes, sending v2 in a while. Thanks for the review
suniel
> thanks,
> 
> greg k-h
> 

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


Re: [PATCH v2 2/2] staging: gs_fpgaboot: change char to u8

2017-07-17 Thread Joe Perches
On Mon, 2017-07-17 at 20:47 -0400, Jacob von Chorus wrote:
> The bitstream storage variables were changed from char to u8 arrays to
> prevent issues such as negative lengths. This change makes the code
> compatible with the "data" field in "struct firmware" which is of type
> u8.
> 
> Signed-off-by: Jacob von Chorus 
> ---
>  drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 24 
>  drivers/staging/gs_fpgaboot/gs_fpgaboot.h |  2 +-
>  2 files changed, 13 insertions(+), 13 deletions(-)
> 
> diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
> b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> index 008ef99f05..467a0ad81f 100644
> --- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> +++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
> @@ -41,16 +41,16 @@ static char   *file = "xlinx_fpga_firmware.bit";
>  module_param(file, charp, 0444);
>  MODULE_PARM_DESC(file, "Xilinx FPGA firmware file.");
>  
> -static void read_bitstream(char *bitdata, char *buf, int *offset, int rdsize)
> +static void read_bitstream(u8 *bitdata, u8 *buf, int *offset, int rdsize)
>  {
>   memcpy(buf, bitdata + *offset, rdsize);
>   *offset += rdsize;
>  }
>  
> -static int readinfo_bitstream(char *bitdata, char *buf, int size, int 
> *offset)
> +static int readinfo_bitstream(u8 *bitdata, u8 *buf, int size, int *offset)
>  {
> - char tbuf[64];
> - s32 len;
> + u8 tbuf[64];
> + u16 len;
>  
>   /* read section char */
>   read_bitstream(bitdata, tbuf, offset, 1);

read_bitstream takes an int rdsize, not a u16.
and this function will overflow tbuf if len > 64

static void readinfo_bitstream(char *bitdata, char *buf, int *offset)
{
char tbuf[64];
s32 len;

/* read section char */
read_bitstream(bitdata, tbuf, offset, 1);

/* read length */
read_bitstream(bitdata, tbuf, offset, 2);

len = tbuf[0] << 8 | tbuf[1];

read_bitstream(bitdata, buf, offset, len);
buf[len] = '\0';
}

len is up to 64k but tbuf is 64 bytes.

len = get_unaligned_le16(tbuf)

might be nicer than

len = tbuf[0] << 8 | tbuf[1];

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


Re: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Greg KH
On Mon, Jul 17, 2017 at 09:36:58PM +, Kershner, David A wrote:
> > -Original Message-
> > From: Greg KH [mailto:g...@kroah.com]
> > Sent: Monday, July 17, 2017 8:38 AM
> > To: Arvind Yadav 
> > Cc: Kershner, David A ; Sell, Timothy C
> > ; Thompson, Bryan E.
> > ; jon.fri...@unisys.com; Binder, David
> > Anthony ; *S-Par-Maintainer
> > ; de...@driverdev.osuosl.org; linux-
> > ker...@vger.kernel.org
> > Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group
> > structures.

Why is this in your email body?

> > 
> > On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote:
> > > Hi Greg,
> > >
> > >
> > > On Monday 17 July 2017 04:15 PM, Greg KH wrote:
> > > > On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:
> > > > > attribute_groups are not supposed to change at runtime. All functions
> > > > > working with attribute_groups provided by  work
> > > > > with const attribute_group. So mark the non-const structs as const.
> > > > >
> > > > > Signed-off-by: Arvind Yadav 
> > > > > ---
> > > > >   drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> > > > >   drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
> > > > >   2 files changed, 3 insertions(+), 3 deletions(-)
> > > > Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
> > > > something that is preventing that?
> > > Yes, we can use. if we are only initializing '.attrs'.
> > > ATTRIBUTE_GROUPS() will not work if we will initialize other member of
> > > attribute_group like 'bin_attrs', 'is_visible', and  'name'.
> > 
> > That means you should redo this patch :)
> > 
> > Also, your changelog text had a typo, it is "attribute_group", not
> > "attribute_groups".
> > 
> 
> Greg, are you recommending that we shouldn't be setting the attribute_group
> .name field? What does it pick up if we don't specify it?

Why do you want a name for your group?  Anyway, yes, you are right, if
you set a .name, then you can't use the macro, my fault, I hadn't looked
at it in a long time.

> Also, for our attribute_groups in visorchipset, we are defining it with two
> different attribute_group variables. Are you allowed to use two different
> attribute_group variables in an attribute_groups, or is this frowned upon and
> we should flatten it out to just one? An example that we used in the kernel 
> was:
> 
>   static const struct attribute_group *l2_cache_pmu_attr_grps[] = {
>   _cache_pmu_format_group,
>   _cache_pmu_cpumask_group,
>   NULL,
>   };

Nah, that's fine, sorry for the noise.  But the changelog text still
should be fixed so I can take this.

thanks,

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


[PATCH] staging: pi433: Fix a couple of spelling mistakes

2017-07-17 Thread Colin King
From: Colin Ian King 

Trivial fix to spelling mistakes in dev_dbg debug messages

"wiat" -> "wait"
"fonud" -> "found"

Signed-off-by: Colin Ian King 
---
 drivers/staging/pi433/pi433_if.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/pi433/pi433_if.c b/drivers/staging/pi433/pi433_if.c
index 1bc478a7f49e..d9328ce5ec1d 100644
--- a/drivers/staging/pi433/pi433_if.c
+++ b/drivers/staging/pi433/pi433_if.c
@@ -618,7 +618,7 @@ pi433_tx_thread(void *data)
}
 
/* we are done. Wait for packet to get sent */
-   dev_dbg(device->dev, "thread: wiat for packet to get sent/fifo 
to be empty");
+   dev_dbg(device->dev, "thread: wait for packet to get sent/fifo 
to be empty");
wait_event_interruptible(device->fifo_wait_queue,
 device->free_in_fifo == FIFO_SIZE ||
 kthread_should_stop() );
@@ -1101,7 +1101,7 @@ static int pi433_probe(struct spi_device *spi)
switch(retval)
{
case 0x24:
-   dev_dbg(>dev, "fonud pi433 (ver. 0x%x)", retval);
+   dev_dbg(>dev, "found pi433 (ver. 0x%x)", retval);
break;
default:
dev_dbg(>dev, "unknown chip version: 0x%x", 
retval);
-- 
2.11.0

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


[PATCH] staging: iio: adc: add space around substraction operation

2017-07-17 Thread Hari Prasath
Fix checkpatch warning to add space around the substraction operation

Signed-off-by: Hari Prasath 
---
 drivers/staging/iio/adc/ad7280a.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/iio/adc/ad7280a.c 
b/drivers/staging/iio/adc/ad7280a.c
index d5ab83f..d79e774 100644
--- a/drivers/staging/iio/adc/ad7280a.c
+++ b/drivers/staging/iio/adc/ad7280a.c
@@ -745,14 +745,14 @@ static irqreturn_t ad7280_event_handler(int irq, void 
*private)
 }
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_low_value,
-   in_voltage-voltage_thresh_low_value,
+   in_voltage - voltage_thresh_low_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
AD7280A_CELL_UNDERVOLTAGE);
 
 static IIO_DEVICE_ATTR_NAMED(in_thresh_high_value,
-   in_voltage-voltage_thresh_high_value,
+   in_voltage - voltage_thresh_high_value,
0644,
ad7280_read_channel_config,
ad7280_write_channel_config,
-- 
2.10.0.GIT

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


[PATCH v2] staging: unisys: visorbus: Constify attribute_group structures.

2017-07-17 Thread Arvind Yadav
attribute_group are not supposed to change at runtime. All functions
working with attribute_group provided by  work
with const attribute_group. So mark the non-const structs as const.

Signed-off-by: Arvind Yadav 
---
Changes in v2:
  Change log typo was not correct.

 drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
 drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
 2 files changed, 3 insertions(+), 3 deletions(-)

diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c 
b/drivers/staging/unisys/visorbus/visorbus_main.c
index 1c785dd..bba10dc 100644
--- a/drivers/staging/unisys/visorbus/visorbus_main.c
+++ b/drivers/staging/unisys/visorbus/visorbus_main.c
@@ -249,7 +249,7 @@ static ssize_t typename_show(struct device *dev, struct 
device_attribute *attr,
NULL
 };
 
-static struct attribute_group channel_attr_grp = {
+static const struct attribute_group channel_attr_grp = {
.name = "channel",
.attrs = channel_attrs,
 };
@@ -340,7 +340,7 @@ static ssize_t channel_id_show(struct device *dev,
NULL
 };
 
-static struct attribute_group dev_attr_grp = {
+static const struct attribute_group dev_attr_grp = {
.attrs = dev_attrs,
 };
 
diff --git a/drivers/staging/unisys/visorbus/visorchipset.c 
b/drivers/staging/unisys/visorbus/visorchipset.c
index 2215056..798a92e 100644
--- a/drivers/staging/unisys/visorbus/visorchipset.c
+++ b/drivers/staging/unisys/visorbus/visorchipset.c
@@ -1146,7 +1146,7 @@ static ssize_t deviceenabled_store(struct device *dev,
NULL
 };
 
-static struct attribute_group visorchipset_parahotplug_group = {
+static const struct attribute_group visorchipset_parahotplug_group = {
.name = "parahotplug",
.attrs = visorchipset_parahotplug_attrs
 };
-- 
1.9.1

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


[PATCH v2 1/2] staging: gs_fpgaboot: add buffer overflow checks

2017-07-17 Thread Jacob von Chorus
Four fields in struct fpgaimage are char arrays of length MAX_STR (256).
The amount of data read into these buffers is controlled by a length
field in the bitstream file read from userspace. If a corrupt or
malicious firmware file was supplied, kernel data beyond these buffers
can be overwritten arbitrarily.

This patch adds a check of the bitstream's length value to ensure it
fits within the bounds of the allocated buffers. An error condition is
returned from gs_read_bitstream if any of the reads fail.

Signed-off-by: Jacob von Chorus 
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 48 ---
 1 file changed, 37 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index 19b550fff0..008ef99f05 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -47,7 +47,7 @@ static void read_bitstream(char *bitdata, char *buf, int 
*offset, int rdsize)
*offset += rdsize;
 }
 
-static void readinfo_bitstream(char *bitdata, char *buf, int *offset)
+static int readinfo_bitstream(char *bitdata, char *buf, int size, int *offset)
 {
char tbuf[64];
s32 len;
@@ -59,9 +59,15 @@ static void readinfo_bitstream(char *bitdata, char *buf, int 
*offset)
read_bitstream(bitdata, tbuf, offset, 2);
 
len = tbuf[0] << 8 | tbuf[1];
+   if ((len + 1) > size) {
+   pr_err("error: readinfo buffer too small\n");
+   return -ETOOSMALL;
+   }
 
read_bitstream(bitdata, buf, offset, len);
buf[len] = '\0';
+
+   return 0;
 }
 
 /*
@@ -113,7 +119,7 @@ static int readmagic_bitstream(char *bitdata, int *offset)
 /*
  * NOTE: supports only bitstream format
  */
-static enum fmt_image get_imageformat(struct fpgaimage *fimage)
+static enum fmt_image get_imageformat(void)
 {
return f_bit;
 }
@@ -127,34 +133,54 @@ static void gs_print_header(struct fpgaimage *fimage)
pr_info("lendata: %d\n", fimage->lendata);
 }
 
-static void gs_read_bitstream(struct fpgaimage *fimage)
+static int gs_read_bitstream(struct fpgaimage *fimage)
 {
char *bitdata;
int offset;
+   int err;
 
offset = 0;
bitdata = (char *)fimage->fw_entry->data;
 
-   readmagic_bitstream(bitdata, );
-   readinfo_bitstream(bitdata, fimage->filename, );
-   readinfo_bitstream(bitdata, fimage->part, );
-   readinfo_bitstream(bitdata, fimage->date, );
-   readinfo_bitstream(bitdata, fimage->time, );
-   readlength_bitstream(bitdata, >lendata, );
+   err = readmagic_bitstream(bitdata, );
+   if (err)
+   return err;
+
+   err = readinfo_bitstream(bitdata, fimage->filename, MAX_STR, );
+   if (err)
+   return err;
+   err = readinfo_bitstream(bitdata, fimage->part, MAX_STR, );
+   if (err)
+   return err;
+   err = readinfo_bitstream(bitdata, fimage->date, MAX_STR, );
+   if (err)
+   return err;
+   err = readinfo_bitstream(bitdata, fimage->time, MAX_STR, );
+   if (err)
+   return err;
+
+   err = readlength_bitstream(bitdata, >lendata, );
+   if (err)
+   return err;
 
fimage->fpgadata = bitdata + offset;
+
+   return 0;
 }
 
 static int gs_read_image(struct fpgaimage *fimage)
 {
int img_fmt;
+   int err;
 
-   img_fmt = get_imageformat(fimage);
+   img_fmt = get_imageformat();
 
switch (img_fmt) {
case f_bit:
pr_info("image is bitstream format\n");
-   gs_read_bitstream(fimage);
+   err = gs_read_bitstream(fimage);
+   if (err)
+   return err;
break;
default:
pr_err("unsupported fpga image format\n");
-- 
2.11.0

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


[PATCH v2 2/2] staging: gs_fpgaboot: change char to u8

2017-07-17 Thread Jacob von Chorus
The bitstream storage variables were changed from char to u8 arrays to
prevent issues such as negative lengths. This change makes the code
compatible with the "data" field in "struct firmware" which is of type
u8.

Signed-off-by: Jacob von Chorus 
---
 drivers/staging/gs_fpgaboot/gs_fpgaboot.c | 24 
 drivers/staging/gs_fpgaboot/gs_fpgaboot.h |  2 +-
 2 files changed, 13 insertions(+), 13 deletions(-)

diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
index 008ef99f05..467a0ad81f 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.c
@@ -41,16 +41,16 @@ static char *file = "xlinx_fpga_firmware.bit";
 module_param(file, charp, 0444);
 MODULE_PARM_DESC(file, "Xilinx FPGA firmware file.");
 
-static void read_bitstream(char *bitdata, char *buf, int *offset, int rdsize)
+static void read_bitstream(u8 *bitdata, u8 *buf, int *offset, int rdsize)
 {
memcpy(buf, bitdata + *offset, rdsize);
*offset += rdsize;
 }
 
-static int readinfo_bitstream(char *bitdata, char *buf, int size, int *offset)
+static int readinfo_bitstream(u8 *bitdata, u8 *buf, int size, int *offset)
 {
-   char tbuf[64];
-   s32 len;
+   u8 tbuf[64];
+   u16 len;
 
/* read section char */
read_bitstream(bitdata, tbuf, offset, 1);
@@ -73,9 +73,9 @@ static int readinfo_bitstream(char *bitdata, char *buf, int 
size, int *offset)
 /*
  * read bitdata length
  */
-static int readlength_bitstream(char *bitdata, int *lendata, int *offset)
+static int readlength_bitstream(u8 *bitdata, int *lendata, int *offset)
 {
-   char tbuf[64];
+   u8 tbuf[64];
 
/* read section char */
read_bitstream(bitdata, tbuf, offset, 1);
@@ -98,9 +98,9 @@ static int readlength_bitstream(char *bitdata, int *lendata, 
int *offset)
 /*
  * read first 13 bytes to check bitstream magic number
  */
-static int readmagic_bitstream(char *bitdata, int *offset)
+static int readmagic_bitstream(u8 *bitdata, int *offset)
 {
-   char buf[13];
+   u8 buf[13];
int r;
 
read_bitstream(bitdata, buf, offset, 13);
@@ -135,12 +135,12 @@ static void gs_print_header(struct fpgaimage *fimage)
 
 static int gs_read_bitstream(struct fpgaimage *fimage)
 {
-   char *bitdata;
+   u8 *bitdata;
int offset;
int err;
 
offset = 0;
-   bitdata = (char *)fimage->fw_entry->data;
+   bitdata = (u8 *)fimage->fw_entry->data;
 
err = readmagic_bitstream(bitdata, );
if (err)
@@ -209,11 +209,11 @@ static int gs_load_image(struct fpgaimage *fimage, char 
*fw_file)
 
 static int gs_download_image(struct fpgaimage *fimage, enum wbus bus_bytes)
 {
-   char *bitdata;
+   u8 *bitdata;
int size, i, cnt;
 
cnt = 0;
-   bitdata = (char *)fimage->fpgadata;
+   bitdata = (u8 *)fimage->fpgadata;
size = fimage->lendata;
 
 #ifdef DEBUG_FPGA
diff --git a/drivers/staging/gs_fpgaboot/gs_fpgaboot.h 
b/drivers/staging/gs_fpgaboot/gs_fpgaboot.h
index cd1eb2c4c9..986e841f6b 100644
--- a/drivers/staging/gs_fpgaboot/gs_fpgaboot.h
+++ b/drivers/staging/gs_fpgaboot/gs_fpgaboot.h
@@ -47,5 +47,5 @@ struct fpgaimage {
chardate[MAX_STR];
chartime[MAX_STR];
int lendata;
-   char*fpgadata;
+   u8  *fpgadata;
 };
-- 
2.11.0

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


Re: [PATCH v2 2/2] staging: gs_fpgaboot: change char to u8

2017-07-17 Thread Jacob von Chorus
On Mon, Jul 17, 2017 at 06:22:08PM -0700, Joe Perches wrote:
> read_bitstream takes an int rdsize, not a u16.
> and this function will overflow tbuf if len > 64
>
> static void readinfo_bitstream(char *bitdata, char *buf, int *offset)
> {
>   char tbuf[64];
>   s32 len;
> 
>   /* read section char */
>   read_bitstream(bitdata, tbuf, offset, 1);
> 
>   /* read length */
>   read_bitstream(bitdata, tbuf, offset, 2);
> 
>   len = tbuf[0] << 8 | tbuf[1];
> 
>   read_bitstream(bitdata, buf, offset, len);
>   buf[len] = '\0';
> }
> 
> len is up to 64k but tbuf is 64 bytes.

tbuf is used here to read a total of 3 bytes over two calls to
read_bitstream. The larger read of size, len, is stored to buf which is
MAX_STR bytes in length. 

>   len = get_unaligned_le16(tbuf)
> 
> might be nicer than
> 
>   len = tbuf[0] << 8 | tbuf[1];

Agreed, though it should be "get_unaligned_be16". 

Thanks.

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


Re: [patch 0/3] Re: tty contention resulting from tty_open_by_device export

2017-07-17 Thread Alan Cox

> Sure. I can fix the tty->count mismatch based on Alan's suggestion. However I 
> don't understand why the exclusivity flag should belong to tty_port and not 
> tty_struct. It will be good to know why. 

We are trying to move all the flags that we can and structs into the
tty_port, except any that are used internally within the struct tty
level code. The main reason for this is to make the object lifetimes and
locking simpler - because the tty_port lasts for the time the hardware is
present.

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


Re: [PATCH 14/14] [media] fix warning on v4l2_subdev_call() result interpreted as bool

2017-07-17 Thread Arnd Bergmann
On Mon, Jul 17, 2017 at 4:35 PM, Hans Verkuil  wrote:
> On 17/07/17 16:26, Arnd Bergmann wrote:

>> Let me try again without ccache for now and see what warnings remain.
>> We can find a solution for those first, and then decide how to deal with
>> ccache.
>
> Sounds good.
>
> I'm OK with applying this if there is no other way to prevent these warnings.

Small update: I noticed that having ccache being the default compiler
even with CCACHE_DISABLE=1 causes a lot of these warnings. Completely
taking ccache out of the picture however seems to have eliminated the
warnings about v4l2_subdev_call() and other silly warnings, but not
the interesting ones in the -Wint-in-bool-context category.

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


Re: [PATCH v2 2/2] staging: atomisp2: hmm: Alignment code (rebased)

2017-07-17 Thread Sakari Ailus
On Thu, Jul 13, 2017 at 09:26:50PM +0200, Philipp wrote:
> 
> > On 13. Jul 2017, at 17:45, Sakari Ailus  wrote:
> > 
> > On Thu, Jul 13, 2017 at 08:55:43AM +0200, Philipp Guendisch wrote:
> >> This patch fixed code alignment to open paranthesis.
> >> Semantic should not be affected by this patch.
> >> 
> >> It has been rebased on top of media_tree atomisp branch
> >> 
> >> Signed-off-by: Philipp Guendisch 
> >> Signed-off-by: Chris Baller 
> > 
> > Hi Philipp,
> > 
> > Neither of the patches still applies?
> > 
> > Are you sure you rebased them on the atomisp branch?
> > 
> > -- 
> > Regards,
> > 
> > Sakari Ailus
> > e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
> 
> Hi Ailus,
> 
> Unfortunately I dont know exactly why the patches did not apply.
> 
> I tried a rebase with:
> 
> "git remote add sailus-mediatree git://linuxtv.org/sailus/media_tree.git 
> 
> git fetch sailus-mediatree
> git checkout atomisp”
> 
> Maybe I took too much time for rebasing and some patches were accepted 
> between my ‘git pull’ and 'git send-email'
> 
> I did another git pull right now and have seen the pathches are already in 
> the commit history.
> 
> So I think it's time to give you a huge THANK YOU!

You're welcome, and thank you for the cleanup patches!

This was my mistake actually; I thought the patches didn't apply but I
ended up trying to apply them... twice. That's what you get when you have
too many atomisp patches. :-o

> 
> If I got it wrong and threre is still some work to do for the two patches 
> please let me know 
> and I will try to fix it.
> 
> PS: I am totally new to kernel development yet.

Cleanup patches are a really good way to start, besides fixing small issues
here and there. :-)

-- 
Kind regards,

Sakari Ailus
e-mail: sakari.ai...@iki.fi XMPP: sai...@retiisi.org.uk
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


RE: [PATCH] staging: unisys: visorbus: constify attribute_group structures.

2017-07-17 Thread Kershner, David A
> -Original Message-
> From: Greg KH [mailto:g...@kroah.com]
> Sent: Monday, July 17, 2017 8:38 AM
> To: Arvind Yadav 
> Cc: Kershner, David A ; Sell, Timothy C
> ; Thompson, Bryan E.
> ; jon.fri...@unisys.com; Binder, David
> Anthony ; *S-Par-Maintainer
> ; de...@driverdev.osuosl.org; linux-
> ker...@vger.kernel.org
> Subject: Re: [PATCH] staging: unisys: visorbus: constify attribute_group
> structures.
> 
> On Mon, Jul 17, 2017 at 05:43:14PM +0530, Arvind Yadav wrote:
> > Hi Greg,
> >
> >
> > On Monday 17 July 2017 04:15 PM, Greg KH wrote:
> > > On Mon, Jul 17, 2017 at 02:55:37PM +0530, Arvind Yadav wrote:
> > > > attribute_groups are not supposed to change at runtime. All functions
> > > > working with attribute_groups provided by  work
> > > > with const attribute_group. So mark the non-const structs as const.
> > > >
> > > > Signed-off-by: Arvind Yadav 
> > > > ---
> > > >   drivers/staging/unisys/visorbus/visorbus_main.c | 4 ++--
> > > >   drivers/staging/unisys/visorbus/visorchipset.c  | 2 +-
> > > >   2 files changed, 3 insertions(+), 3 deletions(-)
> > > Why not just use the ATTRIBUTE_GROUPS() macro for these?  Or is there
> > > something that is preventing that?
> > Yes, we can use. if we are only initializing '.attrs'.
> > ATTRIBUTE_GROUPS() will not work if we will initialize other member of
> > attribute_group like 'bin_attrs', 'is_visible', and  'name'.
> 
> That means you should redo this patch :)
> 
> Also, your changelog text had a typo, it is "attribute_group", not
> "attribute_groups".
> 

Greg, are you recommending that we shouldn't be setting the attribute_group
.name field? What does it pick up if we don't specify it?

Also, for our attribute_groups in visorchipset, we are defining it with two
different attribute_group variables. Are you allowed to use two different
attribute_group variables in an attribute_groups, or is this frowned upon and
we should flatten it out to just one? An example that we used in the kernel was:

static const struct attribute_group *l2_cache_pmu_attr_grps[] = {
_cache_pmu_format_group,
_cache_pmu_cpumask_group,
NULL,
};

Thanks,
David Kershner

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


Re: [PATCH 1/1] drivers/staging/pi433: New driver

2017-07-17 Thread kbuild test robot
Hi Marcus,

[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.13-rc1 next-20170714]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Wolf-Entwicklungen/drivers-staging-pi433-New-driver/20170716-181617
reproduce:
# apt-get install sparse
make ARCH=x86_64 allmodconfig
make C=1 CF=-D__CHECK_ENDIAN__


sparse warnings: (new ones prefixed by >>)

   include/linux/compiler.h:260:8: sparse: attribute 'no_sanitize_address': 
unknown attribute
>> drivers/staging/pi433/pi433_if.c:1155:36: sparse: incompatible types for 
>> operation (<)
   drivers/staging/pi433/pi433_if.c:1155:36:left side has type struct 
task_struct *tx_task_struct
   drivers/staging/pi433/pi433_if.c:1155:36:right side has type int

vim +1155 drivers/staging/pi433/pi433_if.c

  1072  
  1073  static int pi433_probe(struct spi_device *spi)
  1074  {
  1075  struct pi433_device *device;
  1076  int retval;
  1077  
  1078  /* setup spi parameters */
  1079  spi->mode = 0x00;
  1080  spi->bits_per_word = 8;
  1081  /* spi->max_speed_hz = 1000;  1MHz already set by device 
tree overlay */
  1082  
  1083  retval = spi_setup(spi);
  1084  if (retval)
  1085  {
  1086  dev_dbg(>dev, "configuration of SPI interface 
failed!\n");
  1087  return retval;
  1088  }
  1089  else
  1090  {
  1091  dev_dbg(>dev,
  1092  "spi interface setup: mode 0x%2x, %d bits per 
word, %dhz max speed",
  1093  spi->mode, spi->bits_per_word, 
spi->max_speed_hz);
  1094  }
  1095  
  1096  /* Ping the chip by reading the version register */
  1097  retval = spi_w8r8(spi, 0x10);
  1098  if (retval < 0)
  1099  return retval;
  1100  
  1101  switch(retval)
  1102  {
  1103  case 0x24:
  1104  dev_dbg(>dev, "fonud pi433 (ver. 0x%x)", 
retval);
  1105  break;
  1106  default:
  1107  dev_dbg(>dev, "unknown chip version: 
0x%x", retval);
  1108  return -ENODEV;
  1109  }
  1110  
    /* Allocate driver data */
  1112  device = kzalloc(sizeof(*device), GFP_KERNEL);
  1113  if (!device)
  1114  return -ENOMEM;
  1115  
  1116  /* Initialize the driver data */
  1117  device->spi = spi;
  1118  device->rx_active = false;
  1119  device->tx_active = false;
  1120  device->interrupt_rx_allowed = false;
  1121  
  1122  /* init wait queues */
  1123  init_waitqueue_head(>tx_wait_queue);
  1124  init_waitqueue_head(>rx_wait_queue);
  1125  init_waitqueue_head(>fifo_wait_queue);
  1126  
  1127  /* init fifo */
  1128  INIT_KFIFO(device->tx_fifo);
  1129  
  1130  /* init mutexes and locks */
  1131  mutex_init(>tx_fifo_lock);
  1132  mutex_init(>rx_lock);
  1133  
  1134  /* setup GPIO (including irq_handler) for the different DIOs */
  1135  retval = setup_GPIOs(device);
  1136  if (retval)
  1137  {
  1138  dev_dbg(>dev, "setup of GPIOs failed");
  1139  goto GPIO_failed;
  1140  }
  1141  
  1142  /* setup the radio module */
  1143  SET_CHECKED(rf69_set_mode   (spi, standby));
  1144  SET_CHECKED(rf69_set_data_mode  (spi, packet));
  1145  SET_CHECKED(rf69_set_amplifier_0(spi, optionOn));
  1146  SET_CHECKED(rf69_set_amplifier_1(spi, optionOff));
  1147  SET_CHECKED(rf69_set_amplifier_2(spi, optionOff));
  1148  SET_CHECKED(rf69_set_output_power_level (spi, 13));
  1149  SET_CHECKED(rf69_set_antenna_impedance  (spi, fiftyOhm));
  1150  
  1151  /* start tx thread */
  1152  device->tx_task_struct = kthread_run(pi433_tx_thread,
  1153   device,
  1154   "pi433_tx_task");
> 1155  if (device->tx_task_struct < 0)
  1156  {
  1157  dev_dbg(device->dev, "start of send thread failed");
  1158  goto send_thread_failed;
  1159  }
  1160  
  1161  /* determ minor number */
  1162  retval = pi433_get_minor(device);
  1163  if (retval)
  1164  {
  1165  dev_dbg(device->dev, "get of minor number failed");
  1166  goto minor_failed;
  1167  }
  1168  
  1169  /* create device */
  1170  device->devt = MKDEV(MAJOR(pi433_dev), device->minor);
  1171 

Re: [PATCH v9 03/10] x86/hyper-v: make hv_do_hypercall() inline

2017-07-17 Thread kbuild test robot
Hi Vitaly,

[auto build test ERROR on linus/master]
[also build test ERROR on v4.13-rc1 next-20170717]
[cannot apply to tip/x86/core]
[if your patch is applied to the wrong git tree, please drop us a note to help 
improve the system]

url:
https://github.com/0day-ci/linux/commits/Vitaly-Kuznetsov/Hyper-V-paravirtualized-remote-TLB-flushing-and-hypercall-improvements/20170715-023027
config: x86_64-rhel (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
# save the attached .config to linux build tree
make ARCH=x86_64 

Note: the 
linux-review/Vitaly-Kuznetsov/Hyper-V-paravirtualized-remote-TLB-flushing-and-hypercall-improvements/20170715-023027
 HEAD ac9354b5afdbfbc99257e73a7b3af517ea8ebb91 builds fine.
  It only hurts bisectibility.

All errors (new ones prefixed by >>):

   In file included from arch/x86/hyperv/hv_init.c:23:0:
   arch/x86/include/asm/mshyperv.h: In function 'hv_do_hypercall':
>> arch/x86/include/asm/mshyperv.h:177:30: error: implicit declaration of 
>> function 'virt_to_phys' [-Werror=implicit-function-declaration]
 u64 input_address = input ? virt_to_phys(input) : 0;
 ^~~~
   In file included from arch/x86/include/asm/realmode.h:5:0,
from arch/x86/include/asm/acpi.h:33,
from arch/x86/include/asm/fixmap.h:19,
from arch/x86/include/asm/apic.h:10,
from arch/x86/include/asm/smp.h:12,
from arch/x86/include/asm/mmzone_64.h:10,
from arch/x86/include/asm/mmzone.h:4,
from include/linux/mmzone.h:912,
from include/linux/gfp.h:5,
from include/linux/mm.h:9,
from arch/x86/hyperv/hv_init.c:26:
   arch/x86/include/asm/io.h: At top level:
>> arch/x86/include/asm/io.h:118:27: error: conflicting types for 'virt_to_phys'
static inline phys_addr_t virt_to_phys(volatile void *address)
  ^~~~
   In file included from arch/x86/hyperv/hv_init.c:23:0:
   arch/x86/include/asm/mshyperv.h:177:30: note: previous implicit declaration 
of 'virt_to_phys' was here
 u64 input_address = input ? virt_to_phys(input) : 0;
 ^~~~
   cc1: some warnings being treated as errors

vim +/virt_to_phys +177 arch/x86/include/asm/mshyperv.h

   174  
   175  static inline u64 hv_do_hypercall(u64 control, void *input, void 
*output)
   176  {
 > 177  u64 input_address = input ? virt_to_phys(input) : 0;
   178  u64 output_address = output ? virt_to_phys(output) : 0;
   179  u64 hv_status;
   180  register void *__sp asm(_ASM_SP);
   181  

---
0-DAY kernel test infrastructureOpen Source Technology Center
https://lists.01.org/pipermail/kbuild-all   Intel Corporation


.config.gz
Description: application/gzip
___
devel mailing list
de...@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel


<    1   2