Message ID | 554b10f3-dbd5-46a2-8d98-9b3ecaf9465a@moroto.mountain (mailing list archive) |
---|---|
State | Accepted |
Delegated to: | Vishal Verma |
Headers | show |
Series | dax: remove unnecessary check | expand |
On 10/5/23 06:58, Dan Carpenter wrote: > We know that "rc" is zero so there is no need to check. > > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> Reviewed-by: Dave Jiang <dave.jiang@intel.com> > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > index 1d818401103b..ea7298d8da99 100644 > --- a/drivers/dax/bus.c > +++ b/drivers/dax/bus.c > @@ -1300,7 +1300,7 @@ static ssize_t memmap_on_memory_store(struct device *dev, > dev_dax->memmap_on_memory = val; > > device_unlock(dax_region->dev); > - return rc == 0 ? len : rc; > + return len; > } > static DEVICE_ATTR_RW(memmap_on_memory); >
On Thu, 2023-10-05 at 16:58 +0300, Dan Carpenter wrote: > We know that "rc" is zero so there is no need to check. > > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > --- > drivers/dax/bus.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > index 1d818401103b..ea7298d8da99 100644 > --- a/drivers/dax/bus.c > +++ b/drivers/dax/bus.c > @@ -1300,7 +1300,7 @@ static ssize_t memmap_on_memory_store(struct device *dev, > dev_dax->memmap_on_memory = val; > > device_unlock(dax_region->dev); > - return rc == 0 ? len : rc; > + return len; > } > static DEVICE_ATTR_RW(memmap_on_memory); > Hi Dan, thanks for the report - since this function is only in mm- unstable currently, and I have a new revision about to go out, I'll just include this fixup in it.
On Thu, Oct 05, 2023 at 05:17:17PM +0000, Verma, Vishal L wrote: > On Thu, 2023-10-05 at 16:58 +0300, Dan Carpenter wrote: > > We know that "rc" is zero so there is no need to check. > > > > Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> > > --- > > drivers/dax/bus.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c > > index 1d818401103b..ea7298d8da99 100644 > > --- a/drivers/dax/bus.c > > +++ b/drivers/dax/bus.c > > @@ -1300,7 +1300,7 @@ static ssize_t memmap_on_memory_store(struct device *dev, > > dev_dax->memmap_on_memory = val; > > > > device_unlock(dax_region->dev); > > - return rc == 0 ? len : rc; > > + return len; > > } > > static DEVICE_ATTR_RW(memmap_on_memory); > > > Hi Dan, thanks for the report - since this function is only in mm- > unstable currently, and I have a new revision about to go out, I'll > just include this fixup in it. That works. Thanks! regards, dan carpenter
diff --git a/drivers/dax/bus.c b/drivers/dax/bus.c index 1d818401103b..ea7298d8da99 100644 --- a/drivers/dax/bus.c +++ b/drivers/dax/bus.c @@ -1300,7 +1300,7 @@ static ssize_t memmap_on_memory_store(struct device *dev, dev_dax->memmap_on_memory = val; device_unlock(dax_region->dev); - return rc == 0 ? len : rc; + return len; } static DEVICE_ATTR_RW(memmap_on_memory);
We know that "rc" is zero so there is no need to check. Signed-off-by: Dan Carpenter <dan.carpenter@linaro.org> --- drivers/dax/bus.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)