Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1232114 > unrolled thread
| Started by | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| First post | 2015-09-24 16:10 +0200 |
| Last post | 2015-09-25 04:10 +0200 |
| Articles | 20 on this page of 29 — 9 participants |
Back to article view | Back to linux.kernel
[PATCH 00/19] Fixes related to incorrect assignment of signed results function Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
[PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result Darren Hart <dvhart@infradead.org> - 2015-10-03 18:50 +0200
Re: [PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result Andrzej Hajda <a.hajda@samsung.com> - 2015-10-05 09:50 +0200
[PATCH 03/19] libata: samsung_cf: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 03/19] libata: samsung_cf: fix handling platform_get_irq result Tejun Heo <tj@kernel.org> - 2015-09-24 17:00 +0200
[PATCH v2 03/19] libata: samsung_cf: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-25 08:50 +0200
Re: [PATCH v2 03/19] libata: samsung_cf: fix handling platform_get_irq result Tejun Heo <tj@kernel.org> - 2015-09-25 18:00 +0200
[PATCH 02/19] spi: davinci: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
[PATCH 07/19] net: hisilicon: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 07/19] net: hisilicon: fix handling platform_get_irq result David Miller <davem@davemloft.net> - 2015-09-27 07:50 +0200
[PATCH 16/19] r8169: fix handling rtl_readphy result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 16/19] r8169: fix handling rtl_readphy result David Miller <davem@davemloft.net> - 2015-09-27 07:50 +0200
[PATCH 18/19] mac80211: make ieee80211_new_mesh_header return unsigned Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 18/19] mac80211: make ieee80211_new_mesh_header return unsigned Johannes Berg <johannes@sipsolutions.net> - 2015-09-24 16:20 +0200
[PATCH v2 18/19] mac80211: make ieee80211_new_mesh_header return unsigned Andrzej Hajda <a.hajda@samsung.com> - 2015-09-25 08:50 +0200
[PATCH 11/19] clocksource: fix __ftm_clk_init result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
[PATCH 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned Daniel Borkmann <daniel@iogearbox.net> - 2015-09-24 21:00 +0200
[PATCH v2 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned Andrzej Hajda <a.hajda@samsung.com> - 2015-09-25 08:50 +0200
Re: [PATCH v2 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned David Miller <davem@davemloft.net> - 2015-09-29 07:20 +0200
[PATCH 05/19] media: am437x-vpfe: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
[PATCH 13/19] extcon: sm5502: fix handling regmap_irq_get_virq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 13/19] extcon: sm5502: fix handling regmap_irq_get_virq result Chanwoo Choi <cw00.choi@samsung.com> - 2015-09-25 01:50 +0200
[PATCH 15/19] KVM: PPC: e500: fix handling local_sid_lookup result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
[PATCH 06/19] staging: media: omap4iss: fix handling platform_get_irq result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 06/19] staging: media: omap4iss: fix handling platform_get_irq result Dan Carpenter <dan.carpenter@oracle.com> - 2015-09-24 17:10 +0200
[PATCH 09/19] dmaengine: xgene-dma: fix handling xgene_dma_get_ring_size result Andrzej Hajda <a.hajda@samsung.com> - 2015-09-24 16:10 +0200
Re: [PATCH 09/19] dmaengine: xgene-dma: fix handling xgene_dma_get_ring_size result Vinod Koul <vinod.koul@intel.com> - 2015-09-25 04:10 +0200
Page 1 of 2 [1] 2 Next page →
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 00/19] Fixes related to incorrect assignment of signed results function |
| Message-ID | <qcfnH-5il-3@gated-at.bofh.it> |
Hi,
This is another set of independent patches. The only connection
between them is that they try to address problems spotted by proposed
coccinelle semantic patch assign_signed_to_unsigned.cocci[1].
This semantic patch tries to find bugs, where signed result of function
is lost due to conversion to unsigned value. To decrease number of
false positives it looks if after the call there is comparison of
the result variable with 0.
In pseudo-code it looks like:
unsigned = signed_function(...);
...
if (unsigned ( < | <= ) 0 )
...
This patchset contains mainly real bug fixes. Only last three patches
do not fix real bugs, they just proposes change of types to avoid
conversions int -> unsigned.
The patches are based on linux-next.
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Regards
Andrzej
Andrzej Hajda (19):
SUNRPC: fix variable type
spi: davinci: fix handling platform_get_irq result
libata: samsung_cf: fix handling platform_get_irq result
v4l: omap3isp: fix handling platform_get_irq result
media: am437x-vpfe: fix handling platform_get_irq result
staging: media: omap4iss: fix handling platform_get_irq result
net: hisilicon: fix handling platform_get_irq result
clk: st: fix handling result of of_property_count_strings
dmaengine: xgene-dma: fix handling xgene_dma_get_ring_size result
cx231xx: fix handling cx231xx_read_i2c_data result
clocksource: fix __ftm_clk_init result
extcon: rt8973a: fix handling regmap_irq_get_virq result
extcon: sm5502: fix handling regmap_irq_get_virq result
sony-laptop: fix handling sony_nc_hotkeys_decode result
KVM: PPC: e500: fix handling local_sid_lookup result
r8169: fix handling rtl_readphy result
tools: bpf_jit_disasm: make get_last_jit_image return unsigned
mac80211: make ieee80211_new_mesh_header return unsigned
block: nvme-scsi: make nvme_trans_get_blk_desc_len return unsigned
arch/powerpc/kvm/e500.c | 3 ++-
drivers/ata/pata_samsung_cf.c | 5 ++---
drivers/block/nvme-scsi.c | 2 +-
drivers/clk/st/clk-flexgen.c | 7 ++++---
drivers/clocksource/fsl_ftm_timer.c | 8 ++++----
drivers/dma/xgene-dma.c | 9 ++++++---
drivers/extcon/extcon-rt8973a.c | 2 +-
drivers/extcon/extcon-sm5502.c | 2 +-
drivers/media/platform/am437x/am437x-vpfe.c | 5 +++--
drivers/media/platform/omap3isp/isp.c | 5 +++--
drivers/media/usb/cx231xx/cx231xx-video.c | 3 ++-
drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +-
drivers/net/ethernet/realtek/r8169.c | 2 +-
drivers/platform/x86/sony-laptop.c | 12 ++++++++----
drivers/spi/spi-davinci.c | 7 ++++---
drivers/staging/media/omap4iss/iss.c | 5 +++--
net/mac80211/mesh.c | 2 +-
net/sunrpc/xprtsock.c | 2 +-
tools/net/bpf_jit_disasm.c | 2 +-
19 files changed, 49 insertions(+), 36 deletions(-)
--
1.9.1
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result |
| Message-ID | <qcfnI-5il-27@gated-at.bofh.it> |
| In reply to | #1232114 |
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
drivers/platform/x86/sony-laptop.c | 12 ++++++++----
1 file changed, 8 insertions(+), 4 deletions(-)
diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
index aeb80d1..d8a2115 100644
--- a/drivers/platform/x86/sony-laptop.c
+++ b/drivers/platform/x86/sony-laptop.c
@@ -1204,6 +1204,8 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
{
u32 real_ev = event;
u8 ev_type = 0;
+ int ret;
+
dprintk("sony_nc_notify, event: 0x%.2x\n", event);
if (event >= 0x90) {
@@ -1225,13 +1227,15 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
case 0x0100:
case 0x0127:
ev_type = HOTKEY;
- real_ev = sony_nc_hotkeys_decode(event, handle);
+ ret = sony_nc_hotkeys_decode(event, handle);
- if (real_ev > 0)
- sony_laptop_report_input_event(real_ev);
- else
+ if (ret > 0) {
+ sony_laptop_report_input_event(ret);
+ real_ev = ret;
+ } else {
/* restore the original event for reporting */
real_ev = event;
+ }
break;
--
1.9.1
--
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]
| From | Darren Hart <dvhart@infradead.org> |
|---|---|
| Date | 2015-10-03 18:50 +0200 |
| Subject | Re: [PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result |
| Message-ID | <qfyav-7uw-21@gated-at.bofh.it> |
| In reply to | #1232115 |
On Thu, Sep 24, 2015 at 04:00:22PM +0200, Andrzej Hajda wrote:
> The function can return negative value.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
Sorry for the delay Andrsej, and thank you for your patch. Given my delay, I've
made a couple of changes myself rather than asking you to resubmit. Please
review and let me know if you have any concerns.
First, The description above is incomplete and relies on context from the URL
to fully explain the problem you are fixing. In the future, please ensure the
commit message is self-sufficient.
I have changed the message to read:
sony-laptop: Fix handling sony_nc_hotkeys_decode result
sony_nv_hotkeys_decode can return a negative value. real_ev is a u32 variable.
The check for real_ev > 0 is incorrect.
Use an intermediate ret variable.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
[dvhart: clarify commit msg, drop superfluous else block]
Signed-off-by: Darren Hart <dvhart@linux.intel.com>
See below for an additional change.
> ---
> Hi,
>
> To avoid problems with too many mail recipients I have sent whole
> patchset only to LKML. Anyway patches have no dependencies.
>
> Regards
> Andrzej
> ---
> drivers/platform/x86/sony-laptop.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
> index aeb80d1..d8a2115 100644
> --- a/drivers/platform/x86/sony-laptop.c
> +++ b/drivers/platform/x86/sony-laptop.c
> @@ -1204,6 +1204,8 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
> {
> u32 real_ev = event;
> u8 ev_type = 0;
> + int ret;
> +
> dprintk("sony_nc_notify, event: 0x%.2x\n", event);
>
> if (event >= 0x90) {
> @@ -1225,13 +1227,15 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
> case 0x0100:
> case 0x0127:
> ev_type = HOTKEY;
> - real_ev = sony_nc_hotkeys_decode(event, handle);
> + ret = sony_nc_hotkeys_decode(event, handle);
>
> - if (real_ev > 0)
> - sony_laptop_report_input_event(real_ev);
> - else
> + if (ret > 0) {
> + sony_laptop_report_input_event(ret);
> + real_ev = ret;
> + } else {
> /* restore the original event for reporting */
> real_ev = event;
> + }
This 4 line else block is superfluous. real_ev is initialized to event and only changed here if ret > 0. Therefore, there is no need to set real_ev to event again. I have simply dropped the else block
--
Darren Hart
Intel Open Source Technology Center
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-10-05 09:50 +0200 |
| Subject | Re: [PATCH 14/19] sony-laptop: fix handling sony_nc_hotkeys_decode result |
| Message-ID | <qg8GZ-Ta-5@gated-at.bofh.it> |
| In reply to | #1238954 |
On 10/03/2015 06:39 PM, Darren Hart wrote:
> On Thu, Sep 24, 2015 at 04:00:22PM +0200, Andrzej Hajda wrote:
>> The function can return negative value.
>>
>> The problem has been detected using proposed semantic patch
>> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
>>
>> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
>>
>> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> Sorry for the delay Andrsej, and thank you for your patch. Given my delay, I've
> made a couple of changes myself rather than asking you to resubmit. Please
> review and let me know if you have any concerns.
Looks OK. Thanks for fixing.
Regards
Andrzej
>
> First, The description above is incomplete and relies on context from the URL
> to fully explain the problem you are fixing. In the future, please ensure the
> commit message is self-sufficient.
>
> I have changed the message to read:
>
> sony-laptop: Fix handling sony_nc_hotkeys_decode result
>
> sony_nv_hotkeys_decode can return a negative value. real_ev is a u32 variable.
> The check for real_ev > 0 is incorrect.
>
> Use an intermediate ret variable.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> [dvhart: clarify commit msg, drop superfluous else block]
> Signed-off-by: Darren Hart <dvhart@linux.intel.com>
>
> See below for an additional change.
>
>> ---
>> Hi,
>>
>> To avoid problems with too many mail recipients I have sent whole
>> patchset only to LKML. Anyway patches have no dependencies.
>>
>> Regards
>> Andrzej
>> ---
>> drivers/platform/x86/sony-laptop.c | 12 ++++++++----
>> 1 file changed, 8 insertions(+), 4 deletions(-)
>>
>> diff --git a/drivers/platform/x86/sony-laptop.c b/drivers/platform/x86/sony-laptop.c
>> index aeb80d1..d8a2115 100644
>> --- a/drivers/platform/x86/sony-laptop.c
>> +++ b/drivers/platform/x86/sony-laptop.c
>> @@ -1204,6 +1204,8 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
>> {
>> u32 real_ev = event;
>> u8 ev_type = 0;
>> + int ret;
>> +
>> dprintk("sony_nc_notify, event: 0x%.2x\n", event);
>>
>> if (event >= 0x90) {
>> @@ -1225,13 +1227,15 @@ static void sony_nc_notify(struct acpi_device *device, u32 event)
>> case 0x0100:
>> case 0x0127:
>> ev_type = HOTKEY;
>> - real_ev = sony_nc_hotkeys_decode(event, handle);
>> + ret = sony_nc_hotkeys_decode(event, handle);
>>
>> - if (real_ev > 0)
>> - sony_laptop_report_input_event(real_ev);
>> - else
>> + if (ret > 0) {
>> + sony_laptop_report_input_event(ret);
>> + real_ev = ret;
>> + } else {
>> /* restore the original event for reporting */
>> real_ev = event;
>> + }
> This 4 line else block is superfluous. real_ev is initialized to event and only changed here if ret > 0. Therefore, there is no need to set real_ev to event again. I have simply dropped the else block
>
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 03/19] libata: samsung_cf: fix handling platform_get_irq result |
| Message-ID | <qcfnI-5il-31@gated-at.bofh.it> |
| In reply to | #1232114 |
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
drivers/ata/pata_samsung_cf.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/ata/pata_samsung_cf.c b/drivers/ata/pata_samsung_cf.c
index cbb5a47..e028763 100644
--- a/drivers/ata/pata_samsung_cf.c
+++ b/drivers/ata/pata_samsung_cf.c
@@ -510,8 +510,6 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
return -ENOMEM;
}
- info->irq = platform_get_irq(pdev, 0);
-
res = platform_get_resource(pdev, IORESOURCE_MEM, 0);
info->ide_addr = devm_ioremap_resource(dev, res);
@@ -551,9 +549,10 @@ static int __init pata_s3c_probe(struct platform_device *pdev)
info->cpu_type = cpu_type;
+ ret = platform_get_irq(pdev, 0);
+ info->irq = ret > 0 ? ret : 0;
if (info->irq <= 0) {
ap->flags |= ATA_FLAG_PIO_POLLING;
- info->irq = 0;
ata_port_desc(ap, "no IRQ, using PIO polling\n");
}
--
1.9.1
--
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]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-09-24 17:00 +0200 |
| Subject | Re: [PATCH 03/19] libata: samsung_cf: fix handling platform_get_irq result |
| Message-ID | <qcga7-6cP-31@gated-at.bofh.it> |
| In reply to | #1232116 |
On Thu, Sep 24, 2015 at 04:00:11PM +0200, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> > --- > Hi, > > To avoid problems with too many mail recipients I have sent whole > patchset only to LKML. Anyway patches have no dependencies. Can we just change s3c_ide_info->irq to int instead? Thanks. -- tejun -- 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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-25 08:50 +0200 |
| Subject | [PATCH v2 03/19] libata: samsung_cf: fix handling platform_get_irq result |
| Message-ID | <qcuZs-23t-33@gated-at.bofh.it> |
| In reply to | #1232149 |
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
v2: changed type of irq field
---
drivers/ata/pata_samsung_cf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/ata/pata_samsung_cf.c b/drivers/ata/pata_samsung_cf.c
index cbb5a47..f6facd6 100644
--- a/drivers/ata/pata_samsung_cf.c
+++ b/drivers/ata/pata_samsung_cf.c
@@ -70,7 +70,7 @@ struct s3c_ide_info {
struct clk *clk;
void __iomem *ide_addr;
void __iomem *sfr_addr;
- unsigned int irq;
+ int irq;
enum s3c_cpu_type cpu_type;
unsigned int fifo_status_reg;
};
--
1.9.1
--
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]
| From | Tejun Heo <tj@kernel.org> |
|---|---|
| Date | 2015-09-25 18:00 +0200 |
| Subject | Re: [PATCH v2 03/19] libata: samsung_cf: fix handling platform_get_irq result |
| Message-ID | <qcDzI-5Tv-11@gated-at.bofh.it> |
| In reply to | #1232612 |
On Fri, Sep 25, 2015 at 08:43:31AM +0200, Andrzej Hajda wrote: > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Applied to libata/for-4.4. Thanks. -- tejun -- 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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 02/19] spi: davinci: fix handling platform_get_irq result |
| Message-ID | <qcfnI-5il-33@gated-at.bofh.it> |
| In reply to | #1232114 |
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
drivers/spi/spi-davinci.c | 7 ++++---
1 file changed, 4 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-davinci.c b/drivers/spi/spi-davinci.c
index 3cf9faa..a85d863 100644
--- a/drivers/spi/spi-davinci.c
+++ b/drivers/spi/spi-davinci.c
@@ -992,11 +992,12 @@ static int davinci_spi_probe(struct platform_device *pdev)
goto free_master;
}
- dspi->irq = platform_get_irq(pdev, 0);
- if (dspi->irq <= 0) {
+ ret = platform_get_irq(pdev, 0);
+ if (ret == 0)
ret = -EINVAL;
+ if (ret < 0)
goto free_master;
- }
+ dspi->irq = ret;
ret = devm_request_threaded_irq(&pdev->dev, dspi->irq, davinci_spi_irq,
dummy_thread_fn, 0, dev_name(&pdev->dev), dspi);
--
1.9.1
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 07/19] net: hisilicon: fix handling platform_get_irq result |
| Message-ID | <qcfnI-5il-37@gated-at.bofh.it> |
| In reply to | #1232114 |
The function can return negative value. The problem has been detected using proposed semantic patch scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> --- Hi, To avoid problems with too many mail recipients I have sent whole patchset only to LKML. Anyway patches have no dependencies. Regards Andrzej --- drivers/net/ethernet/hisilicon/hip04_eth.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/hisilicon/hip04_eth.c b/drivers/net/ethernet/hisilicon/hip04_eth.c index cc2d8b4..253f8ed 100644 --- a/drivers/net/ethernet/hisilicon/hip04_eth.c +++ b/drivers/net/ethernet/hisilicon/hip04_eth.c @@ -816,7 +816,7 @@ static int hip04_mac_probe(struct platform_device *pdev) struct net_device *ndev; struct hip04_priv *priv; struct resource *res; - unsigned int irq; + int irq; int ret; ndev = alloc_etherdev(sizeof(struct hip04_priv)); -- 1.9.1 -- 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]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2015-09-27 07:50 +0200 |
| Subject | Re: [PATCH 07/19] net: hisilicon: fix handling platform_get_irq result |
| Message-ID | <qdd0u-6to-11@gated-at.bofh.it> |
| In reply to | #1232118 |
From: Andrzej Hajda <a.hajda@samsung.com> Date: Thu, 24 Sep 2015 16:00:15 +0200 > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Applied. -- 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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 16/19] r8169: fix handling rtl_readphy result |
| Message-ID | <qcfnJ-5il-47@gated-at.bofh.it> |
| In reply to | #1232114 |
The function can return negative value.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
drivers/net/ethernet/realtek/r8169.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/net/ethernet/realtek/r8169.c b/drivers/net/ethernet/realtek/r8169.c
index 2b32e0c..b4f2123 100644
--- a/drivers/net/ethernet/realtek/r8169.c
+++ b/drivers/net/ethernet/realtek/r8169.c
@@ -6081,7 +6081,7 @@ static void rtl_hw_start_8168h_1(struct rtl8169_private *tp)
{
void __iomem *ioaddr = tp->mmio_addr;
struct pci_dev *pdev = tp->pci_dev;
- u16 rg_saw_cnt;
+ int rg_saw_cnt;
u32 data;
static const struct ephy_info e_info_8168h_1[] = {
{ 0x1e, 0x0800, 0x0001 },
--
1.9.1
--
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]
| From | David Miller <davem@davemloft.net> |
|---|---|
| Date | 2015-09-27 07:50 +0200 |
| Subject | Re: [PATCH 16/19] r8169: fix handling rtl_readphy result |
| Message-ID | <qdd0u-6to-15@gated-at.bofh.it> |
| In reply to | #1232119 |
From: Andrzej Hajda <a.hajda@samsung.com> Date: Thu, 24 Sep 2015 16:00:24 +0200 > The function can return negative value. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > > [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107 > > Signed-off-by: Andrzej Hajda <a.hajda@samsung.com> Applied. -- 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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 18/19] mac80211: make ieee80211_new_mesh_header return unsigned |
| Message-ID | <qcfnJ-5il-51@gated-at.bofh.it> |
| In reply to | #1232114 |
The function returns always non-negative values.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
net/mac80211/mesh.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index e06a5ca..09de65a 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -540,7 +540,7 @@ int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
*
* Return the header length.
*/
-int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
+unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
struct ieee80211s_hdr *meshhdr,
const char *addr4or5, const char *addr6)
{
--
1.9.1
--
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]
| From | Johannes Berg <johannes@sipsolutions.net> |
|---|---|
| Date | 2015-09-24 16:20 +0200 |
| Subject | Re: [PATCH 18/19] mac80211: make ieee80211_new_mesh_header return unsigned |
| Message-ID | <qcfxo-5tw-5@gated-at.bofh.it> |
| In reply to | #1232120 |
On Thu, 2015-09-24 at 16:00 +0200, Andrzej Hajda wrote: > The function returns always non-negative values. > > The problem has been detected using proposed semantic patch > scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1]. > You should at least compile your patches. johannes -- 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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-25 08:50 +0200 |
| Subject | [PATCH v2 18/19] mac80211: make ieee80211_new_mesh_header return unsigned |
| Message-ID | <qcuZr-23t-1@gated-at.bofh.it> |
| In reply to | #1232128 |
The function returns always non-negative values.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
v2: added missing declaration change, fixed indentation
---
net/mac80211/mesh.c | 6 +++---
net/mac80211/mesh.h | 6 +++---
2 files changed, 6 insertions(+), 6 deletions(-)
diff --git a/net/mac80211/mesh.c b/net/mac80211/mesh.c
index e06a5ca..90567fc 100644
--- a/net/mac80211/mesh.c
+++ b/net/mac80211/mesh.c
@@ -540,9 +540,9 @@ int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
*
* Return the header length.
*/
-int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
- struct ieee80211s_hdr *meshhdr,
- const char *addr4or5, const char *addr6)
+unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211s_hdr *meshhdr,
+ const char *addr4or5, const char *addr6)
{
if (WARN_ON(!addr4or5 && addr6))
return 0;
diff --git a/net/mac80211/mesh.h b/net/mac80211/mesh.h
index 50c8473..029e41d 100644
--- a/net/mac80211/mesh.h
+++ b/net/mac80211/mesh.h
@@ -207,9 +207,9 @@ struct mesh_rmc {
/* Various */
int ieee80211_fill_mesh_addresses(struct ieee80211_hdr *hdr, __le16 *fc,
const u8 *da, const u8 *sa);
-int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
- struct ieee80211s_hdr *meshhdr,
- const char *addr4or5, const char *addr6);
+unsigned int ieee80211_new_mesh_header(struct ieee80211_sub_if_data *sdata,
+ struct ieee80211s_hdr *meshhdr,
+ const char *addr4or5, const char *addr6);
int mesh_rmc_check(struct ieee80211_sub_if_data *sdata,
const u8 *addr, struct ieee80211s_hdr *mesh_hdr);
bool mesh_matches_local(struct ieee80211_sub_if_data *sdata,
--
1.9.1
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 11/19] clocksource: fix __ftm_clk_init result |
| Message-ID | <qcfnJ-5il-49@gated-at.bofh.it> |
| In reply to | #1232114 |
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 to
return frequency or zero in case of error, for this unsigned long is OK.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
drivers/clocksource/fsl_ftm_timer.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/drivers/clocksource/fsl_ftm_timer.c b/drivers/clocksource/fsl_ftm_timer.c
index ef43469..11a7ae7 100644
--- a/drivers/clocksource/fsl_ftm_timer.c
+++ b/drivers/clocksource/fsl_ftm_timer.c
@@ -248,7 +248,7 @@ static int __init ftm_clocksource_init(unsigned long freq)
return 0;
}
-static int __init __ftm_clk_init(struct device_node *np, char *cnt_name,
+static unsigned long __init __ftm_clk_init(struct device_node *np, char *cnt_name,
char *ftm_name)
{
struct clk *clk;
@@ -257,19 +257,19 @@ static int __init __ftm_clk_init(struct device_node *np, char *cnt_name,
clk = of_clk_get_by_name(np, cnt_name);
if (IS_ERR(clk)) {
pr_err("ftm: Cannot get \"%s\": %ld\n", cnt_name, PTR_ERR(clk));
- return PTR_ERR(clk);
+ return 0;
}
err = clk_prepare_enable(clk);
if (err) {
pr_err("ftm: clock failed to prepare+enable \"%s\": %d\n",
cnt_name, err);
- return err;
+ return 0;
}
clk = of_clk_get_by_name(np, ftm_name);
if (IS_ERR(clk)) {
pr_err("ftm: Cannot get \"%s\": %ld\n", ftm_name, PTR_ERR(clk));
- return PTR_ERR(clk);
+ return 0;
}
err = clk_prepare_enable(clk);
if (err)
--
1.9.1
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-24 16:10 +0200 |
| Subject | [PATCH 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned |
| Message-ID | <qcfnJ-5il-55@gated-at.bofh.it> |
| In reply to | #1232114 |
The function returns always non-negative values.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
Hi,
To avoid problems with too many mail recipients I have sent whole
patchset only to LKML. Anyway patches have no dependencies.
Regards
Andrzej
---
tools/net/bpf_jit_disasm.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/net/bpf_jit_disasm.c b/tools/net/bpf_jit_disasm.c
index 2cd3d4c..b422dbe 100644
--- a/tools/net/bpf_jit_disasm.c
+++ b/tools/net/bpf_jit_disasm.c
@@ -156,7 +156,7 @@ static void put_log_buff(char *buff)
free(buff);
}
-static int get_last_jit_image(char *haystack, size_t hlen,
+static unsigned int get_last_jit_image(char *haystack, size_t hlen,
uint8_t *image, size_t ilen)
{
char *ptr, *pptr, *tmp;
--
1.9.1
--
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]
| From | Daniel Borkmann <daniel@iogearbox.net> |
|---|---|
| Date | 2015-09-24 21:00 +0200 |
| Subject | Re: [PATCH 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned |
| Message-ID | <qcjUm-389-7@gated-at.bofh.it> |
| In reply to | #1232122 |
On 09/24/2015 04:00 PM, Andrzej Hajda wrote:
> The function returns always non-negative values.
>
> The problem has been detected using proposed semantic patch
> scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
>
> [1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
>
> Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
> ---
> Hi,
>
> To avoid problems with too many mail recipients I have sent whole
> patchset only to LKML. Anyway patches have no dependencies.
>
> Regards
> Andrzej
> ---
> tools/net/bpf_jit_disasm.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/tools/net/bpf_jit_disasm.c b/tools/net/bpf_jit_disasm.c
> index 2cd3d4c..b422dbe 100644
> --- a/tools/net/bpf_jit_disasm.c
> +++ b/tools/net/bpf_jit_disasm.c
> @@ -156,7 +156,7 @@ static void put_log_buff(char *buff)
> free(buff);
> }
>
> -static int get_last_jit_image(char *haystack, size_t hlen,
> +static unsigned int get_last_jit_image(char *haystack, size_t hlen,
> uint8_t *image, size_t ilen)
I have no problem if you want to change this, but then please also
fix up the 2nd line's indentation to match the '(' as it was before.
Thanks !
> {
> char *ptr, *pptr, *tmp;
>
--
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]
| From | Andrzej Hajda <a.hajda@samsung.com> |
|---|---|
| Date | 2015-09-25 08:50 +0200 |
| Subject | [PATCH v2 17/19] tools: bpf_jit_disasm: make get_last_jit_image return unsigned |
| Message-ID | <qcuZs-23t-7@gated-at.bofh.it> |
| In reply to | #1232336 |
The function returns always non-negative values.
The problem has been detected using proposed semantic patch
scripts/coccinelle/tests/assign_signed_to_unsigned.cocci [1].
[1]: http://permalink.gmane.org/gmane.linux.kernel/2046107
Signed-off-by: Andrzej Hajda <a.hajda@samsung.com>
---
v2: fixed indentation
---
tools/net/bpf_jit_disasm.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/tools/net/bpf_jit_disasm.c b/tools/net/bpf_jit_disasm.c
index 2cd3d4c..5b32413 100644
--- a/tools/net/bpf_jit_disasm.c
+++ b/tools/net/bpf_jit_disasm.c
@@ -156,8 +156,8 @@ static void put_log_buff(char *buff)
free(buff);
}
-static int get_last_jit_image(char *haystack, size_t hlen,
- uint8_t *image, size_t ilen)
+static unsigned int get_last_jit_image(char *haystack, size_t hlen,
+ uint8_t *image, size_t ilen)
{
char *ptr, *pptr, *tmp;
off_t off = 0;
--
1.9.1
--
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]
Page 1 of 2 [1] 2 Next page →
Back to top | Article view | linux.kernel
csiph-web