Search Linux Wireless

RE: [PATCH] mwifiex: Using %*phD instead of print_hex_dump_bytes

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Andy,

> > I checked briefly the code and found that the constant is heavily used
> > as a definition for the length of static byte arrays. So, in that case
> > probably better to use %*ph, but apply sizeof(cool_var) instead of
> (int)sizeof(cool_var) of course
> 
> > putting constant there.
> 
> And one finding more: buffers are defined as u16. I'm afraid the both
> previous and proposed versions are printing something interesting, like
> only half of the defined data.

You are right. The original code should be like this:

                print_hex_dump_bytes("last_cmd_id: ", DUMP_PREFIX_OFFSET,
-                                    adapter->dbg.last_cmd_id, DBG_CMD_NUM);
+                                    adapter->dbg.last_cmd_id,
+                                    sizeof(adapter->dbg.last_cmd_id));

and then in Andrei's patch:

		dev_err(adapter->dev, "last_cmd_id: %*ph\n",
			(int)sizeof(adapter->dbg.last_cmd_id)),
			adapter->dbg.last_cmd_id);

I will send a patch to fix the original code.

Thanks,
Bing

��.n��������+%������w��{.n�����{���zW����ܨ}���Ơz�j:+v�����w����ޙ��&�)ߡ�a����z�ޗ���ݢj��w�f



[Index of Archives]     [Linux Host AP]     [ATH6KL]     [Linux Wireless Personal Area Network]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Linux Kernel]     [IDE]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite Hiking]     [MIPS Linux]     [ARM Linux]     [Linux RAID]

  Powered by Linux