Re: [PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-08 Thread Andrzej Hajda
On 02/05/2016 11:52 AM, Arnd Bergmann wrote: > On Thursday 04 February 2016 10:59:31 Andrew Morton wrote: >> On Thu, 04 Feb 2016 13:40:38 +0100 Arnd Bergmann wrote: >> >>> diff --git a/include/linux/err.h b/include/linux/err.h >>> index b7d4a9ff6342..bd4936a2c352 100644 >>> ---

Re: [PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-04 Thread Andrzej Hajda
On 02/04/2016 01:40 PM, Arnd Bergmann wrote: > On Wednesday 03 February 2016 14:15:28 Andrzej Hajda wrote: >> diff --git a/include/linux/err.h b/include/linux/err.h >> index 56762ab..b7d4a9f 100644 >> --- a/include/linux/err.h >> +++ b/include/linux/err.h >> @

Re: [PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-04 Thread Andrzej Hajda
On 02/04/2016 01:40 PM, Arnd Bergmann wrote: > On Wednesday 03 February 2016 14:15:28 Andrzej Hajda wrote: >> diff --git a/include/linux/err.h b/include/linux/err.h >> index 56762ab..b7d4a9f 100644 >> --- a/include/linux/err.h >> +++ b/include/linux/err.h >> @

[PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-03 Thread Andrzej Hajda
rgument type in IS_ERR_VALUE(e -> counters . pcnt) drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:110:35-36: WARNING: unknown argument type in IS_ERR_VALUE(fpi -> dpram_offset) Signed-off-by: Andrzej Hajda --- v3: - use '<= -1' instead of '< 0' to silence verbose warnings for g

Re: [PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-03 Thread Andrzej Hajda
On 02/03/2016 01:33 AM, Andrew Morton wrote: > On Thu, 28 Jan 2016 09:27:28 +0100 Andrzej Hajda wrote: > >> - use '<= 0' instead of '< 0' to silence gcc verbose warnings, >> - expand commit message. >> --- >> include/linux/err.h | 4 +++- >> 1

[PATCH v3] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-03 Thread Andrzej Hajda
rgument type in IS_ERR_VALUE(e -> counters . pcnt) drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:110:35-36: WARNING: unknown argument type in IS_ERR_VALUE(fpi -> dpram_offset) Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v3: - use '<= -1' instead of '< 0' to silenc

Re: [PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-03 Thread Andrzej Hajda
On 02/03/2016 01:33 AM, Andrew Morton wrote: > On Thu, 28 Jan 2016 09:27:28 +0100 Andrzej Hajda <a.ha...@samsung.com> wrote: > >> - use '<= 0' instead of '< 0' to silence gcc verbose warnings, >> - expand commit message. >> --- >> include/linux/err.h

Re: [PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-02 Thread Andrzej Hajda
On 02/02/2016 07:23 AM, Andrew Morton wrote: > On Thu, 28 Jan 2016 09:27:28 +0100 Andrzej Hajda wrote: > >> Current implementation of IS_ERR_VALUE works correctly only with >> following types: >> - unsigned long, >> - short, int, long. >> Other types are

Re: [PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-02-02 Thread Andrzej Hajda
On 02/02/2016 07:23 AM, Andrew Morton wrote: > On Thu, 28 Jan 2016 09:27:28 +0100 Andrzej Hajda <a.ha...@samsung.com> wrote: > >> Current implementation of IS_ERR_VALUE works correctly only with >> following types: >> - unsigned long, >> - short, int, long. &g

[PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-01-28 Thread Andrzej Hajda
rgument type in IS_ERR_VALUE(e -> counters . pcnt) drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:110:35-36: WARNING: unknown argument type in IS_ERR_VALUE(fpi -> dpram_offset) Signed-off-by: Andrzej Hajda --- v2: - use '<= 0' instead of '< 0' to silence gcc verbose warnings, - expa

[PATCH v2] err.h: allow IS_ERR_VALUE to handle properly more types

2016-01-28 Thread Andrzej Hajda
rgument type in IS_ERR_VALUE(e -> counters . pcnt) drivers/net/ethernet/freescale/fs_enet/mac-fcc.c:110:35-36: WARNING: unknown argument type in IS_ERR_VALUE(fpi -> dpram_offset) Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v2: - use '<= 0' instead of '< 0' to silence

[PATCH] err.h: allow IS_ERR_VALUE to handle properly more types

2016-01-07 Thread Andrzej Hajda
casted to argument's type for unsigned types and comparing with zero for signed types. As a result all integer types bigger than char are handled properly. Signed-off-by: Andrzej Hajda --- Hi, I have analyzed usage of IS_ERR_VALUE using coccinelle and in about 35 cases it is used incorrectly, ie

[PATCH] wlcore: fix error handling in wlcore_event_fw_logger

2016-01-07 Thread Andrzej Hajda
: 3719c17e1816 ("wlcore/wl18xx: fw logger over sdio") Signed-off-by: Andrzej Hajda --- drivers/net/wireless/ti/wlcore/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event.c index c964054..4b59

[PATCH] rtc: fix rtc_time64_to_tm calculation

2016-01-07 Thread Andrzej Hajda
]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2120705 Fixes: cab572b82c4b ('rtc: fix overflow and incorrect calculation in rtc_time64_to_tm') Signed-off-by: Andrzej Hajda --- drivers/rtc/rtc-lib.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/drivers/rtc

[PATCH] rtc: fix rtc_time64_to_tm calculation

2016-01-07 Thread Andrzej Hajda
]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2120705 Fixes: cab572b82c4b ('rtc: fix overflow and incorrect calculation in rtc_time64_to_tm') Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/rtc/rtc-lib.c | 13 - 1 file changed, 8 insertions(+), 5 deletions(-)

[PATCH] err.h: allow IS_ERR_VALUE to handle properly more types

2016-01-07 Thread Andrzej Hajda
casted to argument's type for unsigned types and comparing with zero for signed types. As a result all integer types bigger than char are handled properly. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- Hi, I have analyzed usage of IS_ERR_VALUE using coccinelle and in about 35

[PATCH] wlcore: fix error handling in wlcore_event_fw_logger

2016-01-07 Thread Andrzej Hajda
: 3719c17e1816 ("wlcore/wl18xx: fw logger over sdio") Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/net/wireless/ti/wlcore/event.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ti/wlcore/event.c b/drivers/net/wireless/ti/wlcore/event

Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-05 Thread Andrzej Hajda
On 01/05/2016 03:17 PM, Julia Lawall wrote: >> +@script:python depends on org@ >> +p << r_cmp.p; >> +e << r.e = ""; >> +@@ >> + >> +msg = "WARNING: Unsigned expression compared with zero: %s" % (e) >> +coccilib.org.print_todo(p[0], msg) >> + >> +@script:python depends on report@ >> +p << r_cmp.p;

Re: [PATCH v2 14/38] clk: vt8500: fix sign of possible PLL values

2016-01-05 Thread Andrzej Hajda
Ping Regards Andrzej On 10/02/2015 06:49 AM, Andrzej Hajda wrote: > With unsigned values underflow in loops can occur resulting in > theoretically infinite loops. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_tha

Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-05 Thread Andrzej Hajda
On 01/05/2016 01:59 PM, Geyslan G. Bem wrote: > Hello, > > 2016-01-04 4:45 GMT-03:00 Andrzej Hajda : >> Unsigned expressions cannot be lesser than zero. Presence of comparisons >> 'unsigned (<|<=|>|>=) 0' often indicates a bug, usually wrong type of >>

Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-05 Thread Andrzej Hajda
On 01/05/2016 01:59 PM, Geyslan G. Bem wrote: > Hello, > > 2016-01-04 4:45 GMT-03:00 Andrzej Hajda <a.ha...@samsung.com>: >> Unsigned expressions cannot be lesser than zero. Presence of comparisons >> 'unsigned (<|<=|>|>=) 0' often indicates a bug, usually w

Re: [PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-05 Thread Andrzej Hajda
On 01/05/2016 03:17 PM, Julia Lawall wrote: >> +@script:python depends on org@ >> +p << r_cmp.p; >> +e << r.e = ""; >> +@@ >> + >> +msg = "WARNING: Unsigned expression compared with zero: %s" % (e) >> +coccilib.org.print_todo(p[0], msg) >> + >> +@script:python depends on report@ >> +p << r_cmp.p;

Re: [PATCH v2 14/38] clk: vt8500: fix sign of possible PLL values

2016-01-05 Thread Andrzej Hajda
Ping Regards Andrzej On 10/02/2015 06:49 AM, Andrzej Hajda wrote: > With unsigned values underflow in loops can occur resulting in > theoretically infinite loops. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_tha

[PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-03 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda --- v6: improved range check detection (according to Julia suggestion) v5: improved range check detection v4: added range check detection, added full check in case

[PATCH v6] coccinelle: tests: unsigned value cannot be lesser than zero

2016-01-03 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v6: improved range check detection (according to Julia suggestion) v5: improved range check detection v4: added range check detection

[PATCH v5] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda --- v5: improved range check detection v4: added range check detection, added full check in case value holds a result of signed function v3: added bool type v2:

Re: [PATCH v4] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
On 12/30/2015 12:29 PM, Julia Lawall wrote: > > > On Wed, 30 Dec 2015, Andrzej Hajda wrote: > >> Unsigned expressions cannot be lesser than zero. Presence of comparisons >> 'unsigned (<|<=|>|>=) 0' often indicates a bug, usually wrong type of >

[PATCH] scsi_transport_fc: remove useless check

2015-12-30 Thread Andrzej Hajda
/2038576 Signed-off-by: Andrzej Hajda --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 8a88226..ecf62d9 100644 --- a/drivers/scsi/scsi_transport_fc.c +++ b/drivers

[PATCH] staging: lustre: remove useless check

2015-12-30 Thread Andrzej Hajda
Variable reserved is unsigned so the check is always true. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- drivers/staging

[PATCH] cpufreq-dt: fix handling regulator_get_voltage result

2015-12-30 Thread Andrzej Hajda
The function can return negative values so it should be assigned to signed type. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda

[PATCH v4] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda --- v4: added range check detection, added full check in case value holds a result of signed function v3: added bool type v2: added --all-includes option

[PATCH] staging: lustre: remove useless check

2015-12-30 Thread Andrzej Hajda
Variable reserved is unsigned so the check is always true. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.ha...@samsung.

[PATCH] scsi_transport_fc: remove useless check

2015-12-30 Thread Andrzej Hajda
/2038576 Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/scsi/scsi_transport_fc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/scsi/scsi_transport_fc.c b/drivers/scsi/scsi_transport_fc.c index 8a88226..ecf62d9 100644 --- a/driver

[PATCH] cpufreq-dt: fix handling regulator_get_voltage result

2015-12-30 Thread Andrzej Hajda
The function can return negative values so it should be assigned to signed type. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda

[PATCH v4] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v4: added range check detection, added full check in case value holds a result of signed function v3: added bool type v2: ad

Re: [PATCH v4] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
On 12/30/2015 12:29 PM, Julia Lawall wrote: > > > On Wed, 30 Dec 2015, Andrzej Hajda wrote: > >> Unsigned expressions cannot be lesser than zero. Presence of comparisons >> 'unsigned (<|<=|>|>=) 0' often indicates a bug, usually wrong type of >

[PATCH v5] coccinelle: tests: unsigned value cannot be lesser than zero

2015-12-30 Thread Andrzej Hajda
comparisons also using -Wtype-limits switch, but it warns also in correct cases, making too much noise. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v5: improved range check detection v4: added range check detection, added full check in case value holds a result of signed funct

[PATCH v2] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- v2: changed according to Kuninori Morimoto advice --- sound/soc/sh/rcar/ssi.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-) diff --git a/sound/soc/sh

Re: [PATCH] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
; >> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 >> >> Signed-off-by: Andrzej Hajda >> --- > Thank you for your patch. good catch ! > I noticed current error case is not good for ssi.c > Can you agree below ? Yes, of course. Regards Andrzej > >

[PATCH] NFC: nci: fix handling return value of nci_hci_create_pipe

2015-12-23 Thread Andrzej Hajda
The function return NCI_HCI_INVALID_PIPE in case of error. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- net/nfc/nci/hci.c

[PATCH] pinctrl: nsp-gpio: fix type of iterator

2015-12-23 Thread Andrzej Hajda
Iterator i declared as unsigned is always non-negative so the loop will never end. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda

[PATCH] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
Field usrcnt is unsigned so it cannot be lesser than zero. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda --- sound/soc/sh/rcar

[PATCH] cpufreq/scpi: fix handling return value of topology_physical_package_id

2015-12-23 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/cpufreq/scpi-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 2c3b16f..de5e89b 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufreq/scpi-cpufreq.c @@ -31,7 +31,7

Re: [PATCH] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
; >> [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 >> >> Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> >> --- > Thank you for your patch. good catch ! > I noticed current error case is not good for ssi.c > Can you agree below ? Yes, of course. R

[PATCH v2] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- v2: changed according to Kuninori Morimoto advice --- sound/soc/sh/rcar/ssi.c | 27 ++- 1 file changed, 14 insertions(+), 13 deletions(-)

[PATCH] NFC: nci: fix handling return value of nci_hci_create_pipe

2015-12-23 Thread Andrzej Hajda
The function return NCI_HCI_INVALID_PIPE in case of error. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.ha...@samsung.

[PATCH] pinctrl: nsp-gpio: fix type of iterator

2015-12-23 Thread Andrzej Hajda
Iterator i declared as unsigned is always non-negative so the loop will never end. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda

[PATCH] ASoC: rsnd: fix usrcnt decrementing bug

2015-12-23 Thread Andrzej Hajda
Field usrcnt is unsigned so it cannot be lesser than zero. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2038576 Signed-off-by: Andrzej Hajda <a.ha...@samsung.

[PATCH] cpufreq/scpi: fix handling return value of topology_physical_package_id

2015-12-23 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/cpufreq/scpi-cpufreq.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/cpufreq/scpi-cpufreq.c b/drivers/cpufreq/scpi-cpufreq.c index 2c3b16f..de5e89b 100644 --- a/drivers/cpufreq/scpi-cpufreq.c +++ b/drivers/cpufre

Re: [PATCH] err.h: add type checking to IS_ERR_VALUE macro

2015-12-18 Thread Andrzej Hajda
. Regards Andrzej On 12/18/2015 12:22 PM, kbuild test robot wrote: > Hi Andrzej, > > [auto build test WARNING on v4.4-rc5] > [also build test WARNING on next-20151217] > > url: > https://github.com/0day-ci/linux/commits/Andrzej-Hajda/err-h-add-type-checking-to-IS_ERR_VALUE-

[PATCH] err.h: add type checking to IS_ERR_VALUE macro

2015-12-18 Thread Andrzej Hajda
if value of -MAX_ERRNO differes if casted to argument type and to ulong. Signed-off-by: Andrzej Hajda --- Hi, Current implementation of IS_ERR_VALUE does not check type of its arguments. It can result in subtle bugs in the code, especially when compiled for 64bit architectures. The patch tries

[PATCH] err.h: add type checking to IS_ERR_VALUE macro

2015-12-18 Thread Andrzej Hajda
if value of -MAX_ERRNO differes if casted to argument type and to ulong. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> --- Hi, Current implementation of IS_ERR_VALUE does not check type of its arguments. It can result in subtle bugs in the code, especially when compiled for 64bit archite

Re: [PATCH] err.h: add type checking to IS_ERR_VALUE macro

2015-12-18 Thread Andrzej Hajda
. Regards Andrzej On 12/18/2015 12:22 PM, kbuild test robot wrote: > Hi Andrzej, > > [auto build test WARNING on v4.4-rc5] > [also build test WARNING on next-20151217] > > url: > https://github.com/0day-ci/linux/commits/Andrzej-Hajda/err-h-add-type-checking-to-IS_ERR_VALUE-

[PATCH] extcon: max77693: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
The function can return negative values, so its result should be assigned to signed variable. Signed-off-by: Andrzej Hajda Suggested-by: Krzysztof Kozlowski --- drivers/extcon/extcon-max77693.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/extcon/extcon

Re: [PATCH 11/19] clocksource: fix __ftm_clk_init result

2015-12-14 Thread Andrzej Hajda
Hi, Ping. Regards Andrzej On 09/24/2015 04:00 PM, Andrzej Hajda wrote: > The function tries to return clock frequency (unsigned long) or error > (int < 0). Using int as a result could be dangerous. On the other side > caller is not interested in error value, so the best solution is

Re: [PATCH v2 14/38] clk: vt8500: fix sign of possible PLL values

2015-12-14 Thread Andrzej Hajda
Hi, Ping. Regards Andrzej On 10/02/2015 06:49 AM, Andrzej Hajda wrote: > With unsigned values underflow in loops can occur resulting in > theoretically infinite loops. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_tha

Re: [PATCH 11/38] HSI: omap_ssi: fix handling ida_simple_get result

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. &

Re: [PATCH 12/38] HSI: omap_ssi_port: fix handling of_get_named_gpio result

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. &

Re: [PATCH 01/38] arm-cci: fix handling cpumask_any_but return value

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > cpumask_any_but returns value >= nr_cpu_ids if there are no more CPUs. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_

[PATCH] extcon: max14577: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/extcon/extcon-max14577.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c index 601dbd9..b30ab97 100644 --- a/drivers/extcon/extcon-max14577.c +++ b/drivers/extcon/extcon-max14577.c

[PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate

2015-12-14 Thread Andrzej Hajda
-off-by: Andrzej Hajda --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a680a97..fe1fd1a 100644 --- a/drivers/net/wireless/ath

[PATCH] clk: sunxi: fix handling return value of of_property_match_string

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi/clk-sun8i-bus-gates.c b/drivers/clk/sunxi/clk-sun8i-bus-gates.c index 7ab60c5..ecadd97 100644 --- a/drivers/clk/sunxi/clk-sun8i-bus-gates.c +++ b

[PATCH] be2iscsi: fix handling return value of mgmt_open_connection

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/scsi/be2iscsi/be_iscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index b7087ba..ce9f192 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/drivers/scsi/be2iscsi/be_iscsi.c

[PATCH] extcon: max77843: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/extcon/extcon-max77843.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c index 9f9ea33..74dfb7f 100644 --- a/drivers/extcon/extcon-max77843.c +++ b/drivers/extcon/extcon-max77843.c

[PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index da7f578..b46dbe2 100644 --- a/drivers/net

[PATCH] doc: mei: fix handling return value of mei_recv_msg

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda --- Documentation/misc-devices/mei/mei-amt-version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/misc-devices/mei/mei-amt-version.c b/Documentation/misc-devices/mei/mei-amt-version.c index 57d0d87..33e67bd 100644 --- a/Documentation/misc-devices/mei

Re: [PATCH 12/38] HSI: omap_ssi_port: fix handling of_get_named_gpio result

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. &

Re: [PATCH 11/38] HSI: omap_ssi: fix handling ida_simple_get result

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_than_zero.cocci [1]. &

Re: [PATCH 11/19] clocksource: fix __ftm_clk_init result

2015-12-14 Thread Andrzej Hajda
Hi, Ping. Regards Andrzej On 09/24/2015 04:00 PM, Andrzej Hajda wrote: > The function tries to return clock frequency (unsigned long) or error > (int < 0). Using int as a result could be dangerous. On the other side > caller is not interested in error value, so the best solution is

[PATCH] extcon: max77693: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
The function can return negative values, so its result should be assigned to signed variable. Signed-off-by: Andrzej Hajda <a.ha...@samsung.com> Suggested-by: Krzysztof Kozlowski <k.kozlow...@samsung.com> --- drivers/extcon/extcon-max77693.c | 4 ++-- 1 file changed, 2 insertions(+),

[PATCH] ath9k_htc: fix handling return value of ath9k_hw_calibrate

2015-12-14 Thread Andrzej Hajda
-off-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/net/wireless/ath/ath9k/htc_drv_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/wireless/ath/ath9k/htc_drv_main.c b/drivers/net/wireless/ath/ath9k/htc_drv_main.c index a680a97..fe1fd1a 100644 --- a/d

[PATCH] clk: sunxi: fix handling return value of of_property_match_string

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/clk/sunxi/clk-sun8i-bus-gates.c | 8 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/drivers/clk/sunxi/clk-sun8i-bus-gates.c b/drivers/clk/sunxi/clk-sun8i-bus-gates.c index 7ab60c5..ecadd97 100644 --- a/drivers/clk/sunxi/clk

[PATCH] be2iscsi: fix handling return value of mgmt_open_connection

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/scsi/be2iscsi/be_iscsi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/scsi/be2iscsi/be_iscsi.c b/drivers/scsi/be2iscsi/be_iscsi.c index b7087ba..ce9f192 100644 --- a/drivers/scsi/be2iscsi/be_iscsi.c +++ b/driver

[PATCH] extcon: max77843: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/extcon/extcon-max77843.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-max77843.c b/drivers/extcon/extcon-max77843.c index 9f9ea33..74dfb7f 100644 --- a/drivers/extcon/extcon-max77843.c +++ b/drivers/

Re: [PATCH 01/38] arm-cci: fix handling cpumask_any_but return value

2015-12-14 Thread Andrzej Hajda
Hi, Ping - almost three months passed. Regards Andrzej On 09/21/2015 03:33 PM, Andrzej Hajda wrote: > cpumask_any_but returns value >= nr_cpu_ids if there are no more CPUs. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_

Re: [PATCH v2 14/38] clk: vt8500: fix sign of possible PLL values

2015-12-14 Thread Andrzej Hajda
Hi, Ping. Regards Andrzej On 10/02/2015 06:49 AM, Andrzej Hajda wrote: > With unsigned values underflow in loops can occur resulting in > theoretically infinite loops. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/unsigned_lesser_tha

[PATCH] extcon: max14577: fix handling return value of regmap_irq_get_virq

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/extcon/extcon-max14577.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/extcon/extcon-max14577.c b/drivers/extcon/extcon-max14577.c index 601dbd9..b30ab97 100644 --- a/drivers/extcon/extcon-max14577.c +++ b/drivers/

[PATCH] doc: mei: fix handling return value of mei_recv_msg

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- Documentation/misc-devices/mei/mei-amt-version.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Documentation/misc-devices/mei/mei-amt-version.c b/Documentation/misc-devices/mei/mei-amt-version.c index 57d0d87..33e67bd

[PATCH] net/mlx4_core: fix handling return value of mlx4_slave_convert_port

2015-12-14 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/net/ethernet/mellanox/mlx4/resource_tracker.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c b/drivers/net/ethernet/mellanox/mlx4/resource_tracker.c index da7f578..b

[PATCH v2] NFC: fdp: fix handling return value of fdp_nci_create_conn

2015-12-10 Thread Andrzej Hajda
-by: Andrzej Hajda --- v2: fixed typo in goto instruction drivers/nfc/fdp/fdp.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ccb07a1..4dfd1ef 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -368,11

[PATCH v2] NFC: fdp: fix handling return value of fdp_nci_create_conn

2015-12-10 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- v2: fixed typo in goto instruction drivers/nfc/fdp/fdp.c | 14 ++ 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ccb07a1..4dfd1ef 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drive

[PATCH] NFC: fdp: fix handling return value of fdp_nci_create_conn

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/nfc/fdp/fdp.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ccb07a1..440fac3 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -368,11 +368,10 @@ static int

[PATCH] rtc: rv8803: fix handling return value of i2c_smbus_read_byte_data

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/rtc/rtc-rv8803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c index e7329e2..f883aa2 100644 --- a/drivers/rtc/rtc-rv8803.c +++ b/drivers/rtc/rtc-rv8803.c @@ -61,7 +61,7 @@ static irqreturn_t

[PATCH] NFC: fdp: fix handling return value of nci_conn_max_data_pkt_payload_size

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda --- drivers/nfc/fdp/fdp.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index 440fac3..37a7134 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -192,7 +192,7 @@ static int fdp_nci_send_patch

[PATCH] NFC: fdp: fix handling return value of nci_conn_max_data_pkt_payload_size

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/nfc/fdp/fdp.c | 8 +--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index 440fac3..37a7134 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -192,7 +192,7 @@ stat

[PATCH] rtc: rv8803: fix handling return value of i2c_smbus_read_byte_data

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/rtc/rtc-rv8803.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/rtc/rtc-rv8803.c b/drivers/rtc/rtc-rv8803.c index e7329e2..f883aa2 100644 --- a/drivers/rtc/rtc-rv8803.c +++ b/drivers/rtc/rtc-rv8803.c @@ -61,7 +61,7 @@

[PATCH] NFC: fdp: fix handling return value of fdp_nci_create_conn

2015-12-09 Thread Andrzej Hajda
-by: Andrzej Hajda <a.ha...@samsung.com> --- drivers/nfc/fdp/fdp.c | 16 +++- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/drivers/nfc/fdp/fdp.c b/drivers/nfc/fdp/fdp.c index ccb07a1..440fac3 100644 --- a/drivers/nfc/fdp/fdp.c +++ b/drivers/nfc/fdp/fdp.c @@ -368,11 +

Re: [PATCH v3 4/5] drm/dsi: Add routine to unregister dsi device

2015-11-30 Thread Andrzej Hajda
On 11/30/2015 01:01 PM, Archit Taneja wrote: > A driver calling mipi_dsi_device_new might want to unregister the device > once it's done. It might also require it in an error handling path in > case something didn't go right. > > Signed-off-by: Archit Taneja Reviewed-by: Andrzej

Re: [PATCH v3 4/5] drm/dsi: Add routine to unregister dsi device

2015-11-30 Thread Andrzej Hajda
rora.org> Reviewed-by: Andrzej Hajda <a.ha...@samsung.com> Regards Andrzej -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/

Re: [RFD] Functional dependencies between devices

2015-11-29 Thread Andrzej Hajda
Hi, Sorry for late response. On 11/24/2015 05:28 PM, Rafael J. Wysocki wrote: > On Tuesday, November 24, 2015 03:57:09 PM Andrzej Hajda wrote: >> On 11/19/2015 11:04 PM, Rafael J. Wysocki wrote: >>> On Thursday, November 19, 2015 10:08:43 AM Andrzej Hajda wrote: >>&

Re: [RFD] Functional dependencies between devices

2015-11-29 Thread Andrzej Hajda
Hi, Sorry for late response. On 11/24/2015 05:28 PM, Rafael J. Wysocki wrote: > On Tuesday, November 24, 2015 03:57:09 PM Andrzej Hajda wrote: >> On 11/19/2015 11:04 PM, Rafael J. Wysocki wrote: >>> On Thursday, November 19, 2015 10:08:43 AM Andrzej Hajda wrote: >>&

Re: [RFD] Functional dependencies between devices

2015-11-24 Thread Andrzej Hajda
On 11/19/2015 11:04 PM, Rafael J. Wysocki wrote: > On Thursday, November 19, 2015 10:08:43 AM Andrzej Hajda wrote: >> On 11/18/2015 03:17 AM, Rafael J. Wysocki wrote: >>> On Tuesday, November 17, 2015 01:44:59 PM Andrzej Hajda wrote: >>>> Hi Rafael, >>>>

Re: [RFD] Functional dependencies between devices

2015-11-24 Thread Andrzej Hajda
On 11/21/2015 03:04 PM, Mark Brown wrote: > On Thu, Nov 19, 2015 at 07:50:45AM +0100, Andrzej Hajda wrote: >> On 11/17/2015 02:55 PM, Mark Brown wrote: >>> This is going to be really common but I'm not sure I see a problem with >>> it in terms of what Raphael is proposi

Re: [RFD] Functional dependencies between devices

2015-11-24 Thread Andrzej Hajda
On 11/19/2015 11:04 PM, Rafael J. Wysocki wrote: > On Thursday, November 19, 2015 10:08:43 AM Andrzej Hajda wrote: >> On 11/18/2015 03:17 AM, Rafael J. Wysocki wrote: >>> On Tuesday, November 17, 2015 01:44:59 PM Andrzej Hajda wrote: >>>> Hi Rafael, >>>>

Re: [RFD] Functional dependencies between devices

2015-11-24 Thread Andrzej Hajda
On 11/21/2015 03:04 PM, Mark Brown wrote: > On Thu, Nov 19, 2015 at 07:50:45AM +0100, Andrzej Hajda wrote: >> On 11/17/2015 02:55 PM, Mark Brown wrote: >>> This is going to be really common but I'm not sure I see a problem with >>> it in terms of what Raphael is proposi

Re: [RFD] Functional dependencies between devices

2015-11-19 Thread Andrzej Hajda
On 11/18/2015 03:17 AM, Rafael J. Wysocki wrote: > On Tuesday, November 17, 2015 01:44:59 PM Andrzej Hajda wrote: >> Hi Rafael, >> >> Please forgive me late reply, but I have missed this thread before. >> >> On 10/27/2015 04:24 PM, Rafael J. Wysocki wrote:

Re: [RFD] Functional dependencies between devices

2015-11-19 Thread Andrzej Hajda
On 11/18/2015 03:17 AM, Rafael J. Wysocki wrote: > On Tuesday, November 17, 2015 01:44:59 PM Andrzej Hajda wrote: >> Hi Rafael, >> >> Please forgive me late reply, but I have missed this thread before. >> >> On 10/27/2015 04:24 PM, Rafael J. Wysocki wrote:

Re: [RFD] Functional dependencies between devices

2015-11-18 Thread Andrzej Hajda
On 11/17/2015 02:55 PM, Mark Brown wrote: > On Tue, Nov 17, 2015 at 01:49:17PM +0100, Andrzej Hajda wrote: > > Please fix your mail client to word wrap within paragraphs at something > substantially less than 80 columns. Doing this makes your messages much > easier to

Re: [RFD] Functional dependencies between devices

2015-11-18 Thread Andrzej Hajda
On 11/17/2015 02:55 PM, Mark Brown wrote: > On Tue, Nov 17, 2015 at 01:49:17PM +0100, Andrzej Hajda wrote: > > Please fix your mail client to word wrap within paragraphs at something > substantially less than 80 columns. Doing this makes your messages much > easier to

Re: [RFD] Functional dependencies between devices

2015-11-17 Thread Andrzej Hajda
Hi Rafael, It is just re-send of the previous message with fixed e-mail. Please forgive me late reply, but I have missed this thread before. On 10/27/2015 04:24 PM, Rafael J. Wysocki wrote: > Hi All, > > As discussed in the recent "On-demand device probing" thread and in a Kernel > Summit

<    4   5   6   7   8   9   10   11   12   13   >