Re: [Intel-gfx] xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-29 Thread Gaston Gonzalez
On Fri, Oct 28, 2016 at 07:23:24PM +0300, Ville Syrjälä wrote:
> On Fri, Oct 28, 2016 at 11:53:40AM -0400, Greg KH wrote:
> > On Fri, Oct 07, 2016 at 10:38:17AM -0300, Gaston Gonzalez wrote:
> > > On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> > > > On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > > > > Hi,
> > > > > 
> > > > > After hibernation I get the following error when I tried to connect 
> > > > > to monitor
> > > > > through hdmi:
> > > > > 
> > > > > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > > > > xrandr: Configure crtc 1 failed
> > > > > 
> > > > > This does not happen in kernel in kernel v4.6.7 but do happen in 
> > > > > kernels v4.7.4
> > > > > and v4.8.0
> > > > 
> > > > Ah, can you use 'git bisect' to track down the offending patch?
> > > > 
> > > > Also, if you let the graphics driver authors know, they are probably the
> > > > best ones to help out with this, not the "generic" stable mailing list.
> > > > 
> > > > thanks,
> > > > 
> > > > greg k-h
> > > 
> > > Hello,
> > > 
> > > The culprit commit seems to be:
> > > 
> > > commit: ed4a6a7
> > > drm/i915: Add two-stage ILK-style watermark programming
> > > 
> > > Attached the bisection log.
> > > 
> > > Let me know if additional test or bisect is needed.
> > > 
> > > Best regards,
> > > 
> > > Gaston
> > 
> > > git bisect start '--' 'drivers/gpu/drm/'
> > > # good: [096998b11906dd79df5af4d688c9974342dd09f2] Linux 4.6.7
> > > git bisect good 096998b11906dd79df5af4d688c9974342dd09f2
> > > # bad: [c8d2bc9bc39ebea8437fd974fdbc21847bb897a3] Linux 4.8
> > > git bisect bad c8d2bc9bc39ebea8437fd974fdbc21847bb897a3
> > > # good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
> > > git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
> > > # bad: [3c85f20a289d044f303f473ee6ab7502303fc3b0] Merge tag 'omapdrm-4.8' 
> > > of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next
> > > git bisect bad 3c85f20a289d044f303f473ee6ab7502303fc3b0
> > > # bad: [a64424d722504926f3375bc4887976e3bfe3a01d] Merge branch 
> > > 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux into drm-next
> > > git bisect bad a64424d722504926f3375bc4887976e3bfe3a01d
> > > # bad: [b5bf0f1ea3658254bd72ef64abc97786e8a32255] drm/exynos: clean up 
> > > register definions for fimd and decon
> > > git bisect bad b5bf0f1ea3658254bd72ef64abc97786e8a32255
> > > # bad: [27878ede4fec7b929c3010710ba4d55c617c621d] drm/i915: Throw out 
> > > BUGs from DPLL/PCH functions
> > > git bisect bad 27878ede4fec7b929c3010710ba4d55c617c621d
> > > # bad: [72341af4285ae1337c0dfdfa3e68318b52b8757c] drm/i915: hide away VBT 
> > > private data in a separate header
> > > git bisect bad 72341af4285ae1337c0dfdfa3e68318b52b8757c
> > > # bad: [71f0a626143368b8aead361ffaff7e36d043fd8e] drm/i915: Only use 
> > > sanitized values for ILK watermarks
> > > git bisect bad 71f0a626143368b8aead361ffaff7e36d043fd8e
> > > # bad: [66e2c4c39cc37beaccc24c9d14c75d627fce9cf4] drm/i915/gen9: Disable 
> > > DC states if power well support is disabled
> > > git bisect bad 66e2c4c39cc37beaccc24c9d14c75d627fce9cf4
> > > # bad: [4f2d9934bd6ac73950832c96b385822846670668] drm/i915: Pass 
> > > drm_frambuffer to intel_compute_page_offset()
> > > git bisect bad 4f2d9934bd6ac73950832c96b385822846670668
> > > # bad: [1d5bf5d9d9ef0c1e639d36178a224d83888c5a29] drm/i915: Add missing 
> > > NULL check before calling initial_watermarks
> > > git bisect bad 1d5bf5d9d9ef0c1e639d36178a224d83888c5a29
> > > # bad: [d9f8e52b22454a30aaaf26b7ef029598b30abf8e] drm/i915: remove dead 
> > > code
> > > git bisect bad d9f8e52b22454a30aaaf26b7ef029598b30abf8e
> > > # bad: [c3454d575da162cd310d9b83696baefb29d10a70] drm/i915: remove left 
> > > over dead code
> > > git bisect bad c3454d575da162cd310d9b83696baefb29d10a70
> > > # bad: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add two-stage 
> > > ILK-style watermark programming (v11)
> > > git bisect bad ed4a6a7ca853253f9b86f3005d76345482a71283
> > > # first bad commit: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: 
> > > Add two-stage ILK-style wa

Re: [Intel-gfx] xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-29 Thread Gaston Gonzalez
On Fri, Oct 28, 2016 at 07:23:24PM +0300, Ville Syrjälä wrote:
> On Fri, Oct 28, 2016 at 11:53:40AM -0400, Greg KH wrote:
> > On Fri, Oct 07, 2016 at 10:38:17AM -0300, Gaston Gonzalez wrote:
> > > On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> > > > On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > > > > Hi,
> > > > > 
> > > > > After hibernation I get the following error when I tried to connect 
> > > > > to monitor
> > > > > through hdmi:
> > > > > 
> > > > > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > > > > xrandr: Configure crtc 1 failed
> > > > > 
> > > > > This does not happen in kernel in kernel v4.6.7 but do happen in 
> > > > > kernels v4.7.4
> > > > > and v4.8.0
> > > > 
> > > > Ah, can you use 'git bisect' to track down the offending patch?
> > > > 
> > > > Also, if you let the graphics driver authors know, they are probably the
> > > > best ones to help out with this, not the "generic" stable mailing list.
> > > > 
> > > > thanks,
> > > > 
> > > > greg k-h
> > > 
> > > Hello,
> > > 
> > > The culprit commit seems to be:
> > > 
> > > commit: ed4a6a7
> > > drm/i915: Add two-stage ILK-style watermark programming
> > > 
> > > Attached the bisection log.
> > > 
> > > Let me know if additional test or bisect is needed.
> > > 
> > > Best regards,
> > > 
> > > Gaston
> > 
> > > git bisect start '--' 'drivers/gpu/drm/'
> > > # good: [096998b11906dd79df5af4d688c9974342dd09f2] Linux 4.6.7
> > > git bisect good 096998b11906dd79df5af4d688c9974342dd09f2
> > > # bad: [c8d2bc9bc39ebea8437fd974fdbc21847bb897a3] Linux 4.8
> > > git bisect bad c8d2bc9bc39ebea8437fd974fdbc21847bb897a3
> > > # good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
> > > git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
> > > # bad: [3c85f20a289d044f303f473ee6ab7502303fc3b0] Merge tag 'omapdrm-4.8' 
> > > of git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next
> > > git bisect bad 3c85f20a289d044f303f473ee6ab7502303fc3b0
> > > # bad: [a64424d722504926f3375bc4887976e3bfe3a01d] Merge branch 
> > > 'drm-next-4.7' of git://people.freedesktop.org/~agd5f/linux into drm-next
> > > git bisect bad a64424d722504926f3375bc4887976e3bfe3a01d
> > > # bad: [b5bf0f1ea3658254bd72ef64abc97786e8a32255] drm/exynos: clean up 
> > > register definions for fimd and decon
> > > git bisect bad b5bf0f1ea3658254bd72ef64abc97786e8a32255
> > > # bad: [27878ede4fec7b929c3010710ba4d55c617c621d] drm/i915: Throw out 
> > > BUGs from DPLL/PCH functions
> > > git bisect bad 27878ede4fec7b929c3010710ba4d55c617c621d
> > > # bad: [72341af4285ae1337c0dfdfa3e68318b52b8757c] drm/i915: hide away VBT 
> > > private data in a separate header
> > > git bisect bad 72341af4285ae1337c0dfdfa3e68318b52b8757c
> > > # bad: [71f0a626143368b8aead361ffaff7e36d043fd8e] drm/i915: Only use 
> > > sanitized values for ILK watermarks
> > > git bisect bad 71f0a626143368b8aead361ffaff7e36d043fd8e
> > > # bad: [66e2c4c39cc37beaccc24c9d14c75d627fce9cf4] drm/i915/gen9: Disable 
> > > DC states if power well support is disabled
> > > git bisect bad 66e2c4c39cc37beaccc24c9d14c75d627fce9cf4
> > > # bad: [4f2d9934bd6ac73950832c96b385822846670668] drm/i915: Pass 
> > > drm_frambuffer to intel_compute_page_offset()
> > > git bisect bad 4f2d9934bd6ac73950832c96b385822846670668
> > > # bad: [1d5bf5d9d9ef0c1e639d36178a224d83888c5a29] drm/i915: Add missing 
> > > NULL check before calling initial_watermarks
> > > git bisect bad 1d5bf5d9d9ef0c1e639d36178a224d83888c5a29
> > > # bad: [d9f8e52b22454a30aaaf26b7ef029598b30abf8e] drm/i915: remove dead 
> > > code
> > > git bisect bad d9f8e52b22454a30aaaf26b7ef029598b30abf8e
> > > # bad: [c3454d575da162cd310d9b83696baefb29d10a70] drm/i915: remove left 
> > > over dead code
> > > git bisect bad c3454d575da162cd310d9b83696baefb29d10a70
> > > # bad: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add two-stage 
> > > ILK-style watermark programming (v11)
> > > git bisect bad ed4a6a7ca853253f9b86f3005d76345482a71283
> > > # first bad commit: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: 
> > > Add two-stage ILK-style wa

Re: xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-07 Thread Gaston Gonzalez
On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > Hi,
> > 
> > After hibernation I get the following error when I tried to connect to 
> > monitor
> > through hdmi:
> > 
> > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > xrandr: Configure crtc 1 failed
> > 
> > This does not happen in kernel in kernel v4.6.7 but do happen in kernels 
> > v4.7.4
> > and v4.8.0
> 
> Ah, can you use 'git bisect' to track down the offending patch?
> 
> Also, if you let the graphics driver authors know, they are probably the
> best ones to help out with this, not the "generic" stable mailing list.
> 
> thanks,
> 
> greg k-h

Hello,

The culprit commit seems to be:

commit: ed4a6a7
drm/i915: Add two-stage ILK-style watermark programming

Attached the bisection log.

Let me know if additional test or bisect is needed.

Best regards,

Gaston
git bisect start '--' 'drivers/gpu/drm/'
# good: [096998b11906dd79df5af4d688c9974342dd09f2] Linux 4.6.7
git bisect good 096998b11906dd79df5af4d688c9974342dd09f2
# bad: [c8d2bc9bc39ebea8437fd974fdbc21847bb897a3] Linux 4.8
git bisect bad c8d2bc9bc39ebea8437fd974fdbc21847bb897a3
# good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
# bad: [3c85f20a289d044f303f473ee6ab7502303fc3b0] Merge tag 'omapdrm-4.8' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next
git bisect bad 3c85f20a289d044f303f473ee6ab7502303fc3b0
# bad: [a64424d722504926f3375bc4887976e3bfe3a01d] Merge branch 'drm-next-4.7' 
of git://people.freedesktop.org/~agd5f/linux into drm-next
git bisect bad a64424d722504926f3375bc4887976e3bfe3a01d
# bad: [b5bf0f1ea3658254bd72ef64abc97786e8a32255] drm/exynos: clean up register 
definions for fimd and decon
git bisect bad b5bf0f1ea3658254bd72ef64abc97786e8a32255
# bad: [27878ede4fec7b929c3010710ba4d55c617c621d] drm/i915: Throw out BUGs from 
DPLL/PCH functions
git bisect bad 27878ede4fec7b929c3010710ba4d55c617c621d
# bad: [72341af4285ae1337c0dfdfa3e68318b52b8757c] drm/i915: hide away VBT 
private data in a separate header
git bisect bad 72341af4285ae1337c0dfdfa3e68318b52b8757c
# bad: [71f0a626143368b8aead361ffaff7e36d043fd8e] drm/i915: Only use sanitized 
values for ILK watermarks
git bisect bad 71f0a626143368b8aead361ffaff7e36d043fd8e
# bad: [66e2c4c39cc37beaccc24c9d14c75d627fce9cf4] drm/i915/gen9: Disable DC 
states if power well support is disabled
git bisect bad 66e2c4c39cc37beaccc24c9d14c75d627fce9cf4
# bad: [4f2d9934bd6ac73950832c96b385822846670668] drm/i915: Pass drm_frambuffer 
to intel_compute_page_offset()
git bisect bad 4f2d9934bd6ac73950832c96b385822846670668
# bad: [1d5bf5d9d9ef0c1e639d36178a224d83888c5a29] drm/i915: Add missing NULL 
check before calling initial_watermarks
git bisect bad 1d5bf5d9d9ef0c1e639d36178a224d83888c5a29
# bad: [d9f8e52b22454a30aaaf26b7ef029598b30abf8e] drm/i915: remove dead code
git bisect bad d9f8e52b22454a30aaaf26b7ef029598b30abf8e
# bad: [c3454d575da162cd310d9b83696baefb29d10a70] drm/i915: remove left over 
dead code
git bisect bad c3454d575da162cd310d9b83696baefb29d10a70
# bad: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add two-stage 
ILK-style watermark programming (v11)
git bisect bad ed4a6a7ca853253f9b86f3005d76345482a71283
# first bad commit: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add 
two-stage ILK-style watermark programming (v11)


