Re: [PATCH] Staging: iio: Fix sparse endian warning
Hi Ksenija, Greg, On Wed, Mar 23, 2016 at 12:06 PM, Ksenija Stanojevic wrote: > Fix following sparse warning: > warning: cast to restricted __be16 Please include line number information so we know which line sparse complains about. > Signed-off-by: Ksenija Stanojevic > --- > drivers/staging/iio/adc/ad7606_spi.c | 5 +++-- > 1 file changed, 3 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/iio/adc/ad7606_spi.c > b/drivers/staging/iio/adc/ad7606_spi.c > index d873a51..825da07 100644 > --- a/drivers/staging/iio/adc/ad7606_spi.c > +++ b/drivers/staging/iio/adc/ad7606_spi.c > @@ -21,7 +21,8 @@ static int ad7606_spi_read_block(struct device *dev, > { > struct spi_device *spi = to_spi_device(dev); > int i, ret; > - unsigned short *data = buf; > + unsigned short *data; > + __be16 *bdata = buf; > > ret = spi_read(spi, buf, count * 2); > if (ret < 0) { > @@ -30,7 +31,7 @@ static int ad7606_spi_read_block(struct device *dev, > } > > for (i = 0; i < count; i++) > - data[i] = be16_to_cpu(data[i]); > + data[i] = be16_to_cpu(bdata[i]); This patch is completely bogus: drivers/staging/iio/adc/ad7606_spi.c: In function ‘ad7606_spi_read_block’: drivers/staging/iio/adc/ad7606_spi.c:34: warning: ‘data’ is used uninitialized in this function Hence please revert commit 87787e5ef727ff15f7c552cc48823b469f2eb41b Author: Ksenija Stanojevic Date: Wed Mar 23 12:06:34 2016 +0100 Staging: iio: Fix sparse endian warning BTW, what version of sparse are you using? My (Ubuntu) version of sparse didn't complain about the original, neither does the one I've just cloned from the master repository (v0.5.0-44-g40791b94c56b1a6d)? Hence I have no idea if fixing this by keeping the assignment of buf to data is warned about Gr{oetje,eeting}s, Geert -- Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- ge...@linux-m68k.org In personal conversations with technical people, I call myself a hacker. But when I'm talking to journalists I just say "programmer" or something like that. -- Linus Torvalds ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 01/54] MAINTAINERS: Add file patterns for ion device tree bindings
Submitters of device tree binding documentation may forget to CC the subsystem maintainer if this is missing. Signed-off-by: Geert Uytterhoeven Cc: Laura Abbott Cc: Sumit Semwal Cc: de...@driverdev.osuosl.org --- Please apply this patch directly if you want to be involved in device tree binding documentation for your subsystem. --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index 283f35b6be6907f5..6b4b2447589f36fa 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -781,6 +781,7 @@ M: Laura Abbott M: Sumit Semwal L: de...@driverdev.osuosl.org S: Supported +F: Documentation/devicetree/bindings/staging/ion/ F: drivers/staging/android/ion F: drivers/staging/android/uapi/ion.h F: drivers/staging/android/uapi/ion_test.h -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] rtlwifi: Fix scheduling while atomic error from commit 49f86ec21c01
On 05/22/2016 12:53 AM, Kalle Valo wrote: Larry Finger writes: Commit 49f86ec21c01 ("rtlwifi: Change long delays to sleeps") was correct for most cases; however, driver rtl8192ce calls the affected routines while in atomic context. The kernel bug output is as follows: BUG: scheduling while atomic: wpa_supplicant/627/0x0002 [...] [] __schedule+0x899/0xad0 [] schedule+0x3c/0x90 [] schedule_hrtimeout_range_clock+0xa2/0x120 [] ? hrtimer_init+0x120/0x120 [] ? schedule_hrtimeout_range_clock+0x96/0x120 [] schedule_hrtimeout_range+0x13/0x20 [] usleep_range+0x4f/0x70 [] rtl_rfreg_delay+0x38/0x50 [rtlwifi] [] rtl92c_phy_config_rf_with_headerfile+0xc7/0xe0 [rtl8192ce] To fix this bug, three of the changes from delay to sleep are reverted. Unfortunately, one of the changes involves a delay of 50 msec. The calling code will be modified so that this long delay can be avoided; however, this change is being pushed now to fix the problem in kernel 4.6.0. Fixes: 49f86ec21c01 ("rtlwifi: Change long delays to sleeps") Reported-by: James Feeney Signed-off-by: Larry Finger Cc: James Feeney Cc: Stable [4.6+] I'm planning to queue this to 4.7. That will be good as it will be ported to 4.6 quickly after that. Larry ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: android: modify memory allocation style in ion_cma_heap.c
Modify memory allocation style in ion_cma_heap.c in order to silence a checkpatch.pl warning Signed-off-by: Ben Marsh --- drivers/staging/android/ion/ion_cma_heap.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/staging/android/ion/ion_cma_heap.c b/drivers/staging/android/ion/ion_cma_heap.c index a3446da..73fae81 100644 --- a/drivers/staging/android/ion/ion_cma_heap.c +++ b/drivers/staging/android/ion/ion_cma_heap.c @@ -57,7 +57,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, if (align > PAGE_SIZE) return -EINVAL; - info = kzalloc(sizeof(struct ion_cma_buffer_info), GFP_KERNEL); + info = kzalloc(sizeof(*info), GFP_KERNEL); if (!info) return ION_CMA_ALLOCATE_FAILED; @@ -69,7 +69,7 @@ static int ion_cma_allocate(struct ion_heap *heap, struct ion_buffer *buffer, goto err; } - info->table = kmalloc(sizeof(struct sg_table), GFP_KERNEL); + info->table = kmalloc(sizeof(*info->table), GFP_KERNEL); if (!info->table) goto free_mem; @@ -174,7 +174,7 @@ struct ion_heap *ion_cma_heap_create(struct ion_platform_heap *data) { struct ion_cma_heap *cma_heap; - cma_heap = kzalloc(sizeof(struct ion_cma_heap), GFP_KERNEL); + cma_heap = kzalloc(sizeof(*cma_heap), GFP_KERNEL); if (!cma_heap) return ERR_PTR(-ENOMEM); -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: llite: kzalloc/copy_to_user to memdup_user
kzalloc call followed by copy_to_user can be replaced by call to memdup_user. Signed-off-by: Tobin C Harding --- drivers/gpu/drm/gma500/gma_display.c | 2 +- drivers/staging/lustre/lustre/llite/dir.c | 22 +++--- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index 5bf765d..8a1fb25 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -285,7 +285,7 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode) /* Wait for vblank for the disable to take effect */ gma_wait_for_vblank(dev); - +l /* Disable plane */ temp = REG_READ(map->cntr); if ((temp & DISPLAY_PLANE_ENABLE) != 0) { diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 4b00d1a..b0eb102 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1076,19 +1076,14 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp, void *copy; int rc; - copy = kzalloc(size, GFP_NOFS); - if (!copy) - return -ENOMEM; - - if (copy_from_user(copy, data, size)) { - rc = -EFAULT; + copy = memdup_user(data, size); + if (IS_ERR(copy)) { + rc = PTR_ERR(copy); goto out; } rc = obd_iocontrol(cmd, exp, size, copy, NULL); out: - kfree(copy); - return rc; } @@ -1689,12 +1684,9 @@ out_poll: case LL_IOC_QUOTACTL: { struct if_quotactl *qctl; - qctl = kzalloc(sizeof(*qctl), GFP_NOFS); - if (!qctl) - return -ENOMEM; - - if (copy_from_user(qctl, (void __user *)arg, sizeof(*qctl))) { - rc = -EFAULT; + qctl = memdup_user((void __user *)arg, sizeof(*qctl)); + if (IS_ERR(qctl)) { + rc = PTR_ERR(qctl); goto out_quotactl; } @@ -1704,8 +1696,8 @@ out_poll: sizeof(*qctl))) rc = -EFAULT; -out_quotactl: kfree(qctl); +out_quotactl: return rc; } case OBD_IOC_GETDTNAME: -- 2.8.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] staging: lustre: llite: kzalloc/copy_to_user to memdup_user
kzalloc call followed by copy_to_user can be replaced by call to memdup_user. Signed-off-by: Tobin C Harding --- drivers/gpu/drm/gma500/gma_display.c | 2 +- drivers/staging/lustre/lustre/llite/dir.c | 22 +++--- 2 files changed, 8 insertions(+), 16 deletions(-) diff --git a/drivers/gpu/drm/gma500/gma_display.c b/drivers/gpu/drm/gma500/gma_display.c index 5bf765d..8a1fb25 100644 --- a/drivers/gpu/drm/gma500/gma_display.c +++ b/drivers/gpu/drm/gma500/gma_display.c @@ -285,7 +285,7 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode) /* Wait for vblank for the disable to take effect */ gma_wait_for_vblank(dev); - +l /* Disable plane */ temp = REG_READ(map->cntr); if ((temp & DISPLAY_PLANE_ENABLE) != 0) { diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 4b00d1a..b0eb102 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1076,19 +1076,14 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp, void *copy; int rc; - copy = kzalloc(size, GFP_NOFS); - if (!copy) - return -ENOMEM; - - if (copy_from_user(copy, data, size)) { - rc = -EFAULT; + copy = memdup_user(data, size); + if (IS_ERR(copy)) { + rc = PTR_ERR(copy); goto out; } rc = obd_iocontrol(cmd, exp, size, copy, NULL); out: - kfree(copy); - return rc; } @@ -1689,12 +1684,9 @@ out_poll: case LL_IOC_QUOTACTL: { struct if_quotactl *qctl; - qctl = kzalloc(sizeof(*qctl), GFP_NOFS); - if (!qctl) - return -ENOMEM; - - if (copy_from_user(qctl, (void __user *)arg, sizeof(*qctl))) { - rc = -EFAULT; + qctl = memdup_user((void __user *)arg, sizeof(*qctl)); + if (IS_ERR(qctl)) { + rc = PTR_ERR(qctl); goto out_quotactl; } @@ -1704,8 +1696,8 @@ out_poll: sizeof(*qctl))) rc = -EFAULT; -out_quotactl: kfree(qctl); +out_quotactl: return rc; } case OBD_IOC_GETDTNAME: -- 2.8.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: llite: kzalloc/copy_to_user to memdup_user
On Mon, May 23, 2016 at 07:49:29AM +1000, Tobin C Harding wrote: > kzalloc call followed by copy_to_user can be replaced by call to memdup_user. > > Signed-off-by: Tobin C Harding Why did you send this twice? > --- > drivers/gpu/drm/gma500/gma_display.c | 2 +- > drivers/staging/lustre/lustre/llite/dir.c | 22 +++--- > 2 files changed, 8 insertions(+), 16 deletions(-) > > diff --git a/drivers/gpu/drm/gma500/gma_display.c > b/drivers/gpu/drm/gma500/gma_display.c > index 5bf765d..8a1fb25 100644 > --- a/drivers/gpu/drm/gma500/gma_display.c > +++ b/drivers/gpu/drm/gma500/gma_display.c > @@ -285,7 +285,7 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode) > > /* Wait for vblank for the disable to take effect */ > gma_wait_for_vblank(dev); > - > +l What? What does this have to do with lustre? It's kind of obvious you didn't build this :( Please be more careful in the future. greg k-h ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH v2] staging: lustre: llite: kzalloc/copy_to_user to memdup_user
kzalloc call followed by copy_to_user can be replaced by call to memdup_user. Signed-off-by: Tobin C Harding --- drivers/staging/lustre/lustre/llite/dir.c | 12 +++- 1 file changed, 3 insertions(+), 9 deletions(-) diff --git a/drivers/staging/lustre/lustre/llite/dir.c b/drivers/staging/lustre/lustre/llite/dir.c index 4b00d1a..85c50e0 100644 --- a/drivers/staging/lustre/lustre/llite/dir.c +++ b/drivers/staging/lustre/lustre/llite/dir.c @@ -1076,17 +1076,11 @@ static int copy_and_ioctl(int cmd, struct obd_export *exp, void *copy; int rc; - copy = kzalloc(size, GFP_NOFS); - if (!copy) - return -ENOMEM; - - if (copy_from_user(copy, data, size)) { - rc = -EFAULT; - goto out; - } + copy = memdup_user(data, size); + if (IS_ERR(copy)) + return PTR_ERR(copy); rc = obd_iocontrol(cmd, exp, size, copy, NULL); -out: kfree(copy); return rc; -- 2.8.2 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] staging: lustre: llite: kzalloc/copy_to_user to memdup_user
On Sun, May 22, 2016 at 03:25:38PM -0700, Greg Kroah-Hartman wrote: > On Mon, May 23, 2016 at 07:49:29AM +1000, Tobin C Harding wrote: > > kzalloc call followed by copy_to_user can be replaced by call to > > memdup_user. > > > > Signed-off-by: Tobin C Harding > > Why did you send this twice? Because I'm a git send-email amateur. > > --- > > drivers/gpu/drm/gma500/gma_display.c | 2 +- > > drivers/staging/lustre/lustre/llite/dir.c | 22 +++--- > > 2 files changed, 8 insertions(+), 16 deletions(-) > > > > diff --git a/drivers/gpu/drm/gma500/gma_display.c > > b/drivers/gpu/drm/gma500/gma_display.c > > index 5bf765d..8a1fb25 100644 > > --- a/drivers/gpu/drm/gma500/gma_display.c > > +++ b/drivers/gpu/drm/gma500/gma_display.c > > @@ -285,7 +285,7 @@ void gma_crtc_dpms(struct drm_crtc *crtc, int mode) > > > > /* Wait for vblank for the disable to take effect */ > > gma_wait_for_vblank(dev); > > - > > +l > > What? What does this have to do with lustre? Turns out I'm a git amateur in general, the gma_display changes should not have been committed on this branch. > It's kind of obvious you didn't build this :( Epic fail. > Please be more careful in the future. > > greg k-h I am humbly attempting to learn the way of kernel dev, thank you for your patience, I will endeavor to be more careful. Regards, Tobin Harding. ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
Re: [PATCH] Staging: android: ion: fixed 2 over 80 character lines in ion.c
Apologies on double email if you received two, bash said there were issues, just wanted to make sure all was good. -- Liam Murphy Web Design, Open Source. l...@lpmdesigns.com On Sun, May 22, 2016, at 04:42 PM, Liam Murphy wrote: > Assuming we wish to keep at 80 characters or less still. > checkpatch.pl gave off 2 warnings for ion.c for over 80 character lines. > Fixed > > Signed-off-by: Liam Murphy > --- > drivers/staging/android/ion/ion.c | 6 -- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/drivers/staging/android/ion/ion.c > b/drivers/staging/android/ion/ion.c > index a2cf93b..51e9774 100644 > --- a/drivers/staging/android/ion/ion.c > +++ b/drivers/staging/android/ion/ion.c > @@ -551,7 +551,8 @@ struct ion_handle *ion_alloc(struct ion_client > *client, size_t len, > } > EXPORT_SYMBOL(ion_alloc); > > -static void ion_free_nolock(struct ion_client *client, struct ion_handle > *handle) > +static void ion_free_nolock(struct ion_client *client, > + struct ion_handle *handle) > { > bool valid_handle; > > @@ -1358,7 +1359,8 @@ static long ion_ioctl(struct file *filp, unsigned > int cmd, unsigned long arg) > struct ion_handle *handle; > > mutex_lock(&client->lock); > - handle = ion_handle_get_by_id_nolock(client, > data.handle.handle); > + handle = ion_handle_get_by_id_nolock(client, > + data.handle.handle); > if (IS_ERR(handle)) { > mutex_unlock(&client->lock); > return PTR_ERR(handle); > -- > 2.8.2 > ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH] Staging: android: fix coding style warning
From: Jaime Arrocha Fixed checkpatch.pl warning about 'line over 80 characters'. Signed-off-by: Jaime Arrocha --- drivers/staging/android/ion/ion.c | 6 -- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/drivers/staging/android/ion/ion.c b/drivers/staging/android/ion/ion.c index a2cf93b..44b3874 100644 --- a/drivers/staging/android/ion/ion.c +++ b/drivers/staging/android/ion/ion.c @@ -551,7 +551,8 @@ struct ion_handle *ion_alloc(struct ion_client *client, size_t len, } EXPORT_SYMBOL(ion_alloc); -static void ion_free_nolock(struct ion_client *client, struct ion_handle *handle) +static void ion_free_nolock(struct ion_client *client, + struct ion_handle *handle) { bool valid_handle; @@ -1358,7 +1359,8 @@ static long ion_ioctl(struct file *filp, unsigned int cmd, unsigned long arg) struct ion_handle *handle; mutex_lock(&client->lock); - handle = ion_handle_get_by_id_nolock(client, data.handle.handle); + handle = ion_handle_get_by_id_nolock(client, + data.handle.handle); if (IS_ERR(handle)) { mutex_unlock(&client->lock); return PTR_ERR(handle); -- 2.1.4 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
[PATCH 1/1] Staging: rdma: hfi1: sdma.c: Fixed coding style issues
Fixed following checkpatch.pl warnings: Prefer 'unsigned int' to bare use of 'unsigned' Prefer READ_ONCE() over ACCESS_ONCE() Signed-off-by: Shyam Saini --- drivers/staging/rdma/hfi1/sdma.c | 30 +++--- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/drivers/staging/rdma/hfi1/sdma.c b/drivers/staging/rdma/hfi1/sdma.c index abb8ebc..c2e2856 100644 --- a/drivers/staging/rdma/hfi1/sdma.c +++ b/drivers/staging/rdma/hfi1/sdma.c @@ -234,7 +234,7 @@ static void sdma_put(struct sdma_state *); static void sdma_set_state(struct sdma_engine *, enum sdma_states); static void sdma_start_hw_clean_up(struct sdma_engine *); static void sdma_sw_clean_up_task(unsigned long); -static void sdma_sendctrl(struct sdma_engine *, unsigned); +static void sdma_sendctrl(struct sdma_engine *, unsigned int); static void init_sdma_regs(struct sdma_engine *, u32, uint); static void sdma_process_event( struct sdma_engine *sde, @@ -244,7 +244,7 @@ static void __sdma_process_event( enum sdma_events event); static void dump_sdma_state(struct sdma_engine *sde); static void sdma_make_progress(struct sdma_engine *sde, u64 status); -static void sdma_desc_avail(struct sdma_engine *sde, unsigned avail); +static void sdma_desc_avail(struct sdma_engine *sde, unsigned int avail); static void sdma_flush_descq(struct sdma_engine *sde); /** @@ -346,7 +346,7 @@ void sdma_wait(struct hfi1_devdata *dd) } } -static inline void sdma_set_desc_cnt(struct sdma_engine *sde, unsigned cnt) +static inline void sdma_set_desc_cnt(struct sdma_engine *sde, unsigned int cnt) { u64 reg; @@ -472,7 +472,7 @@ static void sdma_err_halt_wait(struct work_struct *work) static void sdma_err_progress_check_schedule(struct sdma_engine *sde) { if (!is_bx(sde->dd) && HFI1_CAP_IS_KSET(SDMA_AHG)) { - unsigned index; + unsigned int index; struct hfi1_devdata *dd = sde->dd; for (index = 0; index < dd->num_sdma; index++) { @@ -491,7 +491,7 @@ static void sdma_err_progress_check_schedule(struct sdma_engine *sde) static void sdma_err_progress_check(unsigned long data) { - unsigned index; + unsigned int index; struct sdma_engine *sde = (struct sdma_engine *)data; dd_dev_err(sde->dd, "SDE progress check event\n"); @@ -657,7 +657,7 @@ static void sdma_set_state(struct sdma_engine *sde, { struct sdma_state *ss = &sde->state; const struct sdma_set_state_action *action = sdma_action_table; - unsigned op = 0; + unsigned int op = 0; trace_hfi1_sdma_state( sde, @@ -989,7 +989,7 @@ static void sdma_clean(struct hfi1_devdata *dd, size_t num_engines) */ int sdma_init(struct hfi1_devdata *dd, u8 port) { - unsigned this_idx; + unsigned int this_idx; struct sdma_engine *sde; u16 descq_cnt; void *curr_head; @@ -1213,7 +1213,7 @@ void sdma_all_idle(struct hfi1_devdata *dd) */ void sdma_start(struct hfi1_devdata *dd) { - unsigned i; + unsigned int i; struct sdma_engine *sde; /* kick off the engines state processing */ @@ -1229,7 +1229,7 @@ void sdma_start(struct hfi1_devdata *dd) */ void sdma_exit(struct hfi1_devdata *dd) { - unsigned this_idx; + unsigned int this_idx; struct sdma_engine *sde; for (this_idx = 0; dd->per_sdma && this_idx < dd->num_sdma; @@ -1351,7 +1351,7 @@ retry: swhead = sde->descq_head & sde->sdma_mask; /* this code is really bad for cache line trading */ - swtail = ACCESS_ONCE(sde->descq_tail) & sde->sdma_mask; + swtail = READ_ONCE(sde->descq_tail) & sde->sdma_mask; cnt = sde->descq_cnt; if (swhead < swtail) @@ -1557,7 +1557,7 @@ void sdma_engine_error(struct sdma_engine *sde, u64 status) spin_unlock_irqrestore(&sde->tail_lock, flags); } -static void sdma_sendctrl(struct sdma_engine *sde, unsigned op) +static void sdma_sendctrl(struct sdma_engine *sde, unsigned int op) { u64 set_senddmactrl = 0; u64 clr_senddmactrl = 0; @@ -1736,7 +1736,7 @@ static void init_sdma_regs( void sdma_dumpstate(struct sdma_engine *sde) { u64 csr; - unsigned i; + unsigned int i; sdma_dumpstate_helper(SD(CTRL)); sdma_dumpstate_helper(SD(STATUS)); @@ -1854,7 +1854,7 @@ void sdma_seqfile_dump_sde(struct seq_file *s, struct sdma_engine *sde) u16 len; head = sde->descq_head & sde->sdma_mask; - tail = ACCESS_ONCE(sde->descq_tail) & sde->sdma_mask; + tail = READ_ONCE(sde->descq_tail) & sde->sdma_mask; seq_printf(s, SDE_FMT, sde->this_idx, sde->cpu, sdma_state_name(sde->state.current_state), @@ -1999,7 +1999,7 @@ static int sdma_check_progress( return -EAGAIN; /* pulse the head_lock */
[PATCH 1/1] Staging: rdma: hfi1: rc.c: Fixed coding style issues
Fixed following checkpatch.pl warnings: Prefer 'unsigned int' to bare use of 'unsigned' Prefer READ_ONCE() over ACCESS_ONCE() Signed-off-by: Shyam Saini --- drivers/staging/rdma/hfi1/rc.c | 12 ++-- drivers/staging/rdma/hfi1/ruc.c | 6 +++--- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/drivers/staging/rdma/hfi1/rc.c b/drivers/staging/rdma/hfi1/rc.c index 792f15e..fb3a6c1 100644 --- a/drivers/staging/rdma/hfi1/rc.c +++ b/drivers/staging/rdma/hfi1/rc.c @@ -421,7 +421,7 @@ int hfi1_make_rc_req(struct rvt_qp *qp, struct hfi1_pkt_state *ps) goto bail; /* We are in the error state, flush the work request. */ smp_read_barrier_depends(); /* see post_one_send() */ - if (qp->s_last == ACCESS_ONCE(qp->s_head)) + if (qp->s_last == READ_ONCE(qp->s_head)) goto bail; /* If DMAs are in progress, we can't flush immediately. */ if (iowait_sdma_pending(&priv->s_iowait)) { @@ -1103,7 +1103,7 @@ void hfi1_rc_send_complete(struct rvt_qp *qp, struct hfi1_ib_header *hdr) struct hfi1_other_headers *ohdr; struct rvt_swqe *wqe; struct ib_wc wc; - unsigned i; + unsigned int i; u32 opcode; u32 psn; @@ -1196,7 +1196,7 @@ static struct rvt_swqe *do_rc_completion(struct rvt_qp *qp, struct hfi1_ibport *ibp) { struct ib_wc wc; - unsigned i; + unsigned int i; /* * Don't decrement refcount and don't generate a @@ -1571,7 +1571,7 @@ static void rc_rcv_resp(struct hfi1_ibport *ibp, /* Ignore invalid responses. */ smp_read_barrier_depends(); /* see post_one_send */ - if (cmp_psn(psn, ACCESS_ONCE(qp->s_next_psn)) >= 0) + if (cmp_psn(psn, READ_ONCE(qp->s_next_psn)) >= 0) goto ack_done; /* Ignore duplicate responses. */ @@ -1970,9 +1970,9 @@ void hfi1_rc_error(struct rvt_qp *qp, enum ib_wc_status err) } } -static inline void update_ack_queue(struct rvt_qp *qp, unsigned n) +static inline void update_ack_queue(struct rvt_qp *qp, unsigned int n) { - unsigned next; + unsigned int next; next = n + 1; if (next > HFI1_MAX_RDMA_ATOMIC) diff --git a/drivers/staging/rdma/hfi1/ruc.c b/drivers/staging/rdma/hfi1/ruc.c index a659aec..cb64c80 100644 --- a/drivers/staging/rdma/hfi1/ruc.c +++ b/drivers/staging/rdma/hfi1/ruc.c @@ -239,7 +239,7 @@ bail: return ret; } -static __be64 get_sguid(struct hfi1_ibport *ibp, unsigned index) +static __be64 get_sguid(struct hfi1_ibport *ibp, unsigned int index) { if (!index) { struct hfi1_pportdata *ppd = ppd_from_ibp(ibp); @@ -393,7 +393,7 @@ static void ruc_loopback(struct rvt_qp *sqp) again: smp_read_barrier_depends(); /* see post_one_send() */ - if (sqp->s_last == ACCESS_ONCE(sqp->s_head)) + if (sqp->s_last == READ_ONCE(sqp->s_head)) goto clr_busy; wqe = rvt_get_swqe_ptr(sqp, sqp->s_last); @@ -929,7 +929,7 @@ void hfi1_send_complete(struct rvt_qp *qp, struct rvt_swqe *wqe, enum ib_wc_status status) { u32 old_last, last; - unsigned i; + unsigned int i; if (!(ib_rvt_state_ops[qp->state] & RVT_PROCESS_OR_FLUSH_SEND)) return; -- 1.9.1 ___ devel mailing list de...@linuxdriverproject.org http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel