Re: [PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode

2023-12-18 Thread Martin K. Petersen
On Tue, 12 Dec 2023 23:19:06 +, Justin Stitt wrote: > Instead of copying @buf into a new buffer and carefully managing its > newline/null-terminating status, we can just use sysfs_match_string() > as it uses sysfs_streq() internally which handles newline/null-term: > > | /** > | * sysfs_st

Re: [PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode

2023-12-13 Thread Martin K. Petersen
Justin, > Instead of copying @buf into a new buffer and carefully managing its > newline/null-terminating status, we can just use sysfs_match_string() > as it uses sysfs_streq() internally which handles newline/null-term: Applied to 6.8/scsi-staging, thanks! -- Martin K. Petersen Oracle

Re: [PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode

2023-12-12 Thread Hannes Reinecke
On 12/13/23 00:19, Justin Stitt wrote: Instead of copying @buf into a new buffer and carefully managing its newline/null-terminating status, we can just use sysfs_match_string() as it uses sysfs_streq() internally which handles newline/null-term: | /** | * sysfs_streq - return true if strings

Re: [PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode

2023-12-12 Thread Kees Cook
On Tue, Dec 12, 2023 at 11:19:06PM +, Justin Stitt wrote: > Instead of copying @buf into a new buffer and carefully managing its > newline/null-terminating status, we can just use sysfs_match_string() > as it uses sysfs_streq() internally which handles newline/null-term: > > | /** > | * sys

[PATCH v2] scsi: fcoe: use sysfs_match_string over fcoe_parse_mode

2023-12-12 Thread Justin Stitt
Instead of copying @buf into a new buffer and carefully managing its newline/null-terminating status, we can just use sysfs_match_string() as it uses sysfs_streq() internally which handles newline/null-term: | /** | * sysfs_streq - return true if strings are equal, modulo trailing newline | *