Rule r does not depend on rule i (which is the include of
linux/kernel.h) so the output should not depend on i in
org and report mode.
Signed-off-by: Jérémy Lefaure
Acked-by: Julia Lawall
---
scripts/coccinelle/misc/array_size.cocci | 4 ++--
1 file changed, 2 insertions(+), 2 deletions
Hi,
On Thu, 14 Sep 2017 13:21:13 +0200 (CEST)
Julia Lawall wrote:
> On Wed, 13 Sep 2017, Jérémy Lefaure wrote:
>
> > Rule r does not depend on rule i (which is the include of
> > linux/kernel.h) so the output should not depend on i in
> > org and report mode.
>
On Wed, 29 Nov 2017 17:22:22 +
alexander.le...@verizon.com wrote:
> From: Jérémy Lefaure
>
> [ Upstream commit e61555c29c28a4a3b6ba6207f4a0883ee236004d ]
>
> The MTR_DRAM_WIDTH macro returns the data width. It is sometimes used
> as if it returned a boolean true if the w
Commit-ID: 0cfe5b5fc0277463fa795dea312a3a2fd5e8bac2
Gitweb: https://git.kernel.org/tip/0cfe5b5fc0277463fa795dea312a3a2fd5e8bac2
Author: Jérémy Lefaure
AuthorDate: Sun, 1 Oct 2017 15:30:50 -0400
Committer: Thomas Gleixner
CommitDate: Thu, 19 Oct 2017 16:15:47 +0200
x86: Use ARRAY_SIZE
Reding
Signed-off-by: Jérémy Lefaure
---
This patch was part of a bigger patch [1] reviewed by Thierry Reding
before it was split in several patches.
[1]: https://patchwork.kernel.org/patch/9979843/
drivers/gpu/drm/via/via_verifier.c | 10 --
1 file changed, 4 insertions(+), 6 deletions
/sizeof(T))
)
Reviewed-by: Thierry Reding
Signed-off-by: Jérémy Lefaure
---
This patch was part of a bigger patch [1] reviewed by Thierry Reding
before it was split in several patches.
[1]: https://patchwork.kernel.org/patch/9979843/
drivers/gpu/drm/nouveau/nvkm/subdev/bios/init.c | 7
of(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
This patch was part of a bigger patch [1].
[1]: https://patchwork.kernel.org/patch/9979843/
drivers/gpu/drm/i915/gvt/vgpu.c | 9 -
1 file changed, 4 insertions(+), 5 deletions(-)
/sizeof(T))
)
Reviewed-by: Thierry Reding
Signed-off-by: Jérémy Lefaure
---
This patch was part of a bigger patch [1] reviewed by Thierry Reding
before it was split in several patches.
[1]: https://patchwork.kernel.org/patch/9979843/
drivers/gpu/drm/gma500/psb_intel_sdvo.c | 9 -
1
Reding
Signed-off-by: Jérémy Lefaure
---
This patch was part of a bigger patch [1] reviewed by Thierry Reding
before it was split in several patches.
[1]: https://patchwork.kernel.org/patch/9979843/
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9
eof(T))
)
Signed-off-by: Jérémy Lefaure
---
Changes since v1:
- keep DATA_CNT as suggested by Steven Rostedt
kernel/trace/trace_events_filter.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/kernel/trace/trace_events_filter.c
b/kernel/trace/trace_events_filter.c
index 61e7f06
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
On Wed, 4 Oct 2017 15:14:49 +0300
Jarkko Sakkinen wrote:
> On Sun, Oct 01, 2017 at 03:30:51PM -0400, Jérémy Lefaure wrote:
> > Using the ARRAY_SIZE macro improves the readability of the code.
> >
> > Found with Coccinelle with the following semantic patch:
> > @
On Mon, 02 Oct 2017 14:27:52 +0200
"Rafael J. Wysocki" wrote:
> ACPICA is soewhat special code, though and I'm not taking or ACKing patches
> for it directly as a rule.
>
> For one, I'm not sure if ACPICA can use ARRAY_SIZE at all.
Why is it special code that can't use ARRAY_SIZE ? Is it because
On Mon, 2 Oct 2017 15:22:24 -0400
bfie...@fieldses.org (J. Bruce Fields) wrote:
> Mainly I'd just like to know which you're asking for. Do you want me to
> apply this, or to ACK it so someone else can? If it's sent as a series
> I tend to assume the latter.
>
> But in this case I'm assuming it'
On Mon, 2 Oct 2017 16:07:36 +0300
Andy Shevchenko wrote:
> > + {&gainctrl_lut_core0_rev0, ARRAY_SIZE(gainctrl_lut_core0_rev0), 26,
> > 192,
> > +32},
>
> For all such cases I would rather put on one line disregard checkpatch
> warning for better readability.
I agree that it woul
On Sun, 01 Oct 2017 21:16:19 -0700
Joe Perches wrote:
> These sorts of changes are OK, but for many
> uses, it's more readable to use ARRAY_SIZE(foo)
> in each location rather than using a temporary.
You're right, I missed that one. I will send a v2.
Thank you for your review,
Jérémy
On Mon, 02 Oct 2017 16:46:29 +0300
Kalle Valo wrote:
> We have a tree for wireless so usually it's better to submit wireless
> changes on their own but here I assume Dave will apply this to his tree.
> If not, please resubmit the wireless part in a separate patch.
Ok, I note that.
I'll wait Dave
On Mon, 2 Oct 2017 09:01:31 +1100
"Tobin C. Harding" wrote:
> > In order to reduce the size of the To: and Cc: lines, each patch of the
> > series is sent only to the maintainers and lists concerned by the patch.
> > This cover letter is sent to every list concerned by this series.
>
> Why don
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
/sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/net/ethernet/emulex/benet/be_cmds.c| 4 +-
drivers/net/ethernet/intel/i40e/i40e_adminq.h | 3 +-
drivers/net/ethernet/intel/i40evf/i40e_adminq.h| 3
;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/gpu/drm/amd/amdgpu/gfx_v8_0.c | 9 +
drivers/gpu/drm/amd/amdgpu/gfx_v9_0.c | 9 +
drivers/gpu/drm
izeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/char/ipmi/ipmi_poweroff.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/char/ipmi/ipmi_poweroff.c
b/drivers/char/ipmi/ipmi_powero
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
e T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/acpi/acpica/rsdumpinfo.c | 66
drivers/acpi/acpica/tbfadt.c | 13 +++-
2 files c
/sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
arch/x86/boot/video-vga.c| 6 +++---
arch/x86/entry/vdso/vdso2c.c | 3 ++-
arch/x86/platform/intel-mid/device_libs
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/staging/rtlwifi/phydm/phydm_debug.c| 4 ++--
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_bb.c | 10 --
drivers/staging/rtlwifi/phydm/rtl8822b
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
/sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/staging/rtl8723bs/core/rtw_mlme_ext.c | 5 +-
drivers/staging/rtl8723bs/core/rtw_rf.c | 7 +--
drivers/staging/rtl8723bs/hal/HalHWImg8723B_BB.c | 9 ++-
drivers
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
/sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
drivers/media/common/saa7146/saa7146_video.c | 9 -
drivers/media/dvb-frontends/cxd2841er.c | 7 +++
drivers/media/pci/saa7146/hexium_gemini.c| 3 ++-
drivers/media
(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy Lefaure
---
.../pci/atomisp2/css2400/camera/pipe/src/pipe_binarydesc.c | 9 +++--
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git
a/drivers/staging/media/atomisp/pci/atomisp2/css2400
Hi everyone,
Using ARRAY_SIZE improves the code readability. I used coccinelle (I
made a change to the array_size.cocci file [1]) to find several places
where ARRAY_SIZE could be used instead of other macros or sizeof
division.
I tried to divide the changes into a patch per subsystem (excepted for
eof(T))
)
Signed-off-by: Jérémy Lefaure
---
kernel/trace/trace_events_filter.c | 7 +++
1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/kernel/trace/trace_events_filter.c
b/kernel/trace/trace_events_filter.c
index 61e7f0678d33..02d0f378dc5c 100644
--- a/kernel/trace/trace_events_fil
Using the ARRAY_SIZE macro improves the readability of the code.
Found with Coccinelle with the following semantic patch:
@r depends on (org || report)@
type T;
T[] E;
position p;
@@
(
(sizeof(E)@p /sizeof(*E))
|
(sizeof(E)@p /sizeof(E[...]))
|
(sizeof(E)@p /sizeof(T))
)
Signed-off-by: Jérémy
Rule r does not depend on rule i (which is the include of
linux/kernel.h) so the output should not depend on i in
org and report mode.
Signed-off-by: Jérémy Lefaure
---
I have tested this patch in report mode on the file
drivers/staging/rtlwifi/phydm/rtl8822b/halhwimg8822b_rf.c which does not
KTHREAD_SIZE has never been used since it has been defined for c6x arch.
Let's remove this useless definition.
Signed-off-by: Jérémy Lefaure
Acked-by: Mark Salter
---
Hi,
I sent this patch in June. It was acked by Mark Salter but I don't see
it in the last kernel release so I resen
> gcc points out a minor bug in the handling of unknown
> cookie types, which could result in a string overflow
> when the integer is copied into a 3-byte string:
>
> fs/fscache/object-list.c: In function 'fscache_objlist_show':
> fs/fscache/object-list.c:265:19: error: 'sprintf' may write a
> ter
]:
https://www.intel.com/content/dam/doc/datasheet/5000p-5000v-5000z-chipset-memory-controller-hub-datasheet.pdf
[2]:
https://www.intel.se/content/dam/doc/datasheet/5400-chipset-memory-controller-hub-datasheet.pdf
Signed-off-by: Jérémy Lefaure
---
I have found this error thanks to the sparse tool
On Wed, 28 Jun 2017 18:08:51 +0200
Borislav Petkov wrote:
> On Mon, Jun 12, 2017 at 01:47:58PM -0400, Jérémy Lefaure wrote:
> > In i5000 and i5400 edac drivers, the register nrecmemb is defined as a
> > 16 bits value which result in wrong shifts in the code:
> >
]:
https://www.intel.com/content/dam/doc/datasheet/5000p-5000v-5000z-chipset-memory-controller-hub-datasheet.pdf
[2]:
https://www.intel.se/content/dam/doc/datasheet/5400-chipset-memory-controller-hub-datasheet.pdf
Signed-off-by: Jérémy Lefaure
---
I have found this error thanks to the sparse
KTHREAD_SIZE has never been used since it has been defined for c6x arch.
Let's remove this useless definition.
Signed-off-by: Jérémy Lefaure
---
arch/c6x/kernel/asm-offsets.c | 1 -
1 file changed, 1 deletion(-)
diff --git a/arch/c6x/kernel/asm-offsets.c b/arch/c6x/kernel/asm-offsets.c
I didn't find any use of this macro in the current kernel tree (with git
grep). KTHREAD_SIZE is no longer used for a very very long time. So
let's remove this definition.
Signed-off-by: Jérémy Lefaure
---
arch/arm/include/asm/page-nommu.h | 6 --
1 file changed, 6 deletions(-)
di
On Thu, 27 Apr 2017 16:03:45 +0100
David Howells wrote:
> Jérémy Lefaure wrote:
>
> > When building object-list.o, gcc 6 raises a warning on the sprintf call
> > in fscache_objlist_show:
> >
> > CC fs/fscache/object-list.o
> > fs/fscache/object-list.
On Thu, 27 Apr 2017 16:03:45 +0100
David Howells wrote:
> Jérémy Lefaure wrote:
>
> > When building object-list.o, gcc 6 raises a warning on the sprintf call
> > in fscache_objlist_show:
> >
> > CC fs/fscache/object-list.o
> > fs/fscache/object-list.
ls. Also, this patch updates the
documentation.
Signed-off-by: Jérémy Lefaure
---
v2:
_ keep decimal value
_ fix _type buffer size
_ fix documentation
I didn't have the time to test this patch yet but everything should be fine.
Documentation/filesystems/caching/fscache.txt | 2 +-
fs/fscache/ob
On Tue, 25 Apr 2017 00:47:41 +0300
Andy Shevchenko wrote:
> On Sat, Apr 22, 2017 at 2:09 AM, Jérémy Lefaure
> wrote:
> > On Fri, 21 Apr 2017 22:41:54 +0300
> > Andy Shevchenko wrote:
> >> On Wed, Apr 19, 2017 at 11:38 PM, Jérémy Lefaure
> >> wrote:
>
On Mon, 24 Apr 2017 12:14:14 +0300
Andy Shevchenko wrote:
> On Sat, Apr 22, 2017 at 5:19 AM, Jérémy Lefaure
> wrote:
> > The cpufv sysfs file is defined as readable by anyone even if the
> > attribute does not have a show function. The result of every read is an
> > IO
The cpufv sysfs file is defined as readable by anyone even if the
attribute does not have a show function. The result of every read is an
IO error. This file should be write only.
Signed-off-by: Jérémy Lefaure
---
drivers/platform/x86/asus-wmi.c | 4 ++--
1 file changed, 2 insertions(+), 2
On Fri, 21 Apr 2017 22:41:54 +0300
Andy Shevchenko wrote:
> On Wed, Apr 19, 2017 at 11:38 PM, Jérémy Lefaure
> wrote:
> > When building object-list.o, gcc 6 raises a warning on the sprintf call
> > in fscache_objlist_show:
> >
> > CC fs/fscache/object-list.
u", cookie->def->type);
^
Moreover, the documentation says that we should have an hex value for
special cookies (see Documentation/filesystems/caching/fscache.txt).
Printing hexadecimal value for special cookies fixes the overflow
warning and complies with the documentation.
Signed
river for qcom-chipsets")
Signed-off-by: Jérémy Lefaure
---
drivers/phy/Kconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/drivers/phy/Kconfig b/drivers/phy/Kconfig
index c120071fd2c8..e881eb2ef305 100644
--- a/drivers/phy/Kconfig
+++ b/drivers/phy/Kconfig
@@ -443,6 +443,7
dev_max),
^~~~
Casting the BLK_DEF_MAX_SECTORS constant fixes this issue.
Cc: # v4.4+
Fixes: c3e62673ee20 ("scsi: sd: Consider max_xfer_blocks if opt_xfer_blocks is
unusable")
Signed-off-by: Jérémy Lefaure
---
drivers/scsi/sd.c | 5 +++--
1 file changed, 3 insertions(+), 2
d-off-by: Jérémy Lefaure
---
drivers/rapidio/devices/tsi721.c | 7 ---
drivers/rapidio/devices/tsi721.h | 4 ++--
2 files changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/rapidio/devices/tsi721.c b/drivers/rapidio/devices/tsi721.c
index 9d19b9a62011..ca4dcb475f41 100644
--- a/dr
The MTR_DRAM_WIDTH macro returns the data width. It is sometimes used as
if it returned a boolean true if the width if 8. This patch fixes the
tests where MTR_DRAM_WIDTH is misused.
Signed-off-by: Jérémy Lefaure
---
drivers/edac/i5000_edac.c | 2 +-
drivers/edac/i5400_edac.c | 5 +++--
2 files
On Sun, 12 Feb 2017 15:01:55 +0100
Borislav Petkov wrote:
> On Fri, Dec 16, 2016 at 11:19:16PM -0500, Jérémy Lefaure wrote:
> > I don't know why gcc raises a warning on that even if it is not used.
> > Anyway, I'm sure that the warning is reproducible. Both of your
&g
Commit-ID: f357563f958df06cd9ea9e614cdba30578bb08b1
Gitweb: http://git.kernel.org/tip/f357563f958df06cd9ea9e614cdba30578bb08b1
Author: Jérémy Lefaure
AuthorDate: Fri, 16 Dec 2016 19:29:27 -0500
Committer: Thomas Gleixner
CommitDate: Mon, 19 Dec 2016 10:55:43 +0100
irqchip/st: Mark
On Mon, 12 Dec 2016 17:52:50 +0300
"Kirill A. Shutemov" wrote:
> On Thu, Dec 08, 2016 at 01:25:37PM -0500, Jérémy Lefaure wrote:
> > On Thu, 8 Dec 2016 13:50:11 +0300
> > "Kirill A. Shutemov" wrote:
> >
> > > On Wed, Dec 07, 2016 at 11:3
~~
Adding __maybe_unused to the declaration of this functions removes the
warning.
Signed-off-by: Jérémy Lefaure
---
drivers/irqchip/irq-st.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/irqchip/irq-st.c b/drivers/irqchip/irq-st.c
index 9af48a85c16f..5e0e250db0be 10
On Thu, 8 Dec 2016 13:50:11 +0300
"Kirill A. Shutemov" wrote:
> On Wed, Dec 07, 2016 at 11:38:33PM -0500, Jérémy Lefaure wrote:
> > When CONFIG_TRANSPARENT_HUGEPAGE is disabled, split_huge_pmd is a no-op
> > stub. In such case, vma is unused and a compiler raises a w
On Thu, 8 Dec 2016 09:33:05 +0100
Borislav Petkov wrote:
> On Wed, Dec 07, 2016 at 11:38:33PM -0500, Jérémy Lefaure wrote:
> > When CONFIG_TRANSPARENT_HUGEPAGE is disabled, split_huge_pmd is a no-op
> > stub. In such case, vma is unused and a compiler raises a warning:
> >
vm_area_struct *vma = find_vma(mm, 0xA);
^~~
Adding __maybe_unused in the vma declaration fixes this warning.
In addition, checking if CONFIG_TRANSPARENT_HUGEPAGE is enabled avoids
calling find_vma function for nothing.
Signed-off-by: Jérémy Lefaure
---
arch/x86
64 matches
Mail list logo