to
> avoid loss of information, then you have loss of information.
> [truncLongCastAssignment]
The source code of the first one is
mem_size = 10 * page_size;
Maybe better code:
mem_size = 10ULL * page_size;
Regards
David Binderman
Config.HCIExtensionVer >= 1) {
Suggest remove second test.
Regards
David Binderman
D_DIF_TYPE3_PROTECTION)
Regards
David Binderman
p; 0x7f) <= 0x7f)
2.
inux-4.8-rc1/drivers/dma/txx9dmac.c:746]: (style) Expression '(X &
0xff) <= 0xff' is always true.
Duplicate, a few lines earlier.
Regards
David Binderman
TEL_BSM_MASK (0xUL<< 20)
might be better.
Regards
David Binderman
else
return -EINVAL;
} else if (enabled) { /* 2 */
I am not sure of a suitable fix for this.
Regards
David Binderman
Hello there,
include/linux/cec-funcs.h:1280:50: warning: logical ‘and’ applied to
non-boolean constant [-Wlogical-op]
Source code is
msg->msg[4] = ui_cmd->channel_identifier.major && 0xff;
Maybe better code
msg->msg[4] = ui_cmd->channel_identifier.major &am
));
Maybe better code
ASSERT(!eofb || (eofb->eof_scan_owner != 0));
Regards
David Binderman
Hello there,
drivers/usb/usbip/vudc_rx.c:145:27: warning: result of ‘11 << 30’
requires 35 bits to represent, but ‘int’ only has 32 bits
[-Wshift-overflow=]
Source code is
urb_p->urb->pipe &= ~(11 << 30);
Maybe better code
urb_p->urb->pipe &= ~(11UL << 30);
Regards
David Binderman
the code, but given that insn is unsigned long and so can go
past 32 bits, using a cast to unsigned int might throw away the
possibly important
upper bits.
Regards
David Binderman
er use the variable in some way, or delete it.
Regards
David Binderman
nt' but the argument type is
'unsigned long'.
Source code is
static inline int print_insn_powerpc(unsigned long insn, unsigned long memaddr)
{
printf("%.8x", insn);
return 0;
}
static inline int print_insn_spu(unsigned long insn, unsigned long memaddr)
{
pri
Hello there,
linux-4.7-rc5/arch/powerpc/platforms/512x/clock-commonclk.c:824]:
(warning) %d in format string (no. 1) requires 'int' but the argument
type is 'size_t {aka unsigned long}'.
Source code is
snprintf(name, sizeof(name), "psc%d", mclk_idx);
Regards
David Binderman
m_crtcs)
return 0;
crtc = priv->crtcs[pipe];
Feel free to mess this tentative patch about in any way you see fit.
Regards
David Binderman
On Mon, Jun 13, 2016 at 4:27 PM, Rob Clark wrote:
> yup, looks like we can drop the two pipe<0 checks. Care to send a patch?
>
>
_drv_main.c:228]: (style) Variable
'ret' is assigned a value that is never used.
This might be a case where a function return value is not checked.
Regards
David Binderman
(style)
Checking if unsigned variable 'pipe' is less than zero.
Duplicate a few lines further down.
Regards
David Binderman
Hello there,
linux-4.7-rc3/drivers/dma/cppi41.c:509]: (style) Condition 'num>0' is
always false
Source code is
BUG_ON(num > 0);
Local variable num doesn't get used anywhere. Suggest remove.
Regards
David Binderman
ned a value that is never used.
[drivers/gpu/drm/amd/amdgpu/gfx_v7_0.c:4657]: (style) Variable 'tmp'
is assigned a value that is never used.
Regards
David Binderman
ideo/fbdev/sis/init.c:3562]: (style) Variable 'HBS' is
assigned a value that is never used.
[drivers/video/fbdev/sis/init.c:3616]: (style) Variable 'VBS' is
assigned a value that is never used.
[drivers/video/fbdev/sis/init.c:3597]: (style) Variable 'A' is
assigned a value that is never used.
Suggest either use these variables in some way, or delete them.
Regards
David Binderman
Hello there,
linux-4.7-rc2/drivers/video/fbdev/intelfb/intelfbdrv.c:1041]: (style)
Redundant condition: If 'msrc > 1', the comparison 'msrc' is always
true.
Source code is
if (msrc && msrc > 1) {
Maybe better code
if (msrc > 1) {
Regards
David Binderman
signed a
value that is never used.
[drivers/rtc/rtc-ds1685.c:812]: (style) Variable 'ctrlc' is assigned a
value that is never used.
Regards
David Binderman
is assigned a value that is never used.
[drivers/net/wireless/ath/ath6kl/wmi.c:3521]: (style) Variable 'ret'
is assigned a value that is never used.
Regards
David Binderman
Also in the same file:
[drivers/net/fjes/fjes_main.c:1321]: (style) Variable 'max_epid' is
assigned a value that is never used.
[drivers/net/fjes/fjes_main.c:1320]: (style) Variable 'my_epid' is
assigned a value that is never used.
These two might be candidates for deletion.
Regards
David Binderman
ate->port_mfl[mac_id] &&
(mfl <= fman->state->port_mfl[mac_id]))) {
Suggest new code
if ((!fman->state->port_mfl[mac_id]) ||
(mfl <= fman->state->port_mfl[mac_id])) {
Regards
David Binderman
Hello there,
drivers/net/ethernet/qlogic/qed/qed_dcbx.c:210:16: warning: comparison
is always false due to limited range of data type [-Wtype-limits]
Source code is
if (priority < 0) {
but
u8 tc, priority, priority_map;
Regards
David Binderman
Hello there,
linux-4.6/net/kcm/kcmsock.c:1508]: (style) Checking if unsigned
variable 'copied' is less than zero.
Source code is
if (copied < 0) {
but
size_t copied;
Suggest code rework.
Regards
David Binderman
if (dev->hbm_state <= MEI_HBM_ENUM_CLIENTS ||
dev->hbm_state>= MEI_HBM_STOPPED) {
Regards
David Binderman
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majord...@vg
ess than zero.
Another duplicate.
Regards
David Binderman
--
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/major
id
> code.
After a deeper look at the code, agreed. False positive by the tool.
I also checked the rest of the /irqchip/ directory for other messages by
the tool and couldn't see anything else suspicious.
Regards
David Binderman
--
To unsubscri
{
>>
>> Suggest sanity check array index before use.
>
> Which version of gcc is being stupid here?
None of them.
The original "(style)" message is from a static analysis tool called cppcheck.
I can't think of a situation where, if an array ind
Hello there,
[linux-4.1-rc7/drivers/irqchip/irq-renesas-intc-irqpin.c:418]: (style) Array ind
ex 'k' is used before limits check.
if (!io[k] && k < INTC_IRQPIN_REG_NR_MANDATORY) {
Suggest sanity check array index before use.
Reg
Hello there,
The following patch adds an obvious speedup for 64 bit data to lib/sort.c
In tests on a 64 bit machine, the code at the end of the lib/sort.c
file executed some 40% faster.
The patch is against kernel version 3.16-rc6
Regards
David Binderman
Signed-off-by: David Binderman
32 matches
Mail list logo