Patchwork [6/6] msix: remove range checks.

login
register
mail settings
Submitter Isaku Yamahata
Date Oct. 27, 2010, 10:21 a.m.
Message ID <676a90a3f99920d2d3b9ecec3ac6c83c87cacc12.1288174753.git.yamahata@valinux.co.jp>
Download mbox | patch
Permalink /patch/69340/
State New
Headers show

Comments

Isaku Yamahata - Oct. 27, 2010, 10:21 a.m.
Same as 4b78560503a802eae3663ace9f9cf080319e7265
> config write handlers should be idempotent.
> So no need for range checks.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
---
 hw/msix.c |    5 -----
 1 files changed, 0 insertions(+), 5 deletions(-)
Michael S. Tsirkin - Oct. 27, 2010, 2:52 p.m.
On Wed, Oct 27, 2010 at 07:21:21PM +0900, Isaku Yamahata wrote:
> Same as 4b78560503a802eae3663ace9f9cf080319e7265
> > config write handlers should be idempotent.
> > So no need for range checks.
> 
> Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>

Well I changed my mind on 4b78560503a802eae3663ace9f9cf080319e7265 :) As
long as the check is simple, it does not hurt.

> ---
>  hw/msix.c |    5 -----
>  1 files changed, 0 insertions(+), 5 deletions(-)
> 
> diff --git a/hw/msix.c b/hw/msix.c
> index f66d255..20caa5e 100644
> --- a/hw/msix.c
> +++ b/hw/msix.c
> @@ -157,14 +157,9 @@ static void msix_handle_mask_update(PCIDevice *dev, int vector)
>  void msix_write_config(PCIDevice *dev, uint32_t addr,
>                         uint32_t val, int len)
>  {
> -    unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET;
>      int vector;
>      int i;
>  
> -    if (!range_covers_byte(addr, len, enable_pos)) {
> -        return;
> -    }
> -
>      if (!msix_enabled(dev)) {
>          return;
>      }
> -- 
> 1.7.1.1

Patch

diff --git a/hw/msix.c b/hw/msix.c
index f66d255..20caa5e 100644
--- a/hw/msix.c
+++ b/hw/msix.c
@@ -157,14 +157,9 @@  static void msix_handle_mask_update(PCIDevice *dev, int vector)
 void msix_write_config(PCIDevice *dev, uint32_t addr,
                        uint32_t val, int len)
 {
-    unsigned enable_pos = dev->msix_cap + MSIX_CONTROL_OFFSET;
     int vector;
     int i;
 
-    if (!range_covers_byte(addr, len, enable_pos)) {
-        return;
-    }
-
     if (!msix_enabled(dev)) {
         return;
     }