Re: xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-07 Thread Gaston Gonzalez
On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > Hi,
> > 
> > After hibernation I get the following error when I tried to connect to 
> > monitor
> > through hdmi:
> > 
> > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > xrandr: Configure crtc 1 failed
> > 
> > This does not happen in kernel in kernel v4.6.7 but do happen in kernels 
> > v4.7.4
> > and v4.8.0
> 
> Ah, can you use 'git bisect' to track down the offending patch?
> 
> Also, if you let the graphics driver authors know, they are probably the
> best ones to help out with this, not the "generic" stable mailing list.
> 
> thanks,
> 
> greg k-h

Hello,

The culprit commit seems to be:

commit: ed4a6a7
drm/i915: Add two-stage ILK-style watermark programming

Attached the bisection log.

Let me know if additional test or bisect is needed.

Best regards,

Gaston
git bisect start '--' 'drivers/gpu/drm/'
# good: [096998b11906dd79df5af4d688c9974342dd09f2] Linux 4.6.7
git bisect good 096998b11906dd79df5af4d688c9974342dd09f2
# bad: [c8d2bc9bc39ebea8437fd974fdbc21847bb897a3] Linux 4.8
git bisect bad c8d2bc9bc39ebea8437fd974fdbc21847bb897a3
# good: [2dcd0af568b0cf583645c8a317dd12e344b1c72a] Linux 4.6
git bisect good 2dcd0af568b0cf583645c8a317dd12e344b1c72a
# bad: [3c85f20a289d044f303f473ee6ab7502303fc3b0] Merge tag 'omapdrm-4.8' of 
git://git.kernel.org/pub/scm/linux/kernel/git/tomba/linux into drm-next
git bisect bad 3c85f20a289d044f303f473ee6ab7502303fc3b0
# bad: [a64424d722504926f3375bc4887976e3bfe3a01d] Merge branch 'drm-next-4.7' 
of git://people.freedesktop.org/~agd5f/linux into drm-next
git bisect bad a64424d722504926f3375bc4887976e3bfe3a01d
# bad: [b5bf0f1ea3658254bd72ef64abc97786e8a32255] drm/exynos: clean up register 
definions for fimd and decon
git bisect bad b5bf0f1ea3658254bd72ef64abc97786e8a32255
# bad: [27878ede4fec7b929c3010710ba4d55c617c621d] drm/i915: Throw out BUGs from 
DPLL/PCH functions
git bisect bad 27878ede4fec7b929c3010710ba4d55c617c621d
# bad: [72341af4285ae1337c0dfdfa3e68318b52b8757c] drm/i915: hide away VBT 
private data in a separate header
git bisect bad 72341af4285ae1337c0dfdfa3e68318b52b8757c
# bad: [71f0a626143368b8aead361ffaff7e36d043fd8e] drm/i915: Only use sanitized 
values for ILK watermarks
git bisect bad 71f0a626143368b8aead361ffaff7e36d043fd8e
# bad: [66e2c4c39cc37beaccc24c9d14c75d627fce9cf4] drm/i915/gen9: Disable DC 
states if power well support is disabled
git bisect bad 66e2c4c39cc37beaccc24c9d14c75d627fce9cf4
# bad: [4f2d9934bd6ac73950832c96b385822846670668] drm/i915: Pass drm_frambuffer 
to intel_compute_page_offset()
git bisect bad 4f2d9934bd6ac73950832c96b385822846670668
# bad: [1d5bf5d9d9ef0c1e639d36178a224d83888c5a29] drm/i915: Add missing NULL 
check before calling initial_watermarks
git bisect bad 1d5bf5d9d9ef0c1e639d36178a224d83888c5a29
# bad: [d9f8e52b22454a30aaaf26b7ef029598b30abf8e] drm/i915: remove dead code
git bisect bad d9f8e52b22454a30aaaf26b7ef029598b30abf8e
# bad: [c3454d575da162cd310d9b83696baefb29d10a70] drm/i915: remove left over 
dead code
git bisect bad c3454d575da162cd310d9b83696baefb29d10a70
# bad: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add two-stage 
ILK-style watermark programming (v11)
git bisect bad ed4a6a7ca853253f9b86f3005d76345482a71283
# first bad commit: [ed4a6a7ca853253f9b86f3005d76345482a71283] drm/i915: Add 
two-stage ILK-style watermark programming (v11)


Re: xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-05 Thread Gaston Gonzalez
On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > Hi,
> > 
> > After hibernation I get the following error when I tried to connect to 
> > monitor
> > through hdmi:
> > 
> > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > xrandr: Configure crtc 1 failed
> > 
> > This does not happen in kernel in kernel v4.6.7 but do happen in kernels 
> > v4.7.4
> > and v4.8.0
> 
> Ah, can you use 'git bisect' to track down the offending patch?
> 
> Also, if you let the graphics driver authors know, they are probably the
> best ones to help out with this, not the "generic" stable mailing list.
> 
> thanks,
> 
> greg k-h

Ok, I'll bisect this between v4.6.7 and v4.7.4

Added intel-...@lists.freedesktop.org in CC.

regards,

Gaston



Re: xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-05 Thread Gaston Gonzalez
On Wed, Oct 05, 2016 at 07:23:23AM +0200, Greg KH wrote:
> On Tue, Oct 04, 2016 at 08:43:03PM -0300, Gaston Gonzalez wrote:
> > Hi,
> > 
> > After hibernation I get the following error when I tried to connect to 
> > monitor
> > through hdmi:
> > 
> > $ xrandr --output LVDS1 --off  --output  HDMI1 --auto
> > xrandr: Configure crtc 1 failed
> > 
> > This does not happen in kernel in kernel v4.6.7 but do happen in kernels 
> > v4.7.4
> > and v4.8.0
> 
> Ah, can you use 'git bisect' to track down the offending patch?
> 
> Also, if you let the graphics driver authors know, they are probably the
> best ones to help out with this, not the "generic" stable mailing list.
> 
> thanks,
> 
> greg k-h

Ok, I'll bisect this between v4.6.7 and v4.7.4

Added intel-...@lists.freedesktop.org in CC.

regards,

Gaston



xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-04 Thread Gaston Gonzalez
Hi,

After hibernation I get the following error when I tried to connect to monitor
through hdmi:

$ xrandr --output LVDS1 --off  --output  HDMI1 --auto
xrandr: Configure crtc 1 failed

This does not happen in kernel in kernel v4.6.7 but do happen in kernels v4.7.4
and v4.8.0

I don't see anything related to this in the kernel log.

This happens after hibernation but not after suspend to ram.

I use a Thinkpad T430 

$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor
Graphics Controller (rev 09)

regards,

Gaston


xrandr fails after resume from hibernation in kernels 4.7.4 and 4.8.0

2016-10-04 Thread Gaston Gonzalez
Hi,

After hibernation I get the following error when I tried to connect to monitor
through hdmi:

$ xrandr --output LVDS1 --off  --output  HDMI1 --auto
xrandr: Configure crtc 1 failed

This does not happen in kernel in kernel v4.6.7 but do happen in kernels v4.7.4
and v4.8.0

I don't see anything related to this in the kernel log.

This happens after hibernation but not after suspend to ram.

I use a Thinkpad T430 

$ lspci | grep -i vga
00:02.0 VGA compatible controller: Intel Corporation 3rd Gen Core processor
Graphics Controller (rev 09)

regards,

Gaston


Re: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-09-23 Thread Gaston Gonzalez
On Fri, Jun 26, 2015 at 01:36:14PM -0300, Gaston Gonzalez wrote:
> On Thu, Jun 25, 2015 at 02:06:44PM +0200, Arnd Bergmann wrote:
> > On Wednesday 24 June 2015 13:34:58 Gaston Gonzalez wrote:
> > > On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
> > > > On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
> > > > > /* WMM spec P.11: The minimum value for AIFSN shall 
> > > > > be 2 */
> > > > > qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 
> > > > > 2:qos_param->aifs[aci];
> > > > >  
> > > > > -   qos_param->cw_min[aci] = ac_params->ecw_min_max & 
> > > > > 0x0F;
> > > > > +   qos_param->cw_min[aci] =
> > > > > +   cpu_to_le16(ac_params->ecw_min_max & 0x0F);
> > > > >  
> > > > > -   qos_param->cw_max[aci] = (ac_params->ecw_min_max & 
> > > > > 0xF0) >> 4;
> > > > > +   qos_param->cw_max[aci] =
> > > > > +   cpu_to_le16((ac_params->ecw_min_max & 0xF0) 
> > > > > >> 4);
> > > > >  
> > > > > qos_param->flag[aci] =
> > > > > (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
> > > > > -   qos_param->tx_op_limit[aci] = 
> > > > > le16_to_cpu(ac_params->tx_op_limit);
> > > > > +   qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
> > > > > }
> > > > > return 0;
> > > > 
> > > > This certainly needs a more thorough description of how you determined 
> > > > that
> > > > the byte swaps that you add are in fact required. Did you test it on
> > > > a big-endian machine?
> > > > 
> > > > Arnd
> > > 
> > > Hello Arnd,
> > > 
> > > Thank you for reviewing this.
> > > After your email and reviwing this again I'm getting a bit suspicious
> > > myself, but this is what I saw:
> > > 
> > > -- First warning:
> > > 
> > > qos_param->cw_min[aci] is defined as __le16() in ieee80211.h
> > > (ieee80211_qos_parameters structure)
> > > 
> > > ac_params-> ecw_min_max is defined as u8 in ieee80211.h
> > > (ieee80211_qos_ac_parameter structure)
> > > 
> > > So the assignment is: __le16 = u8 & 0x0F;
> > > 
> > > -- Second warning:
> > > 
> > > qos_param->cw_max[aci] is __le16()
> > > ac_params-> ecw_min_max is u8
> > > 
> > > The assignment is: __le16 = (u8 & 0xF0) >> 4;
> > > 
> > > Thus, for the warning 1 and 2, I understand that the result won't be the
> > > same if the machine is big-endian or little-endian, and that's why we
> > > need a cpu_to_le16. Am I missing something?
> > 
> > I think your analysis is right, as long as the __le16 annotation is
> > actually correct. It usually helps to look at the git history to
> > see what the intent of the patch was that introduced the assignment
> > and the patch that introduced the __le16 type. Presumably one of them
> > was incorrect, and it would be good to figure out where it went wrong,
> > and to add a 'Fixes:' tag in your patch description that pinpoints
> > the exact mistake.
> > 
> 
> Ok, will do.
> 
> > > -- Third warning:
> > > 
> > > In this case both sides of the assignment are already defined as __le16:
> > > 
> > > qos_param->tx_op_limit[aci] (ieee80211_qos_parameters structure defined
> > > in ieee80211.h))
> > > 
> > > ac_params->tx_op_limit (ieee80211_qos_ac_parameter structure defined in
> > > ieee80211.h)
> > > 
> > > So the assignment is: __le16() = le16_to_cpu(__le16)
> > > 
> > > Im getting suspicious now, but it sounded wrong to me.
> > > In the case the right part is correct, I guess the left part should be
> > > u16 type?
> > 
> > Again, your logic sounds good: there is clearly something wrong here, but
> > it's not obvious to conclude whether it is an incorrect annotation or
> > an extraneous byte swap. Besides looking at the git history, it also
> > helps to look at all other uses of the two sides of the assignment:
> > 
> > See if qos_param->tx_op_limit is in fact used as a little-en

Re: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-09-23 Thread Gaston Gonzalez
On Fri, Jun 26, 2015 at 01:36:14PM -0300, Gaston Gonzalez wrote:
> On Thu, Jun 25, 2015 at 02:06:44PM +0200, Arnd Bergmann wrote:
> > On Wednesday 24 June 2015 13:34:58 Gaston Gonzalez wrote:
> > > On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
> > > > On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
> > > > > /* WMM spec P.11: The minimum value for AIFSN shall 
> > > > > be 2 */
> > > > > qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 
> > > > > 2:qos_param->aifs[aci];
> > > > >  
> > > > > -   qos_param->cw_min[aci] = ac_params->ecw_min_max & 
> > > > > 0x0F;
> > > > > +   qos_param->cw_min[aci] =
> > > > > +   cpu_to_le16(ac_params->ecw_min_max & 0x0F);
> > > > >  
> > > > > -   qos_param->cw_max[aci] = (ac_params->ecw_min_max & 
> > > > > 0xF0) >> 4;
> > > > > +   qos_param->cw_max[aci] =
> > > > > +   cpu_to_le16((ac_params->ecw_min_max & 0xF0) 
> > > > > >> 4);
> > > > >  
> > > > > qos_param->flag[aci] =
> > > > > (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
> > > > > -   qos_param->tx_op_limit[aci] = 
> > > > > le16_to_cpu(ac_params->tx_op_limit);
> > > > > +   qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
> > > > > }
> > > > > return 0;
> > > > 
> > > > This certainly needs a more thorough description of how you determined 
> > > > that
> > > > the byte swaps that you add are in fact required. Did you test it on
> > > > a big-endian machine?
> > > > 
> > > > Arnd
> > > 
> > > Hello Arnd,
> > > 
> > > Thank you for reviewing this.
> > > After your email and reviwing this again I'm getting a bit suspicious
> > > myself, but this is what I saw:
> > > 
> > > -- First warning:
> > > 
> > > qos_param->cw_min[aci] is defined as __le16() in ieee80211.h
> > > (ieee80211_qos_parameters structure)
> > > 
> > > ac_params-> ecw_min_max is defined as u8 in ieee80211.h
> > > (ieee80211_qos_ac_parameter structure)
> > > 
> > > So the assignment is: __le16 = u8 & 0x0F;
> > > 
> > > -- Second warning:
> > > 
> > > qos_param->cw_max[aci] is __le16()
> > > ac_params-> ecw_min_max is u8
> > > 
> > > The assignment is: __le16 = (u8 & 0xF0) >> 4;
> > > 
> > > Thus, for the warning 1 and 2, I understand that the result won't be the
> > > same if the machine is big-endian or little-endian, and that's why we
> > > need a cpu_to_le16. Am I missing something?
> > 
> > I think your analysis is right, as long as the __le16 annotation is
> > actually correct. It usually helps to look at the git history to
> > see what the intent of the patch was that introduced the assignment
> > and the patch that introduced the __le16 type. Presumably one of them
> > was incorrect, and it would be good to figure out where it went wrong,
> > and to add a 'Fixes:' tag in your patch description that pinpoints
> > the exact mistake.
> > 
> 
> Ok, will do.
> 
> > > -- Third warning:
> > > 
> > > In this case both sides of the assignment are already defined as __le16:
> > > 
> > > qos_param->tx_op_limit[aci] (ieee80211_qos_parameters structure defined
> > > in ieee80211.h))
> > > 
> > > ac_params->tx_op_limit (ieee80211_qos_ac_parameter structure defined in
> > > ieee80211.h)
> > > 
> > > So the assignment is: __le16() = le16_to_cpu(__le16)
> > > 
> > > Im getting suspicious now, but it sounded wrong to me.
> > > In the case the right part is correct, I guess the left part should be
> > > u16 type?
> > 
> > Again, your logic sounds good: there is clearly something wrong here, but
> > it's not obvious to conclude whether it is an incorrect annotation or
> > an extraneous byte swap. Besides looking at the git history, it also
> > helps to look at all other uses of the two sides of the assignment:
> > 
> > See if qos_param->tx_op_limit is in fact used as a little-en

Re: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-26 Thread Gaston Gonzalez
On Thu, Jun 25, 2015 at 02:06:44PM +0200, Arnd Bergmann wrote:
> On Wednesday 24 June 2015 13:34:58 Gaston Gonzalez wrote:
> > On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
> > > On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
> > > > /* WMM spec P.11: The minimum value for AIFSN shall be 
> > > > 2 */
> > > > qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 
> > > > 2:qos_param->aifs[aci];
> > > >  
> > > > -   qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F;
> > > > +   qos_param->cw_min[aci] =
> > > > +   cpu_to_le16(ac_params->ecw_min_max & 0x0F);
> > > >  
> > > > -   qos_param->cw_max[aci] = (ac_params->ecw_min_max & 
> > > > 0xF0) >> 4;
> > > > +   qos_param->cw_max[aci] =
> > > > +   cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 
> > > > 4);
> > > >  
> > > > qos_param->flag[aci] =
> > > > (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
> > > > -   qos_param->tx_op_limit[aci] = 
> > > > le16_to_cpu(ac_params->tx_op_limit);
> > > > +   qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
> > > > }
> > > > return 0;
> > > 
> > > This certainly needs a more thorough description of how you determined 
> > > that
> > > the byte swaps that you add are in fact required. Did you test it on
> > > a big-endian machine?
> > > 
> > >   Arnd
> > 
> > Hello Arnd,
> > 
> > Thank you for reviewing this.
> > After your email and reviwing this again I'm getting a bit suspicious
> > myself, but this is what I saw:
> > 
> > -- First warning:
> > 
> > qos_param->cw_min[aci] is defined as __le16() in ieee80211.h
> > (ieee80211_qos_parameters structure)
> > 
> > ac_params-> ecw_min_max is defined as u8 in ieee80211.h
> > (ieee80211_qos_ac_parameter structure)
> > 
> > So the assignment is: __le16 = u8 & 0x0F;
> > 
> > -- Second warning:
> > 
> > qos_param->cw_max[aci] is __le16()
> > ac_params-> ecw_min_max is u8
> > 
> > The assignment is: __le16 = (u8 & 0xF0) >> 4;
> > 
> > Thus, for the warning 1 and 2, I understand that the result won't be the
> > same if the machine is big-endian or little-endian, and that's why we
> > need a cpu_to_le16. Am I missing something?
> 
> I think your analysis is right, as long as the __le16 annotation is
> actually correct. It usually helps to look at the git history to
> see what the intent of the patch was that introduced the assignment
> and the patch that introduced the __le16 type. Presumably one of them
> was incorrect, and it would be good to figure out where it went wrong,
> and to add a 'Fixes:' tag in your patch description that pinpoints
> the exact mistake.
> 

Ok, will do.

> > -- Third warning:
> > 
> > In this case both sides of the assignment are already defined as __le16:
> > 
> > qos_param->tx_op_limit[aci] (ieee80211_qos_parameters structure defined
> > in ieee80211.h))
> > 
> > ac_params->tx_op_limit (ieee80211_qos_ac_parameter structure defined in
> > ieee80211.h)
> > 
> > So the assignment is: __le16() = le16_to_cpu(__le16)
> > 
> > Im getting suspicious now, but it sounded wrong to me.
> > In the case the right part is correct, I guess the left part should be
> > u16 type?
> 
> Again, your logic sounds good: there is clearly something wrong here, but
> it's not obvious to conclude whether it is an incorrect annotation or
> an extraneous byte swap. Besides looking at the git history, it also
> helps to look at all other uses of the two sides of the assignment:
> 
> See if qos_param->tx_op_limit is in fact used as a little-endian
> value (e.g. by copying to memory or a register), and if the value that
> got written to ac_params->tx_op_limit was byte-swapped already at
> the time of assignment.
> 
Ok, I'll do it too.

> > Regarding the test: I tested it on my machine, but is of course little-
> > endian :( I could built a qemu virtual machine to test it on a
> > big-endian emulated platform. Should that work?
> 
> Yes, that would work: you can assign the USB device to the qemu machine
> and run a kernel in there. The easiest emulation to try is probably
> a PowerPC PAPR machine with a file system from
> https://people.debian.org/~aurel32/qemu/powerpc/.
> MIPS should work as well.
> 

Ok, thanks a lot for all the pointers.

Gaston
>   Arnd
--
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: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-26 Thread Gaston Gonzalez
On Thu, Jun 25, 2015 at 02:06:44PM +0200, Arnd Bergmann wrote:
 On Wednesday 24 June 2015 13:34:58 Gaston Gonzalez wrote:
  On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
   On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
/* WMM spec P.11: The minimum value for AIFSN shall be 
2 */
qos_param-aifs[aci] = (qos_param-aifs[aci]  2) ? 
2:qos_param-aifs[aci];
 
-   qos_param-cw_min[aci] = ac_params-ecw_min_max  0x0F;
+   qos_param-cw_min[aci] =
+   cpu_to_le16(ac_params-ecw_min_max  0x0F);
 
-   qos_param-cw_max[aci] = (ac_params-ecw_min_max  
0xF0)  4;
+   qos_param-cw_max[aci] =
+   cpu_to_le16((ac_params-ecw_min_max  0xF0)  
4);
 
qos_param-flag[aci] =
(ac_params-aci_aifsn  0x10) ? 0x01 : 0x00;
-   qos_param-tx_op_limit[aci] = 
le16_to_cpu(ac_params-tx_op_limit);
+   qos_param-tx_op_limit[aci] = ac_params-tx_op_limit;
}
return 0;
   
   This certainly needs a more thorough description of how you determined 
   that
   the byte swaps that you add are in fact required. Did you test it on
   a big-endian machine?
   
 Arnd
  
  Hello Arnd,
  
  Thank you for reviewing this.
  After your email and reviwing this again I'm getting a bit suspicious
  myself, but this is what I saw:
  
  -- First warning:
  
  qos_param-cw_min[aci] is defined as __le16() in ieee80211.h
  (ieee80211_qos_parameters structure)
  
  ac_params- ecw_min_max is defined as u8 in ieee80211.h
  (ieee80211_qos_ac_parameter structure)
  
  So the assignment is: __le16 = u8  0x0F;
  
  -- Second warning:
  
  qos_param-cw_max[aci] is __le16()
  ac_params- ecw_min_max is u8
  
  The assignment is: __le16 = (u8  0xF0)  4;
  
  Thus, for the warning 1 and 2, I understand that the result won't be the
  same if the machine is big-endian or little-endian, and that's why we
  need a cpu_to_le16. Am I missing something?
 
 I think your analysis is right, as long as the __le16 annotation is
 actually correct. It usually helps to look at the git history to
 see what the intent of the patch was that introduced the assignment
 and the patch that introduced the __le16 type. Presumably one of them
 was incorrect, and it would be good to figure out where it went wrong,
 and to add a 'Fixes:' tag in your patch description that pinpoints
 the exact mistake.
 

Ok, will do.

  -- Third warning:
  
  In this case both sides of the assignment are already defined as __le16:
  
  qos_param-tx_op_limit[aci] (ieee80211_qos_parameters structure defined
  in ieee80211.h))
  
  ac_params-tx_op_limit (ieee80211_qos_ac_parameter structure defined in
  ieee80211.h)
  
  So the assignment is: __le16() = le16_to_cpu(__le16)
  
  Im getting suspicious now, but it sounded wrong to me.
  In the case the right part is correct, I guess the left part should be
  u16 type?
 
 Again, your logic sounds good: there is clearly something wrong here, but
 it's not obvious to conclude whether it is an incorrect annotation or
 an extraneous byte swap. Besides looking at the git history, it also
 helps to look at all other uses of the two sides of the assignment:
 
 See if qos_param-tx_op_limit is in fact used as a little-endian
 value (e.g. by copying to memory or a register), and if the value that
 got written to ac_params-tx_op_limit was byte-swapped already at
 the time of assignment.
 
Ok, I'll do it too.

  Regarding the test: I tested it on my machine, but is of course little-
  endian :( I could built a qemu virtual machine to test it on a
  big-endian emulated platform. Should that work?
 
 Yes, that would work: you can assign the USB device to the qemu machine
 and run a kernel in there. The easiest emulation to try is probably
 a PowerPC PAPR machine with a file system from
 https://people.debian.org/~aurel32/qemu/powerpc/.
 MIPS should work as well.
 

Ok, thanks a lot for all the pointers.

Gaston
   Arnd
--
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: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-24 Thread Gaston Gonzalez
On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
> On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
> > /* WMM spec P.11: The minimum value for AIFSN shall be 2 */
> > qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 
> > 2:qos_param->aifs[aci];
> >  
> > -   qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F;
> > +   qos_param->cw_min[aci] =
> > +   cpu_to_le16(ac_params->ecw_min_max & 0x0F);
> >  
> > -   qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 
> > 4;
> > +   qos_param->cw_max[aci] =
> > +   cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4);
> >  
> > qos_param->flag[aci] =
> > (ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
> > -   qos_param->tx_op_limit[aci] = 
> > le16_to_cpu(ac_params->tx_op_limit);
> > +   qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
> > }
> > return 0;
> 
> This certainly needs a more thorough description of how you determined that
> the byte swaps that you add are in fact required. Did you test it on
> a big-endian machine?
> 
>   Arnd

Hello Arnd,

Thank you for reviewing this.
After your email and reviwing this again I'm getting a bit suspicious
myself, but this is what I saw:

-- First warning:

qos_param->cw_min[aci] is defined as __le16() in ieee80211.h
(ieee80211_qos_parameters structure)

ac_params-> ecw_min_max is defined as u8 in ieee80211.h
(ieee80211_qos_ac_parameter structure)

So the assignment is: __le16 = u8 & 0x0F;

-- Second warning:

qos_param->cw_max[aci] is __le16()
ac_params-> ecw_min_max is u8

The assignment is: __le16 = (u8 & 0xF0) >> 4;

Thus, for the warning 1 and 2, I understand that the result won't be the
same if the machine is big-endian or little-endian, and that's why we
need a cpu_to_le16. Am I missing something?

-- Third warning:

In this case both sides of the assignment are already defined as __le16:

qos_param->tx_op_limit[aci] (ieee80211_qos_parameters structure defined
in ieee80211.h))

ac_params->tx_op_limit (ieee80211_qos_ac_parameter structure defined in
ieee80211.h)

So the assignment is: __le16() = le16_to_cpu(__le16)

Im getting suspicious now, but it sounded wrong to me.
In the case the right part is correct, I guess the left part should be
u16 type?

Regarding the test: I tested it on my machine, but is of course little-
endian :( I could built a qemu virtual machine to test it on a
big-endian emulated platform. Should that work?

Regards,

Gaston
--
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: [PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-24 Thread Gaston Gonzalez
On Tue, Jun 23, 2015 at 12:13:47PM +0200, Arnd Bergmann wrote:
 On Sunday 21 June 2015 19:12:09 Gaston Gonzalez wrote:
  /* WMM spec P.11: The minimum value for AIFSN shall be 2 */
  qos_param-aifs[aci] = (qos_param-aifs[aci]  2) ? 
  2:qos_param-aifs[aci];
   
  -   qos_param-cw_min[aci] = ac_params-ecw_min_max  0x0F;
  +   qos_param-cw_min[aci] =
  +   cpu_to_le16(ac_params-ecw_min_max  0x0F);
   
  -   qos_param-cw_max[aci] = (ac_params-ecw_min_max  0xF0)  
  4;
  +   qos_param-cw_max[aci] =
  +   cpu_to_le16((ac_params-ecw_min_max  0xF0)  4);
   
  qos_param-flag[aci] =
  (ac_params-aci_aifsn  0x10) ? 0x01 : 0x00;
  -   qos_param-tx_op_limit[aci] = 
  le16_to_cpu(ac_params-tx_op_limit);
  +   qos_param-tx_op_limit[aci] = ac_params-tx_op_limit;
  }
  return 0;
 
 This certainly needs a more thorough description of how you determined that
 the byte swaps that you add are in fact required. Did you test it on
 a big-endian machine?
 
   Arnd

Hello Arnd,

Thank you for reviewing this.
After your email and reviwing this again I'm getting a bit suspicious
myself, but this is what I saw:

-- First warning:

qos_param-cw_min[aci] is defined as __le16() in ieee80211.h
(ieee80211_qos_parameters structure)

ac_params- ecw_min_max is defined as u8 in ieee80211.h
(ieee80211_qos_ac_parameter structure)

So the assignment is: __le16 = u8  0x0F;

-- Second warning:

qos_param-cw_max[aci] is __le16()
ac_params- ecw_min_max is u8

The assignment is: __le16 = (u8  0xF0)  4;

Thus, for the warning 1 and 2, I understand that the result won't be the
same if the machine is big-endian or little-endian, and that's why we
need a cpu_to_le16. Am I missing something?

-- Third warning:

In this case both sides of the assignment are already defined as __le16:

qos_param-tx_op_limit[aci] (ieee80211_qos_parameters structure defined
in ieee80211.h))

ac_params-tx_op_limit (ieee80211_qos_ac_parameter structure defined in
ieee80211.h)

So the assignment is: __le16() = le16_to_cpu(__le16)

Im getting suspicious now, but it sounded wrong to me.
In the case the right part is correct, I guess the left part should be
u16 type?

Regarding the test: I tested it on my machine, but is of course little-
endian :( I could built a qemu virtual machine to test it on a
big-endian emulated platform. Should that work?

Regards,

Gaston
--
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/


[PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-21 Thread Gaston Gonzalez
Fix the following incorrect type in assignments detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37:expected unsigned 
short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37:got restricted 
__be16 [usertype] 

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45:expected unsigned 
short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45:got restricted 
__be16 [usertype] 

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40:expected 
restricted __le16 
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40:expected 
restricted __le16 
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45:expected 
restricted __le16 
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45:got unsigned 
short [unsigned] [usertype] 


Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index b374088..15bcf7e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -566,7 +566,7 @@ void ieee80211_indicate_packets(struct ieee80211_device 
*ieee, struct ieee80211_
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->src, 
ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), prxb->dst, 
ETH_ALEN);
} else {
-   u16 len;
+   __be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb->len);
memcpy(skb_push(sub_skb, 2), , 2);
@@ -1325,7 +1325,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
memcpy(skb_push(sub_skb, ETH_ALEN), 
src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), 
dst, ETH_ALEN);
} else {
-   u16 len;
+   __be16 len;
/* Leave Ethernet header part of hdr 
and full payload */
len = htons(sub_skb->len);
memcpy(skb_push(sub_skb, 2), , 2);
@@ -1492,13 +1492,15 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
qos_param->aifs[aci] = (qos_param->aifs[aci] < 2) ? 
2:qos_param->aifs[aci];
 
-   qos_param->cw_min[aci] = ac_params->ecw_min_max & 0x0F;
+   qos_param->cw_min[aci] =
+   cpu_to_le16(ac_params->ecw_min_max & 0x0F);
 
-   qos_param->cw_max[aci] = (ac_params->ecw_min_max & 0xF0) >> 4;
+   qos_param->cw_max[aci] =
+   cpu_to_le16((ac_params->ecw_min_max & 0xF0) >> 4);
 
qos_param->flag[aci] =
(ac_params->aci_aifsn & 0x10) ? 0x01 : 0x00;
-   qos_param->tx_op_limit[aci] = 
le16_to_cpu(ac_params->tx_op_limit);
+   qos_param->tx_op_limit[aci] = ac_params->tx_op_limit;
}
return 0;
 }
-- 
2.4.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8192u: ieee80211_rx: Fix incorrect type in assignments

2015-06-21 Thread Gaston Gonzalez
Fix the following incorrect type in assignments detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37:expected unsigned 
short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:571:37:got restricted 
__be16 [usertype] noident

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45:expected unsigned 
short [unsigned] [usertype] len
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1330:45:got restricted 
__be16 [usertype] noident

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40:expected 
restricted __le16 noident
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1495:40:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40:expected 
restricted __le16 noident
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1497:40:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45: warning: incorrect 
type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45:expected 
restricted __le16 noident
drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c:1501:45:got unsigned 
short [unsigned] [usertype] noident


Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c | 12 +++-
 1 file changed, 7 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
