Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1207451 > unrolled thread

[PATCHv6 0/5] Staging: most: several warnings fix reported by sparse

Started byAdrian Remonda <adrianremonda@gmail.com>
First post2015-08-14 11:50 +0200
Last post2015-08-14 11:50 +0200
Articles 3 — 1 participant

Back to article view | Back to linux.kernel


Contents

  [PATCHv6 0/5] Staging: most: several warnings fix reported by sparse Adrian Remonda <adrianremonda@gmail.com> - 2015-08-14 11:50 +0200
    [PATCHv6 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-14 11:50 +0200
    [PATCHv6 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings Adrian Remonda <adrianremonda@gmail.com> - 2015-08-14 11:50 +0200

#1207451 — [PATCHv6 0/5] Staging: most: several warnings fix reported by sparse

FromAdrian Remonda <adrianremonda@gmail.com>
Date2015-08-14 11:50 +0200
Subject[PATCHv6 0/5] Staging: most: several warnings fix reported by sparse
Message-ID<pXjMD-6Km-13@gated-at.bofh.it>
This patch series fix several warnings reported by the Sparse tool

       v2: Fixed patch format and comments as noted by 
		Greg Kroah-Hartman and clear a few more warnings
       v3: Fixed patch format as noted by Greg Kroah-Hartman
       v4: Fixed patch format as noted by Greg Kroah-Hartman
       v5: Because of using a non-updated tree previously two 
       patches did not apply
       v6: Clear warnings and styling issues

Adrian Remonda (5):
  Staging: most: mostcore/core.c. Fix "missing static keyword" warnings
  Staging: most: mostcore/core.c. Fix "Using plain integer as NULL
    pointer" warnings
  Staging: most: hdm-usb/hdm_usb.c. Fix "missing static keyword"
    warnings
  Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL
    pointer" warnings
  Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings

 drivers/staging/most/aim-cdev/cdev.c     | 18 +++++++++---------
 drivers/staging/most/hdm-dim2/dim2_hal.c |  2 +-
 drivers/staging/most/hdm-usb/hdm_usb.c   | 16 ++++++++--------
 drivers/staging/most/mostcore/core.c     | 17 +++++++++--------
 4 files changed, 27 insertions(+), 26 deletions(-)

-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [next] | [standalone]


#1207452 — [PATCHv6 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings

FromAdrian Remonda <adrianremonda@gmail.com>
Date2015-08-14 11:50 +0200
Subject[PATCHv6 5/5] Staging: most: aim-cdev/cdev.c. Fix "missing static keyword" warnings
Message-ID<pXjME-6Km-31@gated-at.bofh.it>
In reply to#1207451
This is a patch to the most/aim_cdev.c file. It makes several
local functions and structures static to prevent global visibility.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
---
 drivers/staging/most/aim-cdev/cdev.c | 18 +++++++++---------
 1 file changed, 9 insertions(+), 9 deletions(-)

diff --git a/drivers/staging/most/aim-cdev/cdev.c b/drivers/staging/most/aim-cdev/cdev.c
index 252a17cf153c..0a13d8d0fa39 100644
--- a/drivers/staging/most/aim-cdev/cdev.c
+++ b/drivers/staging/most/aim-cdev/cdev.c
@@ -49,7 +49,7 @@ static struct list_head channel_list;
 static spinlock_t ch_list_lock;
 
 
-struct aim_channel *get_channel(struct most_interface *iface, int id)
+static struct aim_channel *get_channel(struct most_interface *iface, int id)
 {
 	struct aim_channel *channel, *tmp;
 	unsigned long flags;
@@ -289,7 +289,7 @@ static const struct file_operations channel_fops = {
  * This frees allocated memory and removes the cdev that represents this
  * channel in user space.
  */
-int aim_disconnect_channel(struct most_interface *iface, int channel_id)
+static int aim_disconnect_channel(struct most_interface *iface, int channel_id)
 {
 	struct aim_channel *channel;
 	unsigned long flags;
@@ -329,7 +329,7 @@ int aim_disconnect_channel(struct most_interface *iface, int channel_id)
  * This searches for the channel linked to this MBO and stores it in the local
  * fifo buffer.
  */
-int aim_rx_completion(struct mbo *mbo)
+static int aim_rx_completion(struct mbo *mbo)
 {
 	struct aim_channel *channel;
 
@@ -356,7 +356,7 @@ int aim_rx_completion(struct mbo *mbo)
  *
  * This wakes sleeping processes in the wait-queue.
  */
-int aim_tx_completion(struct most_interface *iface, int channel_id)
+static int aim_tx_completion(struct most_interface *iface, int channel_id)
 {
 	struct aim_channel *channel;
 
@@ -376,7 +376,7 @@ int aim_tx_completion(struct most_interface *iface, int channel_id)
 	return 0;
 }
 
-struct most_aim cdev_aim;
+static struct most_aim cdev_aim;
 
 /**
  * aim_probe - probe function of the driver module
@@ -390,9 +390,9 @@ struct most_aim cdev_aim;
  *
  * Returns 0 on success or error code otherwise.
  */
-int aim_probe(struct most_interface *iface, int channel_id,
-	      struct most_channel_config *cfg,
-	      struct kobject *parent, char *name)
+static int aim_probe(struct most_interface *iface, int channel_id,
+		     struct most_channel_config *cfg,
+		     struct kobject *parent, char *name)
 {
 	struct aim_channel *channel;
 	unsigned long cl_flags;
@@ -463,7 +463,7 @@ error_alloc_channel:
 	return retval;
 }
 
-struct most_aim cdev_aim = {
+static struct most_aim cdev_aim = {
 	.name = "cdev",
 	.probe_channel = aim_probe,
 	.disconnect_channel = aim_disconnect_channel,
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [next] | [standalone]


#1207453 — [PATCHv6 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings

FromAdrian Remonda <adrianremonda@gmail.com>
Date2015-08-14 11:50 +0200
Subject[PATCHv6 4/5] Staging: most: hdm-dim2/dim2_hal.c. Fix "Using plain integer as NULL pointer" warnings
Message-ID<pXjME-6Km-29@gated-at.bofh.it>
In reply to#1207451
This patch fixes the warning generated by sparse: "Using plain integer
as NULL pointer" by replacing the offending 0 with NULL.

Signed-off-by: Adrian Remonda <adrianremonda@gmail.com>
---
 drivers/staging/most/hdm-dim2/dim2_hal.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/most/hdm-dim2/dim2_hal.c b/drivers/staging/most/hdm-dim2/dim2_hal.c
index 01b748944ee4..a54cf2cedac3 100644
--- a/drivers/staging/most/hdm-dim2/dim2_hal.c
+++ b/drivers/staging/most/hdm-dim2/dim2_hal.c
@@ -889,7 +889,7 @@ struct dim_ch_state_t *DIM_GetChannelState(struct dim_channel *ch,
 		struct dim_ch_state_t *state_ptr)
 {
 	if (!ch || !state_ptr)
-		return 0;
+		return NULL;
 
 	state_ptr->ready = ch->state.level < 2;
 	state_ptr->done_buffers = ch->done_sw_buffers_number;
-- 
2.1.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[toc] | [prev] | [standalone]


Back to top | Article view | linux.kernel


csiph-web