* Re: [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c
2018-02-17 7:28 [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c Yash Omer
@ 2018-02-17 12:12 ` Greg KH
2018-02-17 12:13 ` Dan Carpenter
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Greg KH @ 2018-02-17 12:12 UTC (permalink / raw)
To: Yash Omer; +Cc: devel, florian.c.schilhabel, driverdev-devel, Larry.Finger
On Sat, Feb 17, 2018 at 12:58:46PM +0530, Yash Omer wrote:
> This patch fixes up unnecessary parenthesis issue found by checkpatch.pl
>
> Signed-off-by: Yash Omer <yashomer0007@gmail.com>
> ---
> drivers/staging/ks7010/ks_hostif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index 975dbbb3abd0..7bd567e233d7 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -850,7 +850,7 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
> DPRINTK(4, " scan_ind_count=%d :: aplist.size=%d\n",
> priv->scan_ind_count, priv->aplist.size);
> get_ap_information(priv, (struct ap_info_t *)(priv->rxp),
> - &(priv->aplist.ap[priv->scan_ind_count - 1]));
> + &(priv->aplist.ap priv->scan_ind_count - 1));
Did you actually compile this?
Please, step back and go learn the C language first really really well.
The change you made here is obviously not correct at all.
I suggest you work on userspace programs first for a few years before
working on the kernel, it is not a place to learn how to program.
good luck!
greg k-h
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c
2018-02-17 7:28 [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c Yash Omer
2018-02-17 12:12 ` Greg KH
@ 2018-02-17 12:13 ` Dan Carpenter
2018-02-18 15:28 ` kbuild test robot
2018-02-18 15:51 ` kbuild test robot
3 siblings, 0 replies; 7+ messages in thread
From: Dan Carpenter @ 2018-02-17 12:13 UTC (permalink / raw)
To: Yash Omer
Cc: gregkh, devel, florian.c.schilhabel, driverdev-devel, Larry.Finger
On Sat, Feb 17, 2018 at 12:58:46PM +0530, Yash Omer wrote:
> This patch fixes up unnecessary parenthesis issue found by checkpatch.pl
>
> Signed-off-by: Yash Omer <yashomer0007@gmail.com>
> ---
> drivers/staging/ks7010/ks_hostif.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/staging/ks7010/ks_hostif.c b/drivers/staging/ks7010/ks_hostif.c
> index 975dbbb3abd0..7bd567e233d7 100644
> --- a/drivers/staging/ks7010/ks_hostif.c
> +++ b/drivers/staging/ks7010/ks_hostif.c
> @@ -850,7 +850,7 @@ void hostif_scan_indication(struct ks_wlan_private *priv)
> DPRINTK(4, " scan_ind_count=%d :: aplist.size=%d\n",
> priv->scan_ind_count, priv->aplist.size);
> get_ap_information(priv, (struct ap_info_t *)(priv->rxp),
> - &(priv->aplist.ap[priv->scan_ind_count - 1]));
> + &(priv->aplist.ap priv->scan_ind_count - 1));
Yash, you seem like a nice person but this isn't even a vaguely
reasonable change. This isn't valid C. You really need to learn C
before you can make a meaningful contribution to the kernel. :(
regards,
dan carpenter
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c
2018-02-17 7:28 [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c Yash Omer
2018-02-17 12:12 ` Greg KH
2018-02-17 12:13 ` Dan Carpenter
@ 2018-02-18 15:28 ` kbuild test robot
2018-02-18 15:51 ` kbuild test robot
3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2018-02-18 15:28 UTC (permalink / raw)
To: Yash Omer
Cc: devel, florian.c.schilhabel, gregkh, driverdev-devel, kbuild-all,
Larry.Finger
[-- Attachment #1: Type: text/plain, Size: 2811 bytes --]
Hi Yash,
Thank you for the patch! Yet something to improve:
[auto build test ERROR on staging/staging-testing]
[also build test ERROR on v4.16-rc1 next-20180216]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Yash-Omer/Staging-ks7010-Fix-Unnecessary-parentheses-in-ks_hostif-c/20180218-223344
config: i386-randconfig-x017-201807 (attached as .config)
compiler: gcc-7 (Debian 7.3.0-1) 7.3.0
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All errors (new ones prefixed by >>):
drivers/staging/ks7010/ks_hostif.c: In function 'hostif_scan_indication':
>> drivers/staging/ks7010/ks_hostif.c:853:26: error: expected ')' before 'priv'
&(priv->aplist.ap priv->scan_ind_count - 1));
^~~~
>> drivers/staging/ks7010/ks_hostif.c:853:8: error: passing argument 3 of 'get_ap_information' from incompatible pointer type [-Werror=incompatible-pointer-types]
&(priv->aplist.ap priv->scan_ind_count - 1));
^
drivers/staging/ks7010/ks_hostif.c:218:5: note: expected 'struct local_ap_t *' but argument is of type 'struct local_ap_t (*)[32]'
int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
^~~~~~~~~~~~~~~~~~
cc1: some warnings being treated as errors
vim +853 drivers/staging/ks7010/ks_hostif.c
826
827 static
828 void hostif_scan_indication(struct ks_wlan_private *priv)
829 {
830 int i;
831 struct ap_info_t *ap_info;
832
833 DPRINTK(3, "scan_ind_count = %d\n", priv->scan_ind_count);
834 ap_info = (struct ap_info_t *)(priv->rxp);
835
836 if (priv->scan_ind_count) {
837 for (i = 0; i < priv->aplist.size; i++) { /* bssid check */
838 if (memcmp(ap_info->bssid,
839 priv->aplist.ap[i].bssid, ETH_ALEN) != 0)
840 continue;
841
842 if (ap_info->frame_type == FRAME_TYPE_PROBE_RESP)
843 get_ap_information(priv, ap_info,
844 &priv->aplist.ap[i]);
845 return;
846 }
847 }
848 priv->scan_ind_count++;
849 if (priv->scan_ind_count < LOCAL_APLIST_MAX + 1) {
850 DPRINTK(4, " scan_ind_count=%d :: aplist.size=%d\n",
851 priv->scan_ind_count, priv->aplist.size);
852 get_ap_information(priv, (struct ap_info_t *)(priv->rxp),
> 853 &(priv->aplist.ap priv->scan_ind_count - 1));
854 priv->aplist.size = priv->scan_ind_count;
855 } else {
856 DPRINTK(4, " count over :: scan_ind_count=%d\n",
857 priv->scan_ind_count);
858 }
859 }
860
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 32413 bytes --]
[-- Attachment #3: Type: text/plain, Size: 169 bytes --]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c
2018-02-17 7:28 [PATCH] Staging: ks7010: Fix Unnecessary parentheses in ks_hostif.c Yash Omer
` (2 preceding siblings ...)
2018-02-18 15:28 ` kbuild test robot
@ 2018-02-18 15:51 ` kbuild test robot
3 siblings, 0 replies; 7+ messages in thread
From: kbuild test robot @ 2018-02-18 15:51 UTC (permalink / raw)
To: Yash Omer
Cc: devel, florian.c.schilhabel, gregkh, driverdev-devel, kbuild-all,
Larry.Finger
[-- Attachment #1: Type: text/plain, Size: 2741 bytes --]
Hi Yash,
Thank you for the patch! Perhaps something to improve:
[auto build test WARNING on staging/staging-testing]
[also build test WARNING on v4.16-rc1 next-20180216]
[if your patch is applied to the wrong git tree, please drop us a note to help improve the system]
url: https://github.com/0day-ci/linux/commits/Yash-Omer/Staging-ks7010-Fix-Unnecessary-parentheses-in-ks_hostif-c/20180218-223344
config: i386-randconfig-a0-201807 (attached as .config)
compiler: gcc-4.9 (Debian 4.9.4-2) 4.9.4
reproduce:
# save the attached .config to linux build tree
make ARCH=i386
All warnings (new ones prefixed by >>):
drivers/staging/ks7010/ks_hostif.c: In function 'hostif_scan_indication':
drivers/staging/ks7010/ks_hostif.c:853:26: error: expected ')' before 'priv'
&(priv->aplist.ap priv->scan_ind_count - 1));
^
>> drivers/staging/ks7010/ks_hostif.c:853:8: warning: passing argument 3 of 'get_ap_information' from incompatible pointer type
&(priv->aplist.ap priv->scan_ind_count - 1));
^
drivers/staging/ks7010/ks_hostif.c:218:5: note: expected 'struct local_ap_t *' but argument is of type 'struct local_ap_t (*)[32]'
int get_ap_information(struct ks_wlan_private *priv, struct ap_info_t *ap_info,
^
vim +/get_ap_information +853 drivers/staging/ks7010/ks_hostif.c
826
827 static
828 void hostif_scan_indication(struct ks_wlan_private *priv)
829 {
830 int i;
831 struct ap_info_t *ap_info;
832
833 DPRINTK(3, "scan_ind_count = %d\n", priv->scan_ind_count);
834 ap_info = (struct ap_info_t *)(priv->rxp);
835
836 if (priv->scan_ind_count) {
837 for (i = 0; i < priv->aplist.size; i++) { /* bssid check */
838 if (memcmp(ap_info->bssid,
839 priv->aplist.ap[i].bssid, ETH_ALEN) != 0)
840 continue;
841
842 if (ap_info->frame_type == FRAME_TYPE_PROBE_RESP)
843 get_ap_information(priv, ap_info,
844 &priv->aplist.ap[i]);
845 return;
846 }
847 }
848 priv->scan_ind_count++;
849 if (priv->scan_ind_count < LOCAL_APLIST_MAX + 1) {
850 DPRINTK(4, " scan_ind_count=%d :: aplist.size=%d\n",
851 priv->scan_ind_count, priv->aplist.size);
852 get_ap_information(priv, (struct ap_info_t *)(priv->rxp),
> 853 &(priv->aplist.ap priv->scan_ind_count - 1));
854 priv->aplist.size = priv->scan_ind_count;
855 } else {
856 DPRINTK(4, " count over :: scan_ind_count=%d\n",
857 priv->scan_ind_count);
858 }
859 }
860
---
0-DAY kernel test infrastructure Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all Intel Corporation
[-- Attachment #2: .config.gz --]
[-- Type: application/gzip, Size: 31583 bytes --]
[-- Attachment #3: Type: text/plain, Size: 169 bytes --]
_______________________________________________
devel mailing list
devel@linuxdriverproject.org
http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
^ permalink raw reply [flat|nested] 7+ messages in thread