index b374088..15bcf7e 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_rx.c
@@ -566,7 +566,7 @@ void ieee80211_indicate_packets(struct ieee80211_device 
*ieee, struct ieee80211_
memcpy(skb_push(sub_skb, ETH_ALEN), prxb-src, 
ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), prxb-dst, 
ETH_ALEN);
} else {
-   u16 len;
+   __be16 len;
/* Leave Ethernet header part of hdr and full payload */
len = htons(sub_skb-len);
memcpy(skb_push(sub_skb, 2), len, 2);
@@ -1325,7 +1325,7 @@ int ieee80211_rx(struct ieee80211_device *ieee, struct 
sk_buff *skb,
memcpy(skb_push(sub_skb, ETH_ALEN), 
src, ETH_ALEN);
memcpy(skb_push(sub_skb, ETH_ALEN), 
dst, ETH_ALEN);
} else {
-   u16 len;
+   __be16 len;
/* Leave Ethernet header part of hdr 
and full payload */
len = htons(sub_skb-len);
memcpy(skb_push(sub_skb, 2), len, 2);
@@ -1492,13 +1492,15 @@ static int ieee80211_qos_convert_ac_to_parameters(struct
/* WMM spec P.11: The minimum value for AIFSN shall be 2 */
qos_param-aifs[aci] = (qos_param-aifs[aci]  2) ? 
2:qos_param-aifs[aci];
 
-   qos_param-cw_min[aci] = ac_params-ecw_min_max  0x0F;
+   qos_param-cw_min[aci] =
+   cpu_to_le16(ac_params-ecw_min_max  0x0F);
 
-   qos_param-cw_max[aci] = (ac_params-ecw_min_max  0xF0)  4;
+   qos_param-cw_max[aci] =
+   cpu_to_le16((ac_params-ecw_min_max  0xF0)  4);
 
qos_param-flag[aci] =
(ac_params-aci_aifsn  0x10) ? 0x01 : 0x00;
-   qos_param-tx_op_limit[aci] = 
le16_to_cpu(ac_params-tx_op_limit);
+   qos_param-tx_op_limit[aci] = ac_params-tx_op_limit;
}
return 0;
 }
-- 
2.4.2

--
To unsubscribe from this list: send the line unsubscribe linux-kernel in
Please read the FAQ at  http://www.tux.org/lkml/


[PATCH] staging: rtl8192u: ieee80211: Fix incorrect type in assignment

2015-06-14 Thread Gaston Gonzalez
Added le16_to_cpu() conversion fixing the following warning in assignment 
detected by sparse: 

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30: warning: 
invalid assignment: +=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:left side 
has type unsigned long
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:right side 
has type restricted __le16

Signed-off-by: Gaston Gonzalez 
---
 I wonder if this is the best approach, making payload_size u16 in ieee80211.h 
would fix this plus other three sparse warnings. Could we make payload_size u16 
or it must be definitely le16?

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 5fbade4..1b11acb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2154,7 +2154,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, 
struct ieee80211_device *
ieee80211_sta_wakeup(ieee, 0);
 
/* update the tx status */
-   ieee->stats.tx_bytes += txb->payload_size;
+   ieee->stats.tx_bytes += le16_to_cpu(txb->payload_size);
ieee->stats.tx_packets++;
tcb_desc = (cb_desc *)(txb->fragments[0]->cb + MAX_DEV_ADDR_SIZE);
if (tcb_desc->bMulticast) {
-- 
2.4.2

--
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/


[PATCH] staging: rtl8192u: ieee80211: Fix incorrect type in assignment

2015-06-14 Thread Gaston Gonzalez
Added le16_to_cpu() conversion fixing the following warning in assignment 
detected by sparse: 

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30: warning: 
invalid assignment: +=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:left side 
has type unsigned long
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:2157:30:right side 
has type restricted __le16

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 I wonder if this is the best approach, making payload_size u16 in ieee80211.h 
would fix this plus other three sparse warnings. Could we make payload_size u16 
or it must be definitely le16?

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index 5fbade4..1b11acb 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -2154,7 +2154,7 @@ void ieee80211_softmac_xmit(struct ieee80211_txb *txb, 
struct ieee80211_device *
ieee80211_sta_wakeup(ieee, 0);
 
/* update the tx status */
-   ieee-stats.tx_bytes += txb-payload_size;
+   ieee-stats.tx_bytes += le16_to_cpu(txb-payload_size);
ieee-stats.tx_packets++;
tcb_desc = (cb_desc *)(txb-fragments[0]-cb + MAX_DEV_ADDR_SIZE);
if (tcb_desc-bMulticast) {
-- 
2.4.2

--
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/


[PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings ieee80211_softmac.c

2015-06-10 Thread Gaston Gonzalez
Fix the following endinness warnings detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:expected 
restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:expected 
restricted __le16 [usertype] algorithm
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:expected 
restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:expected 
restricted __le16 [usertype] listen_interval
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:expected 
restricted __le16 [usertype] reason
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:got unsigned 
char [unsigned] [usertype] asRsn

Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index b00f5fd..5fbade4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -666,7 +666,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
else
auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
-   auth->header.duration_id = 0x013a; //FIXME
+   auth->header.duration_id = cpu_to_le16(0x013a);
 
memcpy(auth->header.addr1, beacon->bssid, ETH_ALEN);
memcpy(auth->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
@@ -676,7 +676,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
if(ieee->auth_mode == 0)
auth->algorithm = WLAN_AUTH_OPEN;
else if(ieee->auth_mode == 1)
-   auth->algorithm = WLAN_AUTH_SHARED_KEY;
+   auth->algorithm = cpu_to_le16(WLAN_AUTH_SHARED_KEY);
else if(ieee->auth_mode == 2)
auth->algorithm = WLAN_AUTH_OPEN;//0x80;
printk("=>%s():auth->algorithm is 
%d\n",__func__,auth->algorithm);
@@ -1087,7 +1087,7 @@ inline struct sk_buff *ieee80211_association_req(struct 
ieee80211_network *beaco
 
 
hdr->header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ;
-   hdr->header.duration_id= 37; //FIXME
+   hdr->header.duration_id = cpu_to_le16(37);
memcpy(hdr->header.addr1, beacon->bssid, ETH_ALEN);
memcpy(hdr->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
memcpy(hdr->header.addr3, beacon->bssid, ETH_ALEN);
@@ -1106,7 +1106,7 @@ inline struct sk_buff *ieee80211_association_req(struct 
ieee80211_network *beaco
if (wmm_info_len) //QOS
hdr->capability |= cpu_to_le16(WLAN_CAPABILITY_QOS);
 
-   hdr->listen_interval = 0xa; //FIXME
+   hdr->listen_interval = cpu_to_le16(0xa);
 
hdr->info_element[0].id = MFIE_TYPE_SSID;
 
@@ -3127,7 +3127,7 @@ inline struct sk_buff *ieee80211_disassociate_skb(
memcpy(disass->header.addr2, ieee->dev->dev_addr, ETH_ALEN);
memcpy(disass->header.addr3, beacon->bssid, ETH_ALEN);
 
-   disass->reason = asRsn;
+   disass->reason = cpu_to_le16(asRsn);
return skb;
 }
 
-- 
2.4.2

--
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/


[PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings ieee80211_softmac.c

2015-06-10 Thread Gaston Gonzalez
Fix the following endinness warnings detected by sparse:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:expected 
restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:669:34:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:expected 
restricted __le16 [usertype] algorithm
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:679:33:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:expected 
restricted __le16 [usertype] duration_id
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1090:32:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:expected 
restricted __le16 [usertype] listen_interval
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:1109:30:got int

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:expected 
restricted __le16 [usertype] reason
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:3130:24:got unsigned 
char [unsigned] [usertype] asRsn

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 10 +-
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index b00f5fd..5fbade4 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -666,7 +666,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
else
auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
-   auth-header.duration_id = 0x013a; //FIXME
+   auth-header.duration_id = cpu_to_le16(0x013a);
 
memcpy(auth-header.addr1, beacon-bssid, ETH_ALEN);
memcpy(auth-header.addr2, ieee-dev-dev_addr, ETH_ALEN);
@@ -676,7 +676,7 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
if(ieee-auth_mode == 0)
auth-algorithm = WLAN_AUTH_OPEN;
else if(ieee-auth_mode == 1)
-   auth-algorithm = WLAN_AUTH_SHARED_KEY;
+   auth-algorithm = cpu_to_le16(WLAN_AUTH_SHARED_KEY);
else if(ieee-auth_mode == 2)
auth-algorithm = WLAN_AUTH_OPEN;//0x80;
printk(=%s():auth-algorithm is 
%d\n,__func__,auth-algorithm);
@@ -1087,7 +1087,7 @@ inline struct sk_buff *ieee80211_association_req(struct 
ieee80211_network *beaco
 
 
hdr-header.frame_ctl = IEEE80211_STYPE_ASSOC_REQ;
-   hdr-header.duration_id= 37; //FIXME
+   hdr-header.duration_id = cpu_to_le16(37);
memcpy(hdr-header.addr1, beacon-bssid, ETH_ALEN);
memcpy(hdr-header.addr2, ieee-dev-dev_addr, ETH_ALEN);
memcpy(hdr-header.addr3, beacon-bssid, ETH_ALEN);
@@ -1106,7 +1106,7 @@ inline struct sk_buff *ieee80211_association_req(struct 
ieee80211_network *beaco
if (wmm_info_len) //QOS
hdr-capability |= cpu_to_le16(WLAN_CAPABILITY_QOS);
 
-   hdr-listen_interval = 0xa; //FIXME
+   hdr-listen_interval = cpu_to_le16(0xa);
 
hdr-info_element[0].id = MFIE_TYPE_SSID;
 
@@ -3127,7 +3127,7 @@ inline struct sk_buff *ieee80211_disassociate_skb(
memcpy(disass-header.addr2, ieee-dev-dev_addr, ETH_ALEN);
memcpy(disass-header.addr3, beacon-bssid, ETH_ALEN);
 
-   disass-reason = asRsn;
+   disass-reason = cpu_to_le16(asRsn);
return skb;
 }
 
-- 
2.4.2

--
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/


[PATCH v3] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-02 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez 
---
Changes since V2: fix line over 80 chararcters.

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..8e18674 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,11 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   if (challengelen)
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH
+   | IEEE80211_FCTL_WEP);
+   else
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
auth->header.duration_id = 0x013a; //FIXME
 
-- 
2.1.4

--
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: [PATCH v2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-02 Thread Gaston Gonzalez
On Tue, Jun 02, 2015 at 11:09:41AM +0530, Sudip Mukherjee wrote:
> On Mon, Jun 01, 2015 at 09:43:31PM -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> > 
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 6 --
> >  1 file changed, 4 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > index d2e8b12..d0a6a59 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > @@ -660,8 +660,10 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> >  
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   if (challengelen)
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
> > IEEE80211_FCTL_WEP);
> it is introducing new checkpatch warning of "line over 80 characters".
> 
> regards
> sudip
Yes, you are right. I'll send a v3 including with that fixed.

Thanks for the feedback,

Gaston
--
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/


[PATCH v3] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-02 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
Changes since V2: fix line over 80 chararcters.

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 7 +--
 1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..8e18674 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,11 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   if (challengelen)
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH
+   | IEEE80211_FCTL_WEP);
+   else
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
auth-header.duration_id = 0x013a; //FIXME
 
-- 
2.1.4

--
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: [PATCH v2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-02 Thread Gaston Gonzalez
On Tue, Jun 02, 2015 at 11:09:41AM +0530, Sudip Mukherjee wrote:
 On Mon, Jun 01, 2015 at 09:43:31PM -0300, Gaston Gonzalez wrote:
  Fix the following sparse warnings:
  
   drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 6 --
   1 file changed, 4 insertions(+), 2 deletions(-)
  
  diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
  b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  index d2e8b12..d0a6a59 100644
  --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  @@ -660,8 +660,10 @@ inline struct sk_buff 
  *ieee80211_authentication_req(struct ieee80211_network *be
  auth = (struct ieee80211_authentication *)
  skb_put(skb, sizeof(struct ieee80211_authentication));
   
  -   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
  -   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
  +   if (challengelen)
  +   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
  IEEE80211_FCTL_WEP);
 it is introducing new checkpatch warning of line over 80 characters.
 
 regards
 sudip
Yes, you are right. I'll send a v3 including with that fixed.

Thanks for the feedback,

Gaston
--
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/


[PATCH v2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez 
---
Changes since V1: rearrange the code to set auth->header.frame_ctl only once.

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..d0a6a59 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,10 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   if (challengelen)
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
IEEE80211_FCTL_WEP);
+   else
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
auth->header.duration_id = 0x013a; //FIXME
 
-- 
2.4.2

--
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: [PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 02:43:28PM -0700, Joe Perches wrote:
> On Mon, 2015-06-01 at 18:30 -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> []
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> []
> > @@ -660,8 +660,9 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> >  
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > +   if (challengelen)
> > + auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> 
> It'd be better to use normal tab indentation and likely
> it'd also be better to set this only once
> 
>   if (challengelen)
>   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
> IEEE80211_FCTL_WEP);
>   else
>   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> 
> or maybe a single line
> 
>   auth->header.frame_ctl = cpu_to_le16(challengelen ? 
> IEEE80211_STYPE_AUTH | IEEE80211_FCTL_WEP : IEEE80211_STYPE_AUTH);
> 
> though I think the first is simpler to read.
> 
>
Thanks for the feedback.

I'll send a v2 making the changes according to your first option.

regards,

Gaston 
--
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/


[PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..bda961c 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,9 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+ auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
 
auth->header.duration_id = 0x013a; //FIXME
 
-- 
2.1.4

--
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: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 01:03:16PM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 11:24:42PM -0300, Gaston Gonzalez wrote:
> > On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
> > > On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
> > > > On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> > > > > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > > > > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > > > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > > > > > Fix the following sparse warnings:
> > > > > > > > 
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
> > > > > > > > warning: incorrect type in assignment (different base types)
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:  
> > > > > > > >   expected restricted __le16 [usertype] frame_ctl
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:  
> > > > > > > >   got int
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
> > > > > > > > warning: invalid assignment: |=
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:  
> > > > > > > >   left side has type restricted __le16
> > > > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:  
> > > > > > > >   right side has type int
> > > > > > > > 
> > > > > > > > 
> > > > > > > > Signed-off-by: Gaston Gonzalez 
> > > > > > > > ---
> > > > > > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 
> > > > > > > > +++--
> > > > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > > > 
> > > > > > > Still doesn't apply, but this might be a git bug, see below:
> > > > > > > 
> > > > > > > > diff --git 
> > > > > > > > a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > > index d2e8b12..0477ba1 100644
> > > > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > > > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > > > > > auth = (struct ieee80211_authentication *)
> > > > > > > > skb_put(skb, sizeof(struct 
> > > > > > > > ieee80211_authentication));
> > > > > > > > 
> > > > > > > > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > > > > > -   if (challengelen) auth->header.frame_ctl |= 
> > > > > > > > IEEE80211_FCTL_WEP;
> > > > > > > > +   auth->header.frame_ctl = 
> > > > > > > > cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > > > > > +   if (challengelen)
> > > > > > > > +   auth->header.frame_ctl |= 
> > > > > > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > > > > > 
> > > > > > > > auth->header.duration_id = 0x013a; //FIXME
> > > > > > > > 
> > > > > > > > --
> > > > > > > > 2.1.4
> > > > > > > 
> > > > > > > This patch is not created properly.  Did you edit it by hand?  If 
> > > > > > > not,
> > > > > > > we need to report a bug as the diff is obviously wrong, look at 
> > > > > > > the @@@
> > > > > > > line.
> > > > > > > 
> > > > > > > Can you update your version of git to see if it's fixed there?
> > > > > > > 
> > > > > > > Also, patch tells you that this is broken:
> > > > > > > 
> > > > > &g

Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 01:03:16PM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 11:24:42PM -0300, Gaston Gonzalez wrote:
  On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
   On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
  On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
   On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:  
  expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:  
  got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
warning: invalid assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:  
  left side has type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:  
  right side has type int


Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 
+++--
 1 file changed, 3 insertions(+), 2 deletions(-)
   
   Still doesn't apply, but this might be a git bug, see below:
   
diff --git 
a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff 
*ieee80211_authentication_req(struct ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct 
ieee80211_authentication));

-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= 
IEEE80211_FCTL_WEP;
+   auth-header.frame_ctl = 
cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth-header.frame_ctl |= 
cpu_to_le16(IEEE80211_FCTL_WEP);

auth-header.duration_id = 0x013a; //FIXME

--
2.1.4
   
   This patch is not created properly.  Did you edit it by hand?  If 
   not,
   we need to report a bug as the diff is obviously wrong, look at 
   the @@@
   line.
   
   Can you update your version of git to see if it's fixed there?
   
   Also, patch tells you that this is broken:
   
   checking file 
   drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
   patch:  malformed patch at line 132:
   skb_put(skb, sizeof(struct ieee80211_authentication));
  
  Greg,
  
  The patch was prepared using git format-patch. The git version I'm 
  using:
  
  gaston22:\-$ git --version 
  git version 2.1.4
  
  I did deleted 4 whitespaces by hand after running checkpatch.pl on 
  the patch.
  Could that drive the issue? However, I could properly apply the 
  patch using 'git
  am' from an email and get the git log right.
 
 Yes, but is there really a commit there?  That's what messed me up 
 last
 time, git applied it, but with no actual diff (which is probably a bug
 too, just a different one...)
 

Yes, there was a commit. In fact the patch prepare: git format-patch -1

 And if you edited it by hand, that might explain the issue, what did 
 the
 original patch look like?

Attached the original patch I submitted:
0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch
   
   Which is broken.
   
Attached is also the patch without the hand-edited deletions:

ieee80211_softmac_fixes_v3.patch
   
   That patch is correct.
   
   Why did you edit the patch metadata in a way that was incorrect?
  
  The only edit I did was from within git send-email --annotate. Nothing 
  else. I
  get now that that editor is not for everything... as I get the rest of the 
  apply process 
   right, I thought it was ok that way. My bad :(
 
 That's worrysome, why would --annotate change the lines that relate to
 the patch linenumbers?  Did you do a search/replace or something
 accidentally?

To be honest I don't know, using --annotate I edited: the body 'Fix the
following sparse warnings', the signoff and the subject. I thought the
subject could be the problem. Nothing below the --- line.

Besides that, only the whitespaces

[PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..bda961c 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,9 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+ auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
 
auth-header.duration_id = 0x013a; //FIXME
 
-- 
2.1.4

--
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: [PATCH RESEND 2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 02:43:28PM -0700, Joe Perches wrote:
 On Mon, 2015-06-01 at 18:30 -0300, Gaston Gonzalez wrote:
  Fix the following sparse warnings:
 []
  diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
  b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
 []
  @@ -660,8 +660,9 @@ inline struct sk_buff 
  *ieee80211_authentication_req(struct ieee80211_network *be
  auth = (struct ieee80211_authentication *)
  skb_put(skb, sizeof(struct ieee80211_authentication));
   
  -   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
  -   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
  +   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
  +   if (challengelen)
  + auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
 
 It'd be better to use normal tab indentation and likely
 it'd also be better to set this only once
 
   if (challengelen)
   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
 IEEE80211_FCTL_WEP);
   else
   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
 or maybe a single line
 
   auth-header.frame_ctl = cpu_to_le16(challengelen ? 
 IEEE80211_STYPE_AUTH | IEEE80211_FCTL_WEP : IEEE80211_STYPE_AUTH);
 
 though I think the first is simpler to read.
 

Thanks for the feedback.

I'll send a v2 making the changes according to your first option.

regards,

Gaston 
--
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/


[PATCH v2] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-06-01 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
Changes since V1: rearrange the code to set auth-header.frame_ctl only once.

 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 6 --
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..d0a6a59 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,8 +660,10 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));
 
-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   if (challengelen)
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH | 
IEEE80211_FCTL_WEP);
+   else
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
 
auth-header.duration_id = 0x013a; //FIXME
 
-- 
2.4.2

--
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: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
> > On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> > > On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > > > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > > > Fix the following sparse warnings:
> > > > > > 
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
> > > > > > warning: incorrect type in assignment (different base types)
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > expected restricted __le16 [usertype] frame_ctl
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > > > got int
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
> > > > > > warning: invalid assignment: |=
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > left side has type restricted __le16
> > > > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
> > > > > > right side has type int
> > > > > > 
> > > > > > 
> > > > > > Signed-off-by: Gaston Gonzalez 
> > > > > > ---
> > > > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > > > 
> > > > > Still doesn't apply, but this might be a git bug, see below:
> > > > > 
> > > > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > index d2e8b12..0477ba1 100644
> > > > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > > > auth = (struct ieee80211_authentication *)
> > > > > > skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > > > 
> > > > > > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > > > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > > > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > > > +   if (challengelen)
> > > > > > +   auth->header.frame_ctl |= 
> > > > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > > > 
> > > > > > auth->header.duration_id = 0x013a; //FIXME
> > > > > > 
> > > > > > --
> > > > > > 2.1.4
> > > > > 
> > > > > This patch is not created properly.  Did you edit it by hand?  If not,
> > > > > we need to report a bug as the diff is obviously wrong, look at the 
> > > > > @@@
> > > > > line.
> > > > > 
> > > > > Can you update your version of git to see if it's fixed there?
> > > > > 
> > > > > Also, patch tells you that this is broken:
> > > > > 
> > > > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > > patch:  malformed patch at line 132:skb_put(skb, 
> > > > > sizeof(struct ieee80211_authentication));
> > > > 
> > > > Greg,
> > > > 
> > > > The patch was prepared using git format-patch. The git version I'm 
> > > > using:
> > > > 
> > > > gaston22:\-$ git --version 
> > > > git version 2.1.4
> > > > 
> > > > I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
> > > > patch.
> > > > Could that drive the issue? However, I could properly apply the patch 
> > > > using 'git
> > > > am' from an email and get the git log right.
> > > 
> > > Yes, but is there really a commit there?  That's what messed me up last
> > > time, git applied it, but with no actual di

Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
> > On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> > > On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > > > Fix the following sparse warnings:
> > > > 
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > > > incorrect type in assignment (different base types)
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
> > > > expected restricted __le16 [usertype] frame_ctl
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got 
> > > > int
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > > > invalid assignment: |=
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left 
> > > > side has type restricted __le16
> > > > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
> > > > side has type int
> > > > 
> > > > 
> > > > Signed-off-by: Gaston Gonzalez 
> > > > ---
> > > >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> > > >  1 file changed, 3 insertions(+), 2 deletions(-)
> > > 
> > > Still doesn't apply, but this might be a git bug, see below:
> > > 
> > > > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > > > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > index d2e8b12..0477ba1 100644
> > > > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > > > *ieee80211_authentication_req(struct ieee80211_network *be
> > > > auth = (struct ieee80211_authentication *)
> > > > skb_put(skb, sizeof(struct ieee80211_authentication));
> > > > 
> > > > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > > > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > > > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > > > +   if (challengelen)
> > > > +   auth->header.frame_ctl |= 
> > > > cpu_to_le16(IEEE80211_FCTL_WEP);
> > > > 
> > > > auth->header.duration_id = 0x013a; //FIXME
> > > > 
> > > > --
> > > > 2.1.4
> > > 
> > > This patch is not created properly.  Did you edit it by hand?  If not,
> > > we need to report a bug as the diff is obviously wrong, look at the @@@
> > > line.
> > > 
> > > Can you update your version of git to see if it's fixed there?
> > > 
> > > Also, patch tells you that this is broken:
> > > 
> > > checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > > patch:  malformed patch at line 132:skb_put(skb, 
> > > sizeof(struct ieee80211_authentication));
> > 
> > Greg,
> > 
> > The patch was prepared using git format-patch. The git version I'm using:
> > 
> > gaston22:\-$ git --version 
> > git version 2.1.4
> > 
> > I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
> > patch.
> > Could that drive the issue? However, I could properly apply the patch using 
> > 'git
> > am' from an email and get the git log right.
> 
> Yes, but is there really a commit there?  That's what messed me up last
> time, git applied it, but with no actual diff (which is probably a bug
> too, just a different one...)
> 

Yes, there was a commit. In fact the patch prepare: git format-patch -1

> And if you edited it by hand, that might explain the issue, what did the
> "original" patch look like?

Attached the original patch I submitted:
0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch

Attached is also the patch without the hand-edited deletions:

ieee80211_softmac_fixes_v3.patch

My steps once having this were:

- run perl checkpatch -f 
- I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
extra white
  spaces. 
- Delete the spaces
- git send-email --annotate Patch

> 
> > I'll try with a newer version of git as you suggest.
> > Any other check I could do before the submission? I really don't like making
> > noise :-(
> 
> Let's see the original version firs

Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
> On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> > 
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > incorrect type in assignment (different base types)
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
> > restricted __le16 [usertype] frame_ctl
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > invalid assignment: |=
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
> > has type restricted __le16
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:    right 
> > side has type int
> > 
> > 
> > Signed-off-by: Gaston Gonzalez 
> > ---
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> 
> Still doesn't apply, but this might be a git bug, see below:
> 
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > index d2e8b12..0477ba1 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> > 
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > +   if (challengelen)
> > +   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> > 
> > auth->header.duration_id = 0x013a; //FIXME
> > 
> > --
> > 2.1.4
> 
> This patch is not created properly.  Did you edit it by hand?  If not,
> we need to report a bug as the diff is obviously wrong, look at the @@@
> line.
> 
> Can you update your version of git to see if it's fixed there?
> 
> Also, patch tells you that this is broken:
> 
> checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> patch:  malformed patch at line 132:skb_put(skb, 
> sizeof(struct ieee80211_authentication));

Greg,

The patch was prepared using git format-patch. The git version I'm using:

gaston22:\-$ git --version 
git version 2.1.4

I did deleted 4 whitespaces by hand after running checkpatch.pl on the patch.
Could that drive the issue? However, I could properly apply the patch using 'git
am' from an email and get the git log right.

I'll try with a newer version of git as you suggest.
Any other check I could do before the submission? I really don't like making
noise :-(

Thanks,

Gaston 

> 
> 
> 
> 
> > 
> > ___
> > devel mailing list
> > de...@linuxdriverproject.org
> > http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
--
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: [PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Sun, May 31, 2015 at 10:45:27AM +0900, Greg KH wrote:
> On Tue, May 26, 2015 at 06:47:14PM -0300, Gaston Gonzalez wrote:
> > Fix the following sparse warnings:
> > 
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
> > incorrect type in assignment (different base types)
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
> > restricted __le16 [usertype] frame_ctl
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
> > invalid assignment: |=
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
> > has type restricted __le16
> > drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:    right 
> > side has type int
> > 
> > 
> > Signed-off-by: Gaston Gonzalez 
> > ---
> >  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
> >  1 file changed, 3 insertions(+), 2 deletions(-)
> > 
> > diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
> > b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > index d2e8b12..0477ba1 100644
> > --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
> > @@ -660,2 +660,2 @@ inline struct sk_buff 
> > *ieee80211_authentication_req(struct ieee80211_network *be
> > auth = (struct ieee80211_authentication *)
> > skb_put(skb, sizeof(struct ieee80211_authentication));
> > 
> > -   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
> > -   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
> > +   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
> > +   if (challengelen)
> > +   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
> > 
> > auth->header.duration_id = 0x013a; //FIXME
> > 
> 
> This patch doesn't apply properly for some reason, can you fix it up and
> resend?
> 
> thanks,
> 
> greg k-h
Hi Greg,

I couldn't find the problem with this patch. Just in case I redo the patch
against the updated staging-testing and resent it. To test it I did:

 - run checkpatch
 - git apply --check
 - email it to myself and then 'git am' from mutt 
 - git log

I've just sent the patch. Please let me know if I missed something.

Thanks,

Gaston 
--
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/


[PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int


Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

auth->header.duration_id = 0x013a; //FIXME

--
2.1.4

--
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: [PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Sun, May 31, 2015 at 10:45:27AM +0900, Greg KH wrote:
 On Tue, May 26, 2015 at 06:47:14PM -0300, Gaston Gonzalez wrote:
  Fix the following sparse warnings:
  
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
  incorrect type in assignment (different base types)
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
  restricted __le16 [usertype] frame_ctl
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
  invalid assignment: |=
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
  has type restricted __le16
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
  side has type int
  
  
  Signed-off-by: Gaston Gonzalez gasc...@gmail.com
  ---
   drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
   1 file changed, 3 insertions(+), 2 deletions(-)
  
  diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
  b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  index d2e8b12..0477ba1 100644
  --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  @@ -660,2 +660,2 @@ inline struct sk_buff 
  *ieee80211_authentication_req(struct ieee80211_network *be
  auth = (struct ieee80211_authentication *)
  skb_put(skb, sizeof(struct ieee80211_authentication));
  
  -   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
  -   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
  +   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
  +   if (challengelen)
  +   auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
  
  auth-header.duration_id = 0x013a; //FIXME
  
 
 This patch doesn't apply properly for some reason, can you fix it up and
 resend?
 
 thanks,
 
 greg k-h
Hi Greg,

I couldn't find the problem with this patch. Just in case I redo the patch
against the updated staging-testing and resent it. To test it I did:

 - run checkpatch
 - git apply --check
 - email it to myself and then 'git am' from mutt 
 - git log

I've just sent the patch. Please let me know if I missed something.

Thanks,

Gaston 
--
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/


[PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int


Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

auth-header.duration_id = 0x013a; //FIXME

--
2.1.4

--
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: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
  On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
   On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got 
int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
invalid assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left 
side has type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
side has type int


Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
   
   Still doesn't apply, but this might be a git bug, see below:
   
diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff 
*ieee80211_authentication_req(struct ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth-header.frame_ctl |= 
cpu_to_le16(IEEE80211_FCTL_WEP);

auth-header.duration_id = 0x013a; //FIXME

--
2.1.4
   
   This patch is not created properly.  Did you edit it by hand?  If not,
   we need to report a bug as the diff is obviously wrong, look at the @@@
   line.
   
   Can you update your version of git to see if it's fixed there?
   
   Also, patch tells you that this is broken:
   
   checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
   patch:  malformed patch at line 132:skb_put(skb, 
   sizeof(struct ieee80211_authentication));
  
  Greg,
  
  The patch was prepared using git format-patch. The git version I'm using:
  
  gaston22:\-$ git --version 
  git version 2.1.4
  
  I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
  patch.
  Could that drive the issue? However, I could properly apply the patch using 
  'git
  am' from an email and get the git log right.
 
 Yes, but is there really a commit there?  That's what messed me up last
 time, git applied it, but with no actual diff (which is probably a bug
 too, just a different one...)
 

Yes, there was a commit. In fact the patch prepare: git format-patch -1

 And if you edited it by hand, that might explain the issue, what did the
 original patch look like?

Attached the original patch I submitted:
0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch

Attached is also the patch without the hand-edited deletions:

ieee80211_softmac_fixes_v3.patch

My steps once having this were:

- run perl checkpatch -f 
- I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
extra white
  spaces. 
- Delete the spaces
- git send-email --annotate Patch

 
  I'll try with a newer version of git as you suggest.
  Any other check I could do before the submission? I really don't like making
  noise :-(
 
 Let's see the original version first before blaming git.  Odds are you
 got something wrong when editing the patch by hand.
 

Ok.
 thanks,
 
 greg k-h

thanks,

Gaston
From b689a6d0de2a2d483e012698996b7bda9a33d6e2 Mon Sep 17 00:00:00 2001
From: Gaston Gonzalez gasc...@gmail.com
Date: Sun, 31 May 2015 01:07:54 -0300
Subject: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side has type int


Signed-off-by: Gaston Gonzalez gasc

Re: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
  Fix the following sparse warnings:
  
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
  incorrect type in assignment (different base types)
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
  restricted __le16 [usertype] frame_ctl
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: 
  invalid assignment: |=
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side 
  has type restricted __le16
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right 
  side has type int
  
  
  Signed-off-by: Gaston Gonzalez gasc...@gmail.com
  ---
   drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
   1 file changed, 3 insertions(+), 2 deletions(-)
 
 Still doesn't apply, but this might be a git bug, see below:
 
  diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
  b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  index d2e8b12..0477ba1 100644
  --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  @@ -660,2 +660,2 @@ inline struct sk_buff 
  *ieee80211_authentication_req(struct ieee80211_network *be
  auth = (struct ieee80211_authentication *)
  skb_put(skb, sizeof(struct ieee80211_authentication));
  
  -   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
  -   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
  +   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
  +   if (challengelen)
  +   auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);
  
  auth-header.duration_id = 0x013a; //FIXME
  
  --
  2.1.4
 
 This patch is not created properly.  Did you edit it by hand?  If not,
 we need to report a bug as the diff is obviously wrong, look at the @@@
 line.
 
 Can you update your version of git to see if it's fixed there?
 
 Also, patch tells you that this is broken:
 
 checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
 patch:  malformed patch at line 132:skb_put(skb, 
 sizeof(struct ieee80211_authentication));

Greg,

The patch was prepared using git format-patch. The git version I'm using:

gaston22:\-$ git --version 
git version 2.1.4

I did deleted 4 whitespaces by hand after running checkpatch.pl on the patch.
Could that drive the issue? However, I could properly apply the patch using 'git
am' from an email and get the git log right.

I'll try with a newer version of git as you suggest.
Any other check I could do before the submission? I really don't like making
noise :-(

Thanks,

Gaston 

 
 
 
 
  
  ___
  devel mailing list
  de...@linuxdriverproject.org
  http://driverdev.linuxdriverproject.org/mailman/listinfo/driverdev-devel
--
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: [PATCH RESEND] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-31 Thread Gaston Gonzalez
On Mon, Jun 01, 2015 at 10:53:20AM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 10:41:52PM -0300, Gaston Gonzalez wrote:
  On Mon, Jun 01, 2015 at 08:24:17AM +0900, Greg KH wrote:
   On Sun, May 31, 2015 at 08:07:21PM -0300, Gaston Gonzalez wrote:
On Mon, Jun 01, 2015 at 07:17:39AM +0900, Greg KH wrote:
 On Sun, May 31, 2015 at 12:17:48PM -0300, Gaston Gonzalez wrote:
  Fix the following sparse warnings:
  
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: 
  warning: incorrect type in assignment (different base types)
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
  expected restricted __le16 [usertype] frame_ctl
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:
  got int
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: 
  warning: invalid assignment: |=
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
  left side has type restricted __le16
  drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:
  right side has type int
  
  
  Signed-off-by: Gaston Gonzalez gasc...@gmail.com
  ---
   drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
   1 file changed, 3 insertions(+), 2 deletions(-)
 
 Still doesn't apply, but this might be a git bug, see below:
 
  diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
  b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  index d2e8b12..0477ba1 100644
  --- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  +++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
  @@ -660,2 +660,2 @@ inline struct sk_buff 
  *ieee80211_authentication_req(struct ieee80211_network *be
  auth = (struct ieee80211_authentication *)
  skb_put(skb, sizeof(struct ieee80211_authentication));
  
  -   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
  -   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
  +   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
  +   if (challengelen)
  +   auth-header.frame_ctl |= 
  cpu_to_le16(IEEE80211_FCTL_WEP);
  
  auth-header.duration_id = 0x013a; //FIXME
  
  --
  2.1.4
 
 This patch is not created properly.  Did you edit it by hand?  If not,
 we need to report a bug as the diff is obviously wrong, look at the 
 @@@
 line.
 
 Can you update your version of git to see if it's fixed there?
 
 Also, patch tells you that this is broken:
 
 checking file drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
 patch:  malformed patch at line 132:skb_put(skb, 
 sizeof(struct ieee80211_authentication));

Greg,

The patch was prepared using git format-patch. The git version I'm 
using:

gaston22:\-$ git --version 
git version 2.1.4

I did deleted 4 whitespaces by hand after running checkpatch.pl on the 
patch.
Could that drive the issue? However, I could properly apply the patch 
using 'git
am' from an email and get the git log right.
   
   Yes, but is there really a commit there?  That's what messed me up last
   time, git applied it, but with no actual diff (which is probably a bug
   too, just a different one...)
   
  
  Yes, there was a commit. In fact the patch prepare: git format-patch -1
  
   And if you edited it by hand, that might explain the issue, what did the
   original patch look like?
  
  Attached the original patch I submitted:
  0001-Regen-ieee80211_softmac.c-endianness-fix-patch.patch
 
 Which is broken.
 
  Attached is also the patch without the hand-edited deletions:
  
  ieee80211_softmac_fixes_v3.patch
 
 That patch is correct.
 
 Why did you edit the patch metadata in a way that was incorrect?

The only edit I did was from within git send-email --annotate. Nothing else. I
get now that that editor is not for everything... as I get the rest of the 
apply process 
 right, I thought it was ok that way. My bad :(
 
  
  My steps once having this were:
  
  - run perl checkpatch -f 
  - I got total: 4 errors, 0 warnings, 28 lines checked. The 4 warnings were 
  extra white
spaces. 
  - Delete the spaces
  - git send-email --annotate Patch
 
 You did a few other things here, you hand-edited the patch, which broke
 it.
 
 Yes, 'git am' does apply it, but not really, as there's a bug in git
 that you see I notified the git developers about.  So I still can't
 apply this patch, please resend it in a way that is not broken, like
 your attachment here :)
 
Ok, will do. Only one question left, I always get checkpatch.pl white spaces
errors after git format-patch, some of which weren't there before. So, what is 
the correct way of
fixing them? 

 thanks,
 
 greg k-h

Thanks for all the help,

Gaston
--
To unsubscribe from this list: send

[PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-26 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int


Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

auth->header.duration_id = 0x013a; //FIXME

--
2.1.4
--
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/


[PATCH] staging: rtl8192u: ieee80211: Fix sparse endianness warnings

2015-05-26 Thread Gaston Gonzalez
Fix the following sparse warnings:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50: warning: invalid 
assignment: |=
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:left side has 
type restricted __le16
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:664:50:right side 
has type int


Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-   if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+   if (challengelen)
+   auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

auth-header.duration_id = 0x013a; //FIXME

--
2.1.4
--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning

2015-05-25 Thread Gaston Gonzalez
On 25/05/15 13:35, Dan Carpenter wrote:
> This is also wrong then.
>
> regards,
> dan carpenter
Hi Dan,

Yes, you are right. It is the next sparse warning in line for that file.
Including the fix for that, the patch would be as showed below.

There are similar endianness warnings for other variables in that file,
like the FIXME in last line of the patch. But keeping in mind the rule
'one thing per patch' I guess this should be fixed in other patche/s, right?

Regards,

Gaston

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff
*ieee80211_authentication_req(struct ieee80211_network *be
 auth = (struct ieee80211_authentication *)
 skb_put(skb, sizeof(struct ieee80211_authentication));

-auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
-if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;
+auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+if (challengelen)
+auth->header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

 auth->header.duration_id = 0x013a; //FIXME

--
2.1.4

--
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/


[PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning

2015-05-25 Thread Gaston Gonzalez
Silence the following sparse warning:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int

Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..7dd8442 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth->header.frame_ctl = IEEE80211_STYPE_AUTH;
+   auth->header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
if (challengelen) auth->header.frame_ctl |= IEEE80211_FCTL_WEP;

auth->header.duration_id = 0x013a; //FIXME
--
2.1.4
--
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/


[PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning

2015-05-25 Thread Gaston Gonzalez
Silence the following sparse warning:

drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32: warning: 
incorrect type in assignment (different base types)
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:expected 
restricted __le16 [usertype] frame_ctl
drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c:663:32:got int

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..7dd8442 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff *ieee80211_authentication_req(struct 
ieee80211_network *be
auth = (struct ieee80211_authentication *)
skb_put(skb, sizeof(struct ieee80211_authentication));

-   auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
+   auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;

auth-header.duration_id = 0x013a; //FIXME
--
2.1.4
--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse endianness warning

2015-05-25 Thread Gaston Gonzalez
On 25/05/15 13:35, Dan Carpenter wrote:
 This is also wrong then.

 regards,
 dan carpenter
Hi Dan,

Yes, you are right. It is the next sparse warning in line for that file.
Including the fix for that, the patch would be as showed below.

There are similar endianness warnings for other variables in that file,
like the FIXME in last line of the patch. But keeping in mind the rule
'one thing per patch' I guess this should be fixed in other patche/s, right?

Regards,

Gaston

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
index d2e8b12..0477ba1 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_softmac.c
@@ -660,2 +660,2 @@ inline struct sk_buff
*ieee80211_authentication_req(struct ieee80211_network *be
 auth = (struct ieee80211_authentication *)
 skb_put(skb, sizeof(struct ieee80211_authentication));

-auth-header.frame_ctl = IEEE80211_STYPE_AUTH;
-if (challengelen) auth-header.frame_ctl |= IEEE80211_FCTL_WEP;
+auth-header.frame_ctl = cpu_to_le16(IEEE80211_STYPE_AUTH);
+if (challengelen)
+auth-header.frame_ctl |= cpu_to_le16(IEEE80211_FCTL_WEP);

 auth-header.duration_id = 0x013a; //FIXME

--
2.1.4

--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-05-06 Thread Gaston Gonzalez
On 27/04/15 07:12, Dan Carpenter wrote:
> Can't we just export the tkip.c function?
>
> regards,
> dan carpenter
>
Hi Dan,

(sorry for the delayed response)

The inputs of the two implementations of tkip_mixing_phase2() differ in
one parameter:

 - ieee80211_crypt_tkip.c expects 'const u16 *TTAK'
 - tkip.c expects 'struct tkip_ctx *ctx'

tkip_mixing_phase2() is called two times in ieee80211_crypt_tkip.c:

git grep tkip_mixing_phase2  drivers/staging/rtl8192u/ieee80211/

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:static void
tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c: 
tkip_mixing_phase2(rc4key, tkey->key, tkey->tx_ttak, tkey->tx_iv16);

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c: 
tkip_mixing_phase2(rc4key, tkey->key, tkey->rx_ttak, iv16);


tkey is a 'struct ieee80211_tkip_data', which differs from tkip_ctx
structure. So in the case of exporting the tkip.c function, we would
need to add 'struct tkip_ctx' definition, and not just change the
function input definition.

The only member of tkip_ctx structure used in tkip_mixing_phase2() is
p1k, which is the equivalent of TTAK array in ieee80211_crypt_tkip.c .
Thus - I'm new to this so I may be missing something - one way would be
to just add the tkip_ctx structure definition in ieee80211_crypt_tkip.c.
The down side of doing this is that there would be some parameters
defined twice in two different structures: u32 iv32, u16 iv16, u16
p1k[5], u32 p1k_iv32

Another way would be split ieee80211_tkip_data structure in struct
tkip_ctx on one side, and leave the rest of the members on the original
structure. This would avoid to duplicate the members definitions, but I
guess that approach could broke other things...

As I said, I'm new to this so I may be missing something, maybe a
different approach?

One detail: although not used in the function, 'enum
ieee80211_internal_tkip_state state' is not defined in 'struct
ieee80211_tkip_data', thus in any case that definition would have to be
added.

regards,

Gaston

--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-05-06 Thread Gaston Gonzalez
On 27/04/15 07:12, Dan Carpenter wrote:
 Can't we just export the tkip.c function?

 regards,
 dan carpenter

Hi Dan,

(sorry for the delayed response)

The inputs of the two implementations of tkip_mixing_phase2() differ in
one parameter:

 - ieee80211_crypt_tkip.c expects 'const u16 *TTAK'
 - tkip.c expects 'struct tkip_ctx *ctx'

tkip_mixing_phase2() is called two times in ieee80211_crypt_tkip.c:

git grep tkip_mixing_phase2  drivers/staging/rtl8192u/ieee80211/

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:static void
tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, const u16 *TTAK,

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c: 
tkip_mixing_phase2(rc4key, tkey-key, tkey-tx_ttak, tkey-tx_iv16);

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c: 
tkip_mixing_phase2(rc4key, tkey-key, tkey-rx_ttak, iv16);


tkey is a 'struct ieee80211_tkip_data', which differs from tkip_ctx
structure. So in the case of exporting the tkip.c function, we would
need to add 'struct tkip_ctx' definition, and not just change the
function input definition.

The only member of tkip_ctx structure used in tkip_mixing_phase2() is
p1k, which is the equivalent of TTAK array in ieee80211_crypt_tkip.c .
Thus - I'm new to this so I may be missing something - one way would be
to just add the tkip_ctx structure definition in ieee80211_crypt_tkip.c.
The down side of doing this is that there would be some parameters
defined twice in two different structures: u32 iv32, u16 iv16, u16
p1k[5], u32 p1k_iv32

Another way would be split ieee80211_tkip_data structure in struct
tkip_ctx on one side, and leave the rest of the members on the original
structure. This would avoid to duplicate the members definitions, but I
guess that approach could broke other things...

As I said, I'm new to this so I may be missing something, maybe a
different approach?

One detail: although not used in the function, 'enum
ieee80211_internal_tkip_state state' is not defined in 'struct
ieee80211_tkip_data', thus in any case that definition would have to be
added.

regards,

Gaston

--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-04-25 Thread Gaston Gonzalez
On 20/04/15 05:24, Dan Carpenter wrote:
> Mk16_le() is a bad function name and as we can see from tkip.c it just
> duplicates get_unaligned_le16().  Better to make TK void pointer instead
> of a u8 pointer (because it doesn't point to u8s so we have to cast it
> every time we use it).  This is another trick I learned from tkip.c.
Ok. Could I just remove Mk16_le() and use get_unaligned_le16() instead?

I built rtl8192u/ using get_unaligned_le16() for the following lines and
I didn't get any warning:

+#include 

-PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) [0]));
-PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) [0]));
-PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) [2]));
-PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) [4]));
-PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) [6]));
-PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) [8]));
-PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) [10]));
-
-PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) [12]));
-PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) [14]));
+PPK[0] += _S_(PPK[5] ^ get_unaligned_le16(TK + 0));
+PPK[1] += _S_(PPK[0] ^ get_unaligned_le16(TK + 2));
+PPK[2] += _S_(PPK[1] ^ get_unaligned_le16(TK + 4));
+PPK[3] += _S_(PPK[2] ^ get_unaligned_le16(TK + 6));
+PPK[4] += _S_(PPK[3] ^ get_unaligned_le16(TK + 8));
+PPK[5] += _S_(PPK[4] ^ get_unaligned_le16(TK + 10));
+
+PPK[0] += RotR1(PPK[5] ^ get_unaligned_le16(TK + 12));
+PPK[1] += RotR1(PPK[0] ^ get_unaligned_le16(TK + 14));


--
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: [PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-04-25 Thread Gaston Gonzalez
On 20/04/15 05:24, Dan Carpenter wrote:
 Mk16_le() is a bad function name and as we can see from tkip.c it just
 duplicates get_unaligned_le16().  Better to make TK void pointer instead
 of a u8 pointer (because it doesn't point to u8s so we have to cast it
 every time we use it).  This is another trick I learned from tkip.c.
Ok. Could I just remove Mk16_le() and use get_unaligned_le16() instead?

I built rtl8192u/ using get_unaligned_le16() for the following lines and
I didn't get any warning:

+#include asm/unaligned.h

-PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) TK[0]));
-PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) TK[0]));
-PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) TK[2]));
-PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) TK[4]));
-PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) TK[6]));
-PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) TK[8]));
-PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) TK[10]));
-
-PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) TK[12]));
-PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) TK[14]));
+PPK[0] += _S_(PPK[5] ^ get_unaligned_le16(TK + 0));
+PPK[1] += _S_(PPK[0] ^ get_unaligned_le16(TK + 2));
+PPK[2] += _S_(PPK[1] ^ get_unaligned_le16(TK + 4));
+PPK[3] += _S_(PPK[2] ^ get_unaligned_le16(TK + 6));
+PPK[4] += _S_(PPK[3] ^ get_unaligned_le16(TK + 8));
+PPK[5] += _S_(PPK[4] ^ get_unaligned_le16(TK + 10));
+
+PPK[0] += RotR1(PPK[5] ^ get_unaligned_le16(TK + 12));
+PPK[1] += RotR1(PPK[0] ^ get_unaligned_le16(TK + 14));


