lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <780fd221-0ab9-4750-92f7-93cb2f645f60@amd.com>
Date: Tue, 9 Jan 2024 11:56:47 -0800
From: "Nelson, Shannon" <shannon.nelson@....com>
To: Sergey Ryazanov <ryazanov.s.a@...il.com>,
 Jinjian Song <songjinjian@...mail.com>
Cc: netdev@...r.kernel.org, chandrashekar.devegowda@...el.com,
 chiranjeevi.rapolu@...ux.intel.com, haijun.liu@...iatek.com,
 m.chetan.kumar@...ux.intel.com, ricardo.martinez@...ux.intel.com,
 loic.poulain@...aro.org, johannes@...solutions.net, davem@...emloft.net,
 edumazet@...gle.com, kuba@...nel.org, pabeni@...hat.com,
 linux-kernel@...r.kernel.com, vsankar@...ovo.com, danielwinkler@...gle.com,
 nmarupaka@...gle.com, joey.zhao@...ocom.com, liuqf@...ocom.com,
 felix.yan@...ocom.com, Jinjian Song <jinjian.song@...ocom.com>
Subject: Re: [net-next v3 2/3] net: wwan: t7xx: Add sysfs attribute for device
 state machine

On 1/8/2024 1:37 PM, Sergey Ryazanov wrote:
> 
> On 28.12.2023 11:44, Jinjian Song wrote:
> 
> [skipped]
> 
>> +     switch (mode) {
>> +     case T7XX_READY:
>> +             return sprintf(buf, "T7XX_MODEM_READY\n");
>> +     case T7XX_RESET:
>> +             return sprintf(buf, "T7XX_MODEM_RESET\n");
>> +     case T7XX_FASTBOOT_DL_SWITCHING:
>> +             return sprintf(buf, "T7XX_MODEM_FASTBOOT_DL_SWITCHING\n");
>> +     case T7XX_FASTBOOT_DL_MODE:
>> +             return sprintf(buf, "T7XX_MODEM_FASTBOOT_DL_MODE\n");
>> +     case T7XX_FASTBOOT_DUMP_MODE:
>> +             return sprintf(buf, "T7XX_MODEM_FASTBOOT_DUMP_MODE\n");
>> +     default:
>> +             return sprintf(buf, "T7XX_UNKNOWN\n");
> 
> Out of curiosity, what the purpose of this common prefix "T7XX_MODEM_"?
> Do you have a plan to support more then T7xx modems?
> 
> And BTW, can we use a lighter method of string copying like strncpy()?

A quick note from the sidelines: better would be strscpy()
See 
https://www.kernel.org/doc/html/latest/process/deprecated.html#strncpy-on-nul-terminated-strings

sln


> 
> -- 
> Sergey
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