Message ID | 20211021074621.901-1-phil@philpotter.co.uk (mailing list archive) |
---|---|
State | New, archived |
Headers | show |
Series | cdrom: Remove redundant variable and its assignment | expand |
On Thu, 21 Oct 2021 08:46:21 +0100, Phillip Potter wrote: > From: luo penghao <luo.penghao@zte.com.cn> > > Variable is not used in functions, and its assignment is redundant too. > So it should be deleted. Also the inner-most set of parentheses is no > longer needed. > > The clang_analyzer complains as follows: > > [...] Applied, thanks! [1/1] cdrom: Remove redundant variable and its assignment commit: bbc3925cf696422492ebdaba386e61450fa2294c Best regards,
diff --git a/drivers/cdrom/cdrom.c b/drivers/cdrom/cdrom.c index 89a68457820a..9877e413fce3 100644 --- a/drivers/cdrom/cdrom.c +++ b/drivers/cdrom/cdrom.c @@ -871,7 +871,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi) { struct packet_command cgc; char buffer[32]; - int ret, mmc3_profile; + int mmc3_profile; init_cdrom_command(&cgc, buffer, sizeof(buffer), CGC_DATA_READ); @@ -881,7 +881,7 @@ static void cdrom_mmc3_profile(struct cdrom_device_info *cdi) cgc.cmd[8] = sizeof(buffer); /* Allocation Length */ cgc.quiet = 1; - if ((ret = cdi->ops->generic_packet(cdi, &cgc))) + if (cdi->ops->generic_packet(cdi, &cgc)) mmc3_profile = 0xffff; else mmc3_profile = (buffer[6] << 8) | buffer[7];