]> git.baikalelectronics.ru Git - kernel.git/commit
iwlagn: fix (remove) use of PAGE_SIZE
authorJohannes Berg <johannes.berg@intel.com>
Mon, 19 Dec 2011 22:00:59 +0000 (14:00 -0800)
committerJohn W. Linville <linville@tuxdriver.com>
Wed, 21 Dec 2011 20:06:10 +0000 (15:06 -0500)
commit0562ebf5026a8611d265f74df10b9e7985dfa361
tree0f1f4be9f1f7b39e014443f96cc1d08efff1ea35
parentdb8e720848ace4f8c7dd4761fb45fac3c35116b3
iwlagn: fix (remove) use of PAGE_SIZE

The ICT code erroneously uses PAGE_SIZE. The bug
is that PAGE_SIZE isn't necessarily 4096, so on
such platforms this code will not work correctly
as we'll try to attempt to read an index in the
table that the device never wrote, it always has
4096-byte pages.

Additionally, the manual alignment code here is
unnecessary -- Documentation/DMA-API-HOWTO.txt
states:
  The cpu return address and the DMA bus master address are both
  guaranteed to be aligned to the smallest PAGE_SIZE order which
  is greater than or equal to the requested size.  This invariant
  exists (for example) to guarantee that if you allocate a chunk
  which is smaller than or equal to 64 kilobytes, the extent of the
  buffer you receive will not cross a 64K boundary.

Just use appropriate new constants and get rid of
the alignment code.

Cc: Emmanuel Grumbach <emmanuel.grumbach@intel.com>
Cc: stable@vger.kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Wey-Yi Guy <wey-yi.w.guy@intel.com>
Signed-off-by: John W. Linville <linville@tuxdriver.com>
drivers/net/wireless/iwlwifi/iwl-trans-pcie-int.h
drivers/net/wireless/iwlwifi/iwl-trans-pcie-rx.c