--
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/


[PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-04-19 Thread Gaston Gonzalez
Silence the following sparse warning:

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:184:16: warning: cast 
to restricted __le16

Signed-off-by: Gaston Gonzalez 
---
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index e815c81..efa6983 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -179,1 +179,1 @@ static inline u16 Mk16(u8 hi, u8 lo)
 }


-static inline u16 Mk16_le(u16 *v)
+static inline u16 Mk16_le(__le16 *v)
 {
return le16_to_cpu(*v);
 }
@@ -270,1 +270,1 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, 
const u16 *TTAK,
PPK[5] = TTAK[4] + IV16;

/* Step 2 - 96-bit bijective mixing using S-box */
-   PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) [0]));
-   PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) [2]));
-   PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) [4]));
-   PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) [6]));
-   PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) [8]));
-   PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) [10]));
-
-   PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) [12]));
-   PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) [14]));
+   PPK[0] += _S_(PPK[5] ^ Mk16_le((__le16 *) [0]));
+   PPK[1] += _S_(PPK[0] ^ Mk16_le((__le16 *) [2]));
+   PPK[2] += _S_(PPK[1] ^ Mk16_le((__le16 *) [4]));
+   PPK[3] += _S_(PPK[2] ^ Mk16_le((__le16 *) [6]));
+   PPK[4] += _S_(PPK[3] ^ Mk16_le((__le16 *) [8]));
+   PPK[5] += _S_(PPK[4] ^ Mk16_le((__le16 *) [10]));
+
+   PPK[0] += RotR1(PPK[5] ^ Mk16_le((__le16 *) [12]));
+   PPK[1] += RotR1(PPK[0] ^ Mk16_le((__le16 *) [14]));
PPK[2] += RotR1(PPK[1]);
PPK[3] += RotR1(PPK[2]);
PPK[4] += RotR1(PPK[3]);
@@ -289,4 +289,4 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, 
const u16 *TTAK,
WEPSeed[0] = Hi8(IV16);
WEPSeed[1] = (Hi8(IV16) | 0x20) & 0x7F;
WEPSeed[2] = Lo8(IV16);
-   WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((u16 *) [0])) >> 1);
+   WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((__le16 *) [0])) >> 1);

 #ifdef __BIG_ENDIAN
{
--
2.1.4

--
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/


[PATCH] staging: rtl8192u: ieee80211: Silence sparse warning

2015-04-19 Thread Gaston Gonzalez
Silence the following sparse warning:

drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c:184:16: warning: cast 
to restricted __le16

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 .../rtl8192u/ieee80211/ieee80211_crypt_tkip.c  | 22 +++---
 1 file changed, 11 insertions(+), 11 deletions(-)

diff --git a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c 
b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
index e815c81..efa6983 100644
--- a/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
+++ b/drivers/staging/rtl8192u/ieee80211/ieee80211_crypt_tkip.c
@@ -179,1 +179,1 @@ static inline u16 Mk16(u8 hi, u8 lo)
 }


-static inline u16 Mk16_le(u16 *v)
+static inline u16 Mk16_le(__le16 *v)
 {
return le16_to_cpu(*v);
 }
@@ -270,1 +270,1 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, 
const u16 *TTAK,
PPK[5] = TTAK[4] + IV16;

/* Step 2 - 96-bit bijective mixing using S-box */
-   PPK[0] += _S_(PPK[5] ^ Mk16_le((u16 *) TK[0]));
-   PPK[1] += _S_(PPK[0] ^ Mk16_le((u16 *) TK[2]));
-   PPK[2] += _S_(PPK[1] ^ Mk16_le((u16 *) TK[4]));
-   PPK[3] += _S_(PPK[2] ^ Mk16_le((u16 *) TK[6]));
-   PPK[4] += _S_(PPK[3] ^ Mk16_le((u16 *) TK[8]));
-   PPK[5] += _S_(PPK[4] ^ Mk16_le((u16 *) TK[10]));
-
-   PPK[0] += RotR1(PPK[5] ^ Mk16_le((u16 *) TK[12]));
-   PPK[1] += RotR1(PPK[0] ^ Mk16_le((u16 *) TK[14]));
+   PPK[0] += _S_(PPK[5] ^ Mk16_le((__le16 *) TK[0]));
+   PPK[1] += _S_(PPK[0] ^ Mk16_le((__le16 *) TK[2]));
+   PPK[2] += _S_(PPK[1] ^ Mk16_le((__le16 *) TK[4]));
+   PPK[3] += _S_(PPK[2] ^ Mk16_le((__le16 *) TK[6]));
+   PPK[4] += _S_(PPK[3] ^ Mk16_le((__le16 *) TK[8]));
+   PPK[5] += _S_(PPK[4] ^ Mk16_le((__le16 *) TK[10]));
+
+   PPK[0] += RotR1(PPK[5] ^ Mk16_le((__le16 *) TK[12]));
+   PPK[1] += RotR1(PPK[0] ^ Mk16_le((__le16 *) TK[14]));
PPK[2] += RotR1(PPK[1]);
PPK[3] += RotR1(PPK[2]);
PPK[4] += RotR1(PPK[3]);
@@ -289,4 +289,4 @@ static void tkip_mixing_phase2(u8 *WEPSeed, const u8 *TK, 
const u16 *TTAK,
WEPSeed[0] = Hi8(IV16);
WEPSeed[1] = (Hi8(IV16) | 0x20)  0x7F;
WEPSeed[2] = Lo8(IV16);
-   WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((u16 *) TK[0]))  1);
+   WEPSeed[3] = Lo8((PPK[5] ^ Mk16_le((__le16 *) TK[0]))  1);

 #ifdef __BIG_ENDIAN
{
--
2.1.4

--
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/


[PATCH] drivers: staging: imx-drm Fix checkpatch warning

2014-10-15 Thread Gaston Gonzalez
Fix line over 80 characters in imx-tve.c

Signed-off-by: Gaston Gonzalez 
---
 drivers/staging/imx-drm/imx-tve.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index 3e8b0a1..a46905f 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -665,7 +665,8 @@ static int imx_tve_bind(struct device *dev, struct device 
*master, void *data)
 
ret = regmap_read(tve->regmap, TVE_COM_CONF_REG, );
if (ret < 0) {
-   dev_err(dev, "failed to read configuration register: %d\n", 
ret);
+   dev_err(dev, "failed to read configuration register: %d\n",
+   ret);
return ret;
}
if (val != 0x0010) {
-- 
1.7.10.4

--
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/


[PATCH] drivers: staging: imx-drm Fix checkpatch warning

2014-10-15 Thread Gaston Gonzalez
Fix line over 80 characters in imx-tve.c

Signed-off-by: Gaston Gonzalez gasc...@gmail.com
---
 drivers/staging/imx-drm/imx-tve.c |3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/drivers/staging/imx-drm/imx-tve.c 
b/drivers/staging/imx-drm/imx-tve.c
index 3e8b0a1..a46905f 100644
--- a/drivers/staging/imx-drm/imx-tve.c
+++ b/drivers/staging/imx-drm/imx-tve.c
@@ -665,7 +665,8 @@ static int imx_tve_bind(struct device *dev, struct device 
*master, void *data)
 
ret = regmap_read(tve-regmap, TVE_COM_CONF_REG, val);
if (ret  0) {
-   dev_err(dev, failed to read configuration register: %d\n, 
ret);
+   dev_err(dev, failed to read configuration register: %d\n,
+   ret);
return ret;
}
if (val != 0x0010) {
-- 
1.7.10.4

--
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/