* [PATCH v2] eicon: fix -Warray-bounds warning
@ 2012-02-02 13:20 Danny Kukawka
2012-02-02 13:20 ` [PATCH] cs5535-mfgpt: don't call __init function from __devinit Danny Kukawka
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Danny Kukawka @ 2012-02-02 13:20 UTC (permalink / raw)
To: Armin Schindler
Cc: Danny Kukawka, linux-kernel, netdev, Karsten Keil, Ben Hutchings,
David Laight
Fix for a -Warray-bounds warning. mixer_notify_update() tries to
write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
structs is defined as byte structs[1]. Set all 'structs' which are
part of the typdefs in the info union to 'byte structs[0]'.
v2: set all info.*.structs to byte structs[0]
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/isdn/hardware/eicon/capi20.h | 60 +++++++++++++++++-----------------
1 files changed, 30 insertions(+), 30 deletions(-)
diff --git a/drivers/isdn/hardware/eicon/capi20.h b/drivers/isdn/hardware/eicon/capi20.h
index 7ebcccd..27ecd61 100644
--- a/drivers/isdn/hardware/eicon/capi20.h
+++ b/drivers/isdn/hardware/eicon/capi20.h
@@ -117,7 +117,7 @@ typedef struct api_profile_s {
/*------------------------------------------------------------------*/
/* ALERT-REQUEST */
typedef struct {
- byte structs[1]; /* Additional Info */
+ byte structs[0]; /* Additional Info */
} _ALT_REQP;
/* ALERT-CONFIRM */
typedef struct {
@@ -126,7 +126,7 @@ typedef struct {
/* CONNECT-REQUEST */
typedef struct {
word CIP_Value;
- byte structs[1]; /* Called party number,
+ byte structs[0]; /* Called party number,
Called party subaddress,
Calling party number,
Calling party subaddress,
@@ -143,7 +143,7 @@ typedef struct {
/* CONNECT-INDICATION */
typedef struct {
word CIP_Value;
- byte structs[1]; /* Called party number,
+ byte structs[0]; /* Called party number,
Called party subaddress,
Calling party number,
Calling party subaddress,
@@ -155,24 +155,24 @@ typedef struct {
/* CONNECT-RESPONSE */
typedef struct {
word Accept;
- byte structs[1]; /* B_protocol,
+ byte structs[0]; /* B_protocol,
Connected party number,
Connected party subaddress,
LLC */
} _CON_RESP;
/* CONNECT-ACTIVE-INDICATION */
typedef struct {
- byte structs[1]; /* Connected party number,
+ byte structs[0]; /* Connected party number,
Connected party subaddress,
LLC */
} _CON_A_INDP;
/* CONNECT-ACTIVE-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _CON_A_RESP;
/* DISCONNECT-REQUEST */
typedef struct {
- byte structs[1]; /* Additional Info */
+ byte structs[0]; /* Additional Info */
} _DIS_REQP;
/* DISCONNECT-CONFIRM */
typedef struct {
@@ -184,13 +184,13 @@ typedef struct {
} _DIS_INDP;
/* DISCONNECT-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _DIS_RESP;
/* LISTEN-REQUEST */
typedef struct {
dword Info_Mask;
dword CIP_Mask;
- byte structs[1]; /* Calling party number,
+ byte structs[0]; /* Calling party number,
Calling party subaddress */
} _LIS_REQP;
/* LISTEN-CONFIRM */
@@ -199,7 +199,7 @@ typedef struct {
} _LIS_CONP;
/* INFO-REQUEST */
typedef struct {
- byte structs[1]; /* Called party number,
+ byte structs[0]; /* Called party number,
Additional Info */
} _INF_REQP;
/* INFO-CONFIRM */
@@ -209,15 +209,15 @@ typedef struct {
/* INFO-INDICATION */
typedef struct {
word Number;
- byte structs[1]; /* Info element */
+ byte structs[0]; /* Info element */
} _INF_INDP;
/* INFO-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _INF_RESP;
/* SELECT-B-REQUEST */
typedef struct {
- byte structs[1]; /* B-protocol */
+ byte structs[0]; /* B-protocol */
} _SEL_B_REQP;
/* SELECT-B-CONFIRM */
typedef struct {
@@ -226,7 +226,7 @@ typedef struct {
/* FACILITY-REQUEST */
typedef struct {
word Selector;
- byte structs[1]; /* Facility parameters */
+ byte structs[0]; /* Facility parameters */
} _FAC_REQP;
/* FACILITY-CONFIRM STRUCT FOR SUPPLEMENT. SERVICES */
typedef struct {
@@ -240,21 +240,21 @@ typedef struct {
typedef struct {
word Info;
word Selector;
- byte structs[1]; /* Facility parameters */
+ byte structs[0]; /* Facility parameters */
} _FAC_CONP;
/* FACILITY-INDICATION */
typedef struct {
word Selector;
- byte structs[1]; /* Facility parameters */
+ byte structs[0]; /* Facility parameters */
} _FAC_INDP;
/* FACILITY-RESPONSE */
typedef struct {
word Selector;
- byte structs[1]; /* Facility parameters */
+ byte structs[0]; /* Facility parameters */
} _FAC_RESP;
/* CONNECT-B3-REQUEST */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_REQP;
/* CONNECT-B3-CONFIRM */
typedef struct {
@@ -262,24 +262,24 @@ typedef struct {
} _CON_B3_CONP;
/* CONNECT-B3-INDICATION */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_INDP;
/* CONNECT-B3-RESPONSE */
typedef struct {
word Accept;
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_RESP;
/* CONNECT-B3-ACTIVE-INDICATION */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_A_INDP;
/* CONNECT-B3-ACTIVE-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _CON_B3_A_RESP;
/* DISCONNECT-B3-REQUEST */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _DIS_B3_REQP;
/* DISCONNECT-B3-CONFIRM */
typedef struct {
@@ -288,11 +288,11 @@ typedef struct {
/* DISCONNECT-B3-INDICATION */
typedef struct {
word Info;
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _DIS_B3_INDP;
/* DISCONNECT-B3-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _DIS_B3_RESP;
/* DATA-B3-REQUEST */
typedef struct {
@@ -335,7 +335,7 @@ typedef struct {
} _DAT_B3_RESP;
/* RESET-B3-REQUEST */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _RES_B3_REQP;
/* RESET-B3-CONFIRM */
typedef struct {
@@ -343,20 +343,20 @@ typedef struct {
} _RES_B3_CONP;
/* RESET-B3-INDICATION */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _RES_B3_INDP;
/* RESET-B3-RESPONSE */
typedef struct {
- byte structs[1]; /* empty */
+ byte structs[0]; /* empty */
} _RES_B3_RESP;
/* CONNECT-B3-T90-ACTIVE-INDICATION */
typedef struct {
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_T90_A_INDP;
/* CONNECT-B3-T90-ACTIVE-RESPONSE */
typedef struct {
word Reject;
- byte structs[1]; /* NCPI */
+ byte structs[0]; /* NCPI */
} _CON_B3_T90_A_RESP;
/*------------------------------------------------------------------*/
/* message structure */
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] cs5535-mfgpt: don't call __init function from __devinit
2012-02-02 13:20 [PATCH v2] eicon: fix -Warray-bounds warning Danny Kukawka
@ 2012-02-02 13:20 ` Danny Kukawka
2012-02-06 22:48 ` Andres Salomon
2012-02-02 13:20 ` [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver Danny Kukawka
2012-02-02 19:50 ` [PATCH v2] eicon: fix -Warray-bounds warning David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Danny Kukawka @ 2012-02-02 13:20 UTC (permalink / raw)
To: linux-kernel
Cc: Danny Kukawka, Arnd Bergmann, Greg Kroah-Hartman, Andres Salomon
Fix scan_timers() to be __devinit and not __init since
the function get called from cs5535_mfgpt_probe which is
__devinit.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/misc/cs5535-mfgpt.c | 2 +-
1 files changed, 1 insertions(+), 1 deletions(-)
diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c
index bc685bf..87a390d 100644
--- a/drivers/misc/cs5535-mfgpt.c
+++ b/drivers/misc/cs5535-mfgpt.c
@@ -262,7 +262,7 @@ static void __init reset_all_timers(void)
* In other cases (such as with VSAless OpenFirmware), the system firmware
* leaves timers available for us to use.
*/
-static int __init scan_timers(struct cs5535_mfgpt_chip *mfgpt)
+static int __devinit scan_timers(struct cs5535_mfgpt_chip *mfgpt)
{
struct cs5535_mfgpt_timer timer = { .chip = mfgpt };
unsigned long flags;
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver
2012-02-02 13:20 [PATCH v2] eicon: fix -Warray-bounds warning Danny Kukawka
2012-02-02 13:20 ` [PATCH] cs5535-mfgpt: don't call __init function from __devinit Danny Kukawka
@ 2012-02-02 13:20 ` Danny Kukawka
2012-02-02 18:30 ` Grant Likely
2012-02-02 19:50 ` [PATCH v2] eicon: fix -Warray-bounds warning David Miller
2 siblings, 1 reply; 6+ messages in thread
From: Danny Kukawka @ 2012-02-02 13:20 UTC (permalink / raw)
To: Grant Likely; +Cc: Danny Kukawka, spi-devel-general, linux-kernel
Rename static struct pci_driver pch_spi_pcidev to
pch_spi_pcidev_driver to get rid of warnings from modpost checks.
Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
---
drivers/spi/spi-topcliff-pch.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
index 2a6429d..10182eb 100644
--- a/drivers/spi/spi-topcliff-pch.c
+++ b/drivers/spi/spi-topcliff-pch.c
@@ -1720,7 +1720,7 @@ static int pch_spi_resume(struct pci_dev *pdev)
#endif
-static struct pci_driver pch_spi_pcidev = {
+static struct pci_driver pch_spi_pcidev_driver = {
.name = "pch_spi",
.id_table = pch_spi_pcidev_id,
.probe = pch_spi_probe,
@@ -1736,7 +1736,7 @@ static int __init pch_spi_init(void)
if (ret)
return ret;
- ret = pci_register_driver(&pch_spi_pcidev);
+ ret = pci_register_driver(&pch_spi_pcidev_driver);
if (ret)
return ret;
@@ -1746,7 +1746,7 @@ module_init(pch_spi_init);
static void __exit pch_spi_exit(void)
{
- pci_unregister_driver(&pch_spi_pcidev);
+ pci_unregister_driver(&pch_spi_pcidev_driver);
platform_driver_unregister(&pch_spi_pd_driver);
}
module_exit(pch_spi_exit);
--
1.7.7.3
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver
2012-02-02 13:20 ` [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver Danny Kukawka
@ 2012-02-02 18:30 ` Grant Likely
0 siblings, 0 replies; 6+ messages in thread
From: Grant Likely @ 2012-02-02 18:30 UTC (permalink / raw)
To: Danny Kukawka; +Cc: Danny Kukawka, spi-devel-general, linux-kernel
On Thu, Feb 02, 2012 at 02:20:30PM +0100, Danny Kukawka wrote:
> Rename static struct pci_driver pch_spi_pcidev to
> pch_spi_pcidev_driver to get rid of warnings from modpost checks.
>
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Merged, thanks.
g.
> ---
> drivers/spi/spi-topcliff-pch.c | 6 +++---
> 1 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/drivers/spi/spi-topcliff-pch.c b/drivers/spi/spi-topcliff-pch.c
> index 2a6429d..10182eb 100644
> --- a/drivers/spi/spi-topcliff-pch.c
> +++ b/drivers/spi/spi-topcliff-pch.c
> @@ -1720,7 +1720,7 @@ static int pch_spi_resume(struct pci_dev *pdev)
>
> #endif
>
> -static struct pci_driver pch_spi_pcidev = {
> +static struct pci_driver pch_spi_pcidev_driver = {
> .name = "pch_spi",
> .id_table = pch_spi_pcidev_id,
> .probe = pch_spi_probe,
> @@ -1736,7 +1736,7 @@ static int __init pch_spi_init(void)
> if (ret)
> return ret;
>
> - ret = pci_register_driver(&pch_spi_pcidev);
> + ret = pci_register_driver(&pch_spi_pcidev_driver);
> if (ret)
> return ret;
>
> @@ -1746,7 +1746,7 @@ module_init(pch_spi_init);
>
> static void __exit pch_spi_exit(void)
> {
> - pci_unregister_driver(&pch_spi_pcidev);
> + pci_unregister_driver(&pch_spi_pcidev_driver);
> platform_driver_unregister(&pch_spi_pd_driver);
> }
> module_exit(pch_spi_exit);
> --
> 1.7.7.3
>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH v2] eicon: fix -Warray-bounds warning
2012-02-02 13:20 [PATCH v2] eicon: fix -Warray-bounds warning Danny Kukawka
2012-02-02 13:20 ` [PATCH] cs5535-mfgpt: don't call __init function from __devinit Danny Kukawka
2012-02-02 13:20 ` [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver Danny Kukawka
@ 2012-02-02 19:50 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2012-02-02 19:50 UTC (permalink / raw)
To: danny.kukawka
Cc: mac, dkukawka, linux-kernel, netdev, isdn, bhutchings,
David.Laight
From: Danny Kukawka <danny.kukawka@bisect.de>
Date: Thu, 2 Feb 2012 14:20:28 +0100
> Fix for a -Warray-bounds warning. mixer_notify_update() tries to
> write to ((CAPI_MSG *) msg)->info.facility_req.structs[3] while
> structs is defined as byte structs[1]. Set all 'structs' which are
> part of the typdefs in the info union to 'byte structs[0]'.
>
> v2: set all info.*.structs to byte structs[0]
>
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
Applied, thanks.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH] cs5535-mfgpt: don't call __init function from __devinit
2012-02-02 13:20 ` [PATCH] cs5535-mfgpt: don't call __init function from __devinit Danny Kukawka
@ 2012-02-06 22:48 ` Andres Salomon
0 siblings, 0 replies; 6+ messages in thread
From: Andres Salomon @ 2012-02-06 22:48 UTC (permalink / raw)
To: Danny Kukawka
Cc: linux-kernel, Danny Kukawka, Arnd Bergmann, Greg Kroah-Hartman
On Thu, 2 Feb 2012 14:20:29 +0100
Danny Kukawka <danny.kukawka@bisect.de> wrote:
> Fix scan_timers() to be __devinit and not __init since
> the function get called from cs5535_mfgpt_probe which is
> __devinit.
You are correct that it should be devinit; however, it's incomplete.
cs5535_mfgpt_probe calls scan_timers which calls reset_all_timers.. All
of those should be devinit.
>
> Signed-off-by: Danny Kukawka <danny.kukawka@bisect.de>
> ---
> drivers/misc/cs5535-mfgpt.c | 2 +-
> 1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/drivers/misc/cs5535-mfgpt.c b/drivers/misc/cs5535-mfgpt.c
> index bc685bf..87a390d 100644
> --- a/drivers/misc/cs5535-mfgpt.c
> +++ b/drivers/misc/cs5535-mfgpt.c
> @@ -262,7 +262,7 @@ static void __init reset_all_timers(void)
> * In other cases (such as with VSAless OpenFirmware), the system
> firmware
> * leaves timers available for us to use.
> */
> -static int __init scan_timers(struct cs5535_mfgpt_chip *mfgpt)
> +static int __devinit scan_timers(struct cs5535_mfgpt_chip *mfgpt)
> {
> struct cs5535_mfgpt_timer timer = { .chip = mfgpt };
> unsigned long flags;
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2012-02-06 22:48 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-02-02 13:20 [PATCH v2] eicon: fix -Warray-bounds warning Danny Kukawka
2012-02-02 13:20 ` [PATCH] cs5535-mfgpt: don't call __init function from __devinit Danny Kukawka
2012-02-06 22:48 ` Andres Salomon
2012-02-02 13:20 ` [PATCH] spi-topcliff-pch: rename pch_spi_pcidev to pch_spi_pcidev_driver Danny Kukawka
2012-02-02 18:30 ` Grant Likely
2012-02-02 19:50 ` [PATCH v2] eicon: fix -Warray-bounds warning David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.