staging: rtl8723bs: change return type of _rtw_pktfile_read to int
Hi Dan,
Thanks for the feedback.
I'll drop the type-change patch and reorganize the series into two patches for v6 as you suggested.
Regarding the return type,
I’ve audited the call sites including set_qos(), update_attrib(),
and rtw_xmitframe_coalesce(), along with their callers rtw_xmit() and xmit_frames().
Since these functions handle errors immediately and exit, I initially thought a negative return value would be safe.
I'm curious if I missed a specific scenario in the current code, or if your advice is more about general defensive programming—such as avoiding future risks like implicit casting or pointer arithmetic issues.
I’d appreciate your insight on this
so I can better understand the preferred approach in the kernel.
Best regards
Minu Jin
Quoted 9 lines · Minu Jin
Hi Dan,
Thanks for the feedback.
I'll drop the type-change patch and reorganize the series into two patches for v6 as you suggested.Regarding the return type,
I’ve audited the call sites includingset_qos(),update_attrib(),
andrtw_xmitframe_coalesce(), along with their callersrtw_xmit()andxmit_frames().
The issue is the ordering of the patches. You introduced a negative return and then fixed up the callers later. There was only one file which used the return but it treated the negative error code like a byte count.
You can't break stuff and then fix it later in the series because it break git bisect.
regards,
dan carpenter