Re: [PATCH 1/8] misc: cxl: clean up afu_read_config()

2015-08-05 Thread Michael Neuling
On Mon, 2015-07-27 at 00:18 +0300, Vladimir Zapolskiy wrote:
> The sanity checks for overflow are not needed, because this is done on
> caller side in fs/sysfs/file.c
> 
> Signed-off-by: Vladimir Zapolskiy 
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: Ian Munsie 
> Cc: Michael Neuling 

Acked-by: Michael Neuling 

> ---
>  drivers/misc/cxl/sysfs.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
> index 31f38bc..87cd747 100644
> --- a/drivers/misc/cxl/sysfs.c
> +++ b/drivers/misc/cxl/sysfs.c
> @@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
> kobject *kobj,
>   struct afu_config_record *cr = to_cr(kobj);
>   struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct 
> device, kobj));
>  
> - u64 i, j, val, size = afu->crs_len;
> -
> - if (off > size)
> - return 0;
> - if (off + count > size)
> - count = size - off;
> + u64 i, j, val;
>  
>   for (i = 0; i < count;) {
>   val = cxl_afu_cr_read64(afu, cr->cr, off & ~0x7);

--
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 1/8] misc: cxl: clean up afu_read_config()

2015-08-05 Thread Michael Neuling
On Mon, 2015-07-27 at 00:18 +0300, Vladimir Zapolskiy wrote:
 The sanity checks for overflow are not needed, because this is done on
 caller side in fs/sysfs/file.c
 
 Signed-off-by: Vladimir Zapolskiy v...@mleia.com
 Cc: linuxppc-...@lists.ozlabs.org
 Cc: Ian Munsie imun...@au1.ibm.com
 Cc: Michael Neuling mi...@neuling.org

Acked-by: Michael Neuling mi...@neuling.org

 ---
  drivers/misc/cxl/sysfs.c | 7 +--
  1 file changed, 1 insertion(+), 6 deletions(-)
 
 diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
 index 31f38bc..87cd747 100644
 --- a/drivers/misc/cxl/sysfs.c
 +++ b/drivers/misc/cxl/sysfs.c
 @@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
 kobject *kobj,
   struct afu_config_record *cr = to_cr(kobj);
   struct cxl_afu *afu = to_cxl_afu(container_of(kobj-parent, struct 
 device, kobj));
  
 - u64 i, j, val, size = afu-crs_len;
 -
 - if (off  size)
 - return 0;
 - if (off + count  size)
 - count = size - off;
 + u64 i, j, val;
  
   for (i = 0; i  count;) {
   val = cxl_afu_cr_read64(afu, cr-cr, off  ~0x7);

--
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 1/8] misc: cxl: clean up afu_read_config()

2015-07-26 Thread Daniel Axtens
Hi,

Reviewed-by: Daniel Axtens 

FWIW, Ian is on leave for 2 weeks and Mikey for 1 week. However, as one
of the other CXL developers I'm very happy for this patch to go in.

Regards,
Daniel

On Mon, 2015-07-27 at 00:18 +0300, Vladimir Zapolskiy wrote:
> The sanity checks for overflow are not needed, because this is done on
> caller side in fs/sysfs/file.c
> 
> Signed-off-by: Vladimir Zapolskiy 
> Cc: linuxppc-...@lists.ozlabs.org
> Cc: Ian Munsie 
> Cc: Michael Neuling 
> ---
>  drivers/misc/cxl/sysfs.c | 7 +--
>  1 file changed, 1 insertion(+), 6 deletions(-)
> 
> diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
> index 31f38bc..87cd747 100644
> --- a/drivers/misc/cxl/sysfs.c
> +++ b/drivers/misc/cxl/sysfs.c
> @@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
> kobject *kobj,
>   struct afu_config_record *cr = to_cr(kobj);
>   struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct 
> device, kobj));
>  
> - u64 i, j, val, size = afu->crs_len;
> -
> - if (off > size)
> - return 0;
> - if (off + count > size)
> - count = size - off;
> + u64 i, j, val;
>  
>   for (i = 0; i < count;) {
>   val = cxl_afu_cr_read64(afu, cr->cr, off & ~0x7);



signature.asc
Description: This is a digitally signed message part


[PATCH 1/8] misc: cxl: clean up afu_read_config()

2015-07-26 Thread Vladimir Zapolskiy
The sanity checks for overflow are not needed, because this is done on
caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy 
Cc: linuxppc-...@lists.ozlabs.org
Cc: Ian Munsie 
Cc: Michael Neuling 
---
 drivers/misc/cxl/sysfs.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index 31f38bc..87cd747 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
kobject *kobj,
struct afu_config_record *cr = to_cr(kobj);
struct cxl_afu *afu = to_cxl_afu(container_of(kobj->parent, struct 
device, kobj));
 
-   u64 i, j, val, size = afu->crs_len;
-
-   if (off > size)
-   return 0;
-   if (off + count > size)
-   count = size - off;
+   u64 i, j, val;
 
for (i = 0; i < count;) {
val = cxl_afu_cr_read64(afu, cr->cr, off & ~0x7);
-- 
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 1/8] misc: cxl: clean up afu_read_config()

2015-07-26 Thread Daniel Axtens
Hi,

Reviewed-by: Daniel Axtens d...@axtens.net

FWIW, Ian is on leave for 2 weeks and Mikey for 1 week. However, as one
of the other CXL developers I'm very happy for this patch to go in.

Regards,
Daniel

On Mon, 2015-07-27 at 00:18 +0300, Vladimir Zapolskiy wrote:
 The sanity checks for overflow are not needed, because this is done on
 caller side in fs/sysfs/file.c
 
 Signed-off-by: Vladimir Zapolskiy v...@mleia.com
 Cc: linuxppc-...@lists.ozlabs.org
 Cc: Ian Munsie imun...@au1.ibm.com
 Cc: Michael Neuling mi...@neuling.org
 ---
  drivers/misc/cxl/sysfs.c | 7 +--
  1 file changed, 1 insertion(+), 6 deletions(-)
 
 diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
 index 31f38bc..87cd747 100644
 --- a/drivers/misc/cxl/sysfs.c
 +++ b/drivers/misc/cxl/sysfs.c
 @@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
 kobject *kobj,
   struct afu_config_record *cr = to_cr(kobj);
   struct cxl_afu *afu = to_cxl_afu(container_of(kobj-parent, struct 
 device, kobj));
  
 - u64 i, j, val, size = afu-crs_len;
 -
 - if (off  size)
 - return 0;
 - if (off + count  size)
 - count = size - off;
 + u64 i, j, val;
  
   for (i = 0; i  count;) {
   val = cxl_afu_cr_read64(afu, cr-cr, off  ~0x7);



signature.asc
Description: This is a digitally signed message part


[PATCH 1/8] misc: cxl: clean up afu_read_config()

2015-07-26 Thread Vladimir Zapolskiy
The sanity checks for overflow are not needed, because this is done on
caller side in fs/sysfs/file.c

Signed-off-by: Vladimir Zapolskiy v...@mleia.com
Cc: linuxppc-...@lists.ozlabs.org
Cc: Ian Munsie imun...@au1.ibm.com
Cc: Michael Neuling mi...@neuling.org
---
 drivers/misc/cxl/sysfs.c | 7 +--
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/drivers/misc/cxl/sysfs.c b/drivers/misc/cxl/sysfs.c
index 31f38bc..87cd747 100644
--- a/drivers/misc/cxl/sysfs.c
+++ b/drivers/misc/cxl/sysfs.c
@@ -443,12 +443,7 @@ static ssize_t afu_read_config(struct file *filp, struct 
kobject *kobj,
struct afu_config_record *cr = to_cr(kobj);
struct cxl_afu *afu = to_cxl_afu(container_of(kobj-parent, struct 
device, kobj));
 
-   u64 i, j, val, size = afu-crs_len;
-
-   if (off  size)
-   return 0;
-   if (off + count  size)
-   count = size - off;
+   u64 i, j, val;
 
for (i = 0; i  count;) {
val = cxl_afu_cr_read64(afu, cr-cr, off  ~0x7);
-- 
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/