platform/x86: dell_rbu: fix assignment in if condition warning
Refactor to remove assignments from inside if conditions, as required
by kernel coding style. This improves code readability and resolves
checkpatch.pl warnings:
ERROR: do not use assignment in if condition
Signed-off-by: Darshan Rathod <darshanrathod475@gmail.com>
Link: https://lore.kernel.org/r/20250801104705.1824495-1-darshanrathod475@gmail.com
Reviewed-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
Signed-off-by: Ilpo Järvinen <ilpo.jarvinen@linux.intel.com>
This commit is contained in:
@@ -232,7 +232,8 @@ static int packetize_data(const u8 *data, size_t length)
|
||||
done = 1;
|
||||
}
|
||||
|
||||
if ((rc = create_packet(temp, packet_length)))
|
||||
rc = create_packet(temp, packet_length);
|
||||
if (rc)
|
||||
return rc;
|
||||
|
||||
pr_debug("%p:%td\n", temp, (end - temp));
|
||||
@@ -276,7 +277,7 @@ static int do_packet_read(char *data, struct packet_data *newpacket,
|
||||
return bytes_copied;
|
||||
}
|
||||
|
||||
static int packet_read_list(char *data, size_t * pread_length)
|
||||
static int packet_read_list(char *data, size_t *pread_length)
|
||||
{
|
||||
struct packet_data *newpacket;
|
||||
int temp_count = 0;
|
||||
@@ -445,7 +446,8 @@ static ssize_t read_packet_data(char *buffer, loff_t pos, size_t count)
|
||||
bytes_left = rbu_data.imagesize - pos;
|
||||
data_length = min(bytes_left, count);
|
||||
|
||||
if ((retval = packet_read_list(ptempBuf, &data_length)) < 0)
|
||||
retval = packet_read_list(ptempBuf, &data_length);
|
||||
if (retval < 0)
|
||||
goto read_rbu_data_exit;
|
||||
|
||||
if ((pos + count) > rbu_data.imagesize) {
|
||||
|
||||
Reference in New Issue
Block